Skip to content

Commit 4b600fd

Browse files
authored
Merge branch 'main' into user/asklar/on_device
2 parents eea82a7 + 84387c9 commit 4b600fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1303
-333
lines changed

.github/workflows/cancel-pulumi-lock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ jobs:
7373
run: |
7474
echo "$PULUMI_PROD_PASSPHRASE" > passphrase.prod.txt
7575
pulumi login gs://mcp-registry-prod-pulumi-state
76-
PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi cancel --stack gcpProd --yes
76+
PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi cancel --stack gcpProd --yes

.github/workflows/ci.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,12 @@ jobs:
2222
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
2323
with:
2424
go-version-file: 'go.mod'
25-
26-
- name: Cache Go modules
27-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
28-
with:
29-
path: |
30-
~/.cache/go-build
31-
~/go/pkg/mod
32-
key: ${{ runner.os }}-go-${{ github.sha }}-${{ hashFiles('**/go.sum', '.golangci.yml') }}
33-
restore-keys: |
34-
${{ runner.os }}-go-
35-
36-
- name: Download dependencies
37-
run: go mod download
38-
39-
- name: Install golangci-lint
40-
run: |
41-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.4.0
25+
cache: true
4226

4327
- name: Run lint
44-
run: make lint
28+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
29+
with:
30+
version: v2.4.0
4531

4632
- name: Validate schemas and examples
4733
run: make validate
@@ -66,19 +52,7 @@ jobs:
6652
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
6753
with:
6854
go-version-file: 'go.mod'
69-
70-
- name: Cache Go modules
71-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
72-
with:
73-
path: |
74-
~/.cache/go-build
75-
~/go/pkg/mod
76-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
77-
restore-keys: |
78-
${{ runner.os }}-go-
79-
80-
- name: Download dependencies
81-
run: go mod download
55+
cache: true
8256

8357
- name: Run all tests
8458
run: make test-all
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy to Production
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'deploy/Pulumi.gcpProd.yaml'
9+
10+
permissions:
11+
contents: read
12+
13+
env:
14+
PULUMI_VERSION: "3.188.0"
15+
16+
jobs:
17+
deploy-production:
18+
name: Deploy to Production
19+
runs-on: ubuntu-latest
20+
environment: production
21+
concurrency:
22+
group: deploy-production
23+
cancel-in-progress: false
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
27+
28+
- name: Setup Go
29+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
30+
with:
31+
go-version-file: 'go.mod'
32+
cache: true
33+
34+
- name: Setup Pulumi
35+
uses: pulumi/actions@d7ceb0215da5a14ec84f50b703365ddf0194a9c8
36+
with:
37+
pulumi-version: ${{ env.PULUMI_VERSION }}
38+
39+
- name: Authenticate to Google Cloud
40+
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
41+
with:
42+
credentials_json: ${{ secrets.GCP_PROD_SERVICE_ACCOUNT_KEY }}
43+
44+
- name: Setup Google Cloud SDK
45+
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db
46+
with:
47+
project_id: mcp-registry-prod
48+
install_components: gke-gcloud-auth-plugin
49+
50+
- name: Deploy to Production
51+
working-directory: ./deploy
52+
env:
53+
PULUMI_PROD_PASSPHRASE: ${{ secrets.PULUMI_PROD_PASSPHRASE }}
54+
run: |
55+
echo "$PULUMI_PROD_PASSPHRASE" > passphrase.prod.txt
56+
make prod-up

.github/workflows/deploy.yml renamed to .github/workflows/deploy-staging.yml

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
name: Deploy
1+
name: Deploy to Staging
22

33
on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- 'deploy/Pulumi.gcpProd.yaml'
79

810
permissions:
911
contents: read
@@ -69,6 +71,7 @@ jobs:
6971
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
7072
with:
7173
go-version-file: 'go.mod'
74+
cache: true
7275

7376
- name: Setup Pulumi
7477
uses: pulumi/actions@d7ceb0215da5a14ec84f50b703365ddf0194a9c8
@@ -93,44 +96,3 @@ jobs:
9396
run: |
9497
echo "$PULUMI_STAGING_PASSPHRASE" > passphrase.staging.txt
9598
make staging-up
96-
97-
deploy-production:
98-
name: Deploy to Production
99-
runs-on: ubuntu-latest
100-
environment: production
101-
needs: deploy-staging
102-
concurrency:
103-
group: deploy-production
104-
cancel-in-progress: false
105-
steps:
106-
- name: Checkout code
107-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
108-
109-
- name: Setup Go
110-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
111-
with:
112-
go-version-file: 'go.mod'
113-
114-
- name: Setup Pulumi
115-
uses: pulumi/actions@d7ceb0215da5a14ec84f50b703365ddf0194a9c8
116-
with:
117-
pulumi-version: ${{ env.PULUMI_VERSION }}
118-
119-
- name: Authenticate to Google Cloud
120-
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
121-
with:
122-
credentials_json: ${{ secrets.GCP_PROD_SERVICE_ACCOUNT_KEY }}
123-
124-
- name: Setup Google Cloud SDK
125-
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db
126-
with:
127-
project_id: mcp-registry-prod
128-
install_components: gke-gcloud-auth-plugin
129-
130-
- name: Deploy to Production
131-
working-directory: ./deploy
132-
env:
133-
PULUMI_PROD_PASSPHRASE: ${{ secrets.PULUMI_PROD_PASSPHRASE }}
134-
run: |
135-
echo "$PULUMI_PROD_PASSPHRASE" > passphrase.prod.txt
136-
make prod-up

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ jobs:
2222
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
2323
with:
2424
go-version-file: 'go.mod'
25+
cache: true
2526

2627
- name: Install cosign
2728
uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62
2829

2930
- name: Install Syft
30-
uses: anchore/sbom-action/[email protected].6
31+
uses: anchore/sbom-action/[email protected].7
3132

3233
- name: Run GoReleaser
3334
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a

cmd/publisher/commands/init.go

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -267,36 +267,63 @@ func createServerJSON(
267267
packageType, packageIdentifier, packageVersion string,
268268
envVars []model.KeyValueInput,
269269
) apiv0.ServerJSON {
270-
// Determine registry type and base URL
271-
var registryType, registryBaseURL string
270+
// Create package based on type
271+
var pkg model.Package
272+
272273
switch packageType {
273274
case model.RegistryTypeNPM:
274-
registryType = model.RegistryTypeNPM
275-
registryBaseURL = model.RegistryURLNPM
275+
pkg = model.Package{
276+
RegistryType: model.RegistryTypeNPM,
277+
Identifier: packageIdentifier,
278+
Version: packageVersion,
279+
EnvironmentVariables: envVars,
280+
Transport: model.Transport{
281+
Type: model.TransportTypeStdio,
282+
},
283+
}
276284
case model.RegistryTypePyPI:
277-
registryType = model.RegistryTypePyPI
278-
registryBaseURL = model.RegistryURLPyPI
285+
pkg = model.Package{
286+
RegistryType: model.RegistryTypePyPI,
287+
Identifier: packageIdentifier,
288+
Version: packageVersion,
289+
EnvironmentVariables: envVars,
290+
Transport: model.Transport{
291+
Type: model.TransportTypeStdio,
292+
},
293+
}
279294
case model.RegistryTypeOCI:
280-
registryType = model.RegistryTypeOCI
281-
registryBaseURL = model.RegistryURLDocker
295+
// OCI packages use canonical references: registry/namespace/image:tag
296+
// Format: docker.io/username/image:version
297+
canonicalRef := fmt.Sprintf("docker.io/%s:%s", packageIdentifier, packageVersion)
298+
pkg = model.Package{
299+
RegistryType: model.RegistryTypeOCI,
300+
Identifier: canonicalRef,
301+
// No Version field for OCI - it's embedded in the canonical reference
302+
EnvironmentVariables: envVars,
303+
Transport: model.Transport{
304+
Type: model.TransportTypeStdio,
305+
},
306+
}
282307
case "url":
283-
registryType = "url"
284-
registryBaseURL = ""
308+
pkg = model.Package{
309+
RegistryType: "url",
310+
Identifier: packageIdentifier,
311+
Version: packageVersion,
312+
EnvironmentVariables: envVars,
313+
Transport: model.Transport{
314+
Type: model.TransportTypeStdio,
315+
},
316+
}
285317
default:
286-
registryType = packageType
287-
registryBaseURL = ""
288-
}
289-
290-
// Create package
291-
pkg := model.Package{
292-
RegistryType: registryType,
293-
RegistryBaseURL: registryBaseURL,
294-
Identifier: packageIdentifier,
295-
Version: packageVersion,
296-
EnvironmentVariables: envVars,
297-
Transport: model.Transport{
298-
Type: model.TransportTypeStdio,
299-
},
318+
pkg = model.Package{
319+
RegistryType: packageType,
320+
Identifier: packageIdentifier,
321+
Version: packageVersion,
322+
EnvironmentVariables: envVars,
323+
Transport: model.Transport{
324+
Type: model.TransportTypeStdio,
325+
},
326+
}
300327
}
301328

302329
// Create server structure

cmd/registry/main.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"time"
1313

1414
"github.com/modelcontextprotocol/registry/internal/api"
15+
v0 "github.com/modelcontextprotocol/registry/internal/api/handlers/v0"
1516
"github.com/modelcontextprotocol/registry/internal/config"
1617
"github.com/modelcontextprotocol/registry/internal/database"
1718
"github.com/modelcontextprotocol/registry/internal/importer"
@@ -39,7 +40,7 @@ func main() {
3940

4041
// Show version information if requested
4142
if *showVersion {
42-
log.Printf("MCP Registry v%s\n", Version)
43+
log.Printf("MCP Registry %s\n", Version)
4344
log.Printf("Git commit: %s\n", GitCommit)
4445
log.Printf("Build time: %s\n", BuildTime)
4546
return
@@ -102,8 +103,15 @@ func main() {
102103
}
103104
}()
104105

106+
// Prepare version information
107+
versionInfo := &v0.VersionBody{
108+
Version: Version,
109+
GitCommit: GitCommit,
110+
BuildTime: BuildTime,
111+
}
112+
105113
// Initialize HTTP server
106-
server := api.NewServer(cfg, registryService, metrics)
114+
server := api.NewServer(cfg, registryService, metrics, versionInfo)
107115

108116
// Start server in a goroutine so it doesn't block signal handling
109117
go func() {

data/seed.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
{
1313
"src": "https://airtable.com/images/favicon/favicon-32x32.png",
1414
"mimeType": "image/png",
15-
"sizes": ["32x32"]
15+
"sizes": [
16+
"32x32"
17+
]
1618
}
1719
],
1820
"packages": [
@@ -35,8 +37,7 @@
3537
},
3638
{
3739
"registryType": "oci",
38-
"identifier": "domdomegg/airtable-mcp-server",
39-
"version": "1.7.2",
40+
"identifier": "docker.io/domdomegg/airtable-mcp-server:1.7.2",
4041
"runtimeHint": "docker",
4142
"transport": {
4243
"type": "stdio"
@@ -53,7 +54,6 @@
5354
{
5455
"registryType": "mcpb",
5556
"identifier": "https://github.com/domdomegg/airtable-mcp-server/releases/download/v1.7.2/airtable-mcp-server.mcpb",
56-
"version": "1.7.2",
5757
"fileSha256": "8220de07a08ebe908f04da139ea03dbfe29758141347e945da60535fb7bcca20",
5858
"transport": {
5959
"type": "stdio"
@@ -90,8 +90,7 @@
9090
},
9191
{
9292
"registryType": "oci",
93-
"identifier": "domdomegg/airtable-mcp-server",
94-
"version": "1.7.3",
93+
"identifier": "docker.io/domdomegg/airtable-mcp-server:1.7.3",
9594
"runtimeHint": "docker",
9695
"transport": {
9796
"type": "stdio"
@@ -108,7 +107,6 @@
108107
{
109108
"registryType": "mcpb",
110109
"identifier": "https://github.com/domdomegg/airtable-mcp-server/releases/download/v1.7.3/airtable-mcp-server.mcpb",
111-
"version": "1.7.3",
112110
"fileSha256": "0f28a9129cfebd262dfb77854c872355d21401bb3e056575b3027081f5d570ca",
113111
"transport": {
114112
"type": "stdio"

deploy/Pulumi.gcpProd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
config:
22
mcp-registry:environment: prod
33
mcp-registry:provider: gcp
4-
mcp-registry:imageTag: latest # Set specific image tag for production (change this to deploy different versions)
4+
mcp-registry:imageTag: 1.3.1 # Set specific image tag for production (change this to deploy different versions)
55
gcp:project: mcp-registry-prod
66
mcp-registry:githubClientId: Iv23liUydBbI7Z2Q9bOZ
77
mcp-registry:githubClientSecret:

0 commit comments

Comments
 (0)