Skip to content

Commit d109921

Browse files
committed
feat(mcp-registry): publish custom tools server to mcp-registry
1 parent a4c9287 commit d109921

File tree

3 files changed

+149
-1
lines changed

3 files changed

+149
-1
lines changed

.github/release-please.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,14 @@ extraFiles: [
3838
"docs/en/how-to/connect-ide/neo4j_mcp.md",
3939
"docs/en/how-to/connect-ide/sqlite_mcp.md",
4040
"gemini-extension.json",
41-
]
41+
{
42+
"type": "json",
43+
"path": ".registry/server.json",
44+
"jsonpath": "$.version"
45+
},
46+
{
47+
"type": "json",
48+
"path": ".registry/server.json",
49+
"jsonpath": "$.packages[0].identifier"
50+
},
51+
]

.github/workflows/publish-mcp.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Publish to MCP Registry
16+
17+
on:
18+
push:
19+
tags: ["v*"] # Triggers on version tags like v1.0.0
20+
# allow manual triggering with no inputs required
21+
workflow_dispatch:
22+
23+
jobs:
24+
publish:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
id-token: write # Required for OIDC authentication
28+
contents: read
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v5
33+
34+
- name: Wait for image in Artifact Registry
35+
shell: bash
36+
run: |
37+
MAX_ATTEMPTS=3
38+
VERSION=$(jq -r '.version' server.json)
39+
REGISTRY_URL="https://us-central1-docker.pkg.dev/v2/database-toolbox/toolbox/toolbox/manifests/${VERSION}"
40+
41+
# initially sleep time to wait for the version release
42+
sleep 10m
43+
44+
for i in $(seq 1 ${MAX_ATTEMPTS}); do
45+
echo "Attempt $i: Checking for image ${REGISTRY_URL}..."
46+
# Use curl to check the manifest header
47+
# Using -I to fetch headers only, -s silent, -f fail fast on errors.
48+
curl -Isf "${REGISTRY_URL}" > /dev/null
49+
50+
if [ $? -eq 0 ]; then
51+
echo "✅ Image found! Continuing to next steps."
52+
exit 0
53+
else
54+
echo "❌ Image not found (likely 404 error) on attempt $i."
55+
if [ $i -lt ${MAX_ATTEMPTS} ]; then
56+
echo "Sleeping for 5 minutes before next attempt..."
57+
sleep 5m
58+
else
59+
echo "Maximum attempts reached. Image not found."
60+
exit 1
61+
fi
62+
fi
63+
done
64+
65+
- name: Install MCP Publisher
66+
run: |
67+
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
68+
69+
- name: Login to MCP Registry
70+
run: ./mcp-publisher login github-oidc
71+
72+
- name: Publish to MCP Registry
73+
run: ./mcp-publisher publish --file=.registry/server.json

.registry/server.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
3+
"name": "io.github.googleapis/genai-toolbox",
4+
"description": "MCP Toolbox for Databases enables your agent to connect to your database.",
5+
"status": "active",
6+
"repository": {
7+
"url": "https://github.com/googleapis/genai-toolbox",
8+
"source": "github"
9+
},
10+
"version": "0.18.0",
11+
"packages": [
12+
{
13+
"registryType": "oci",
14+
"registryBaseUrl": "https://artifactregistry.googleapis.com",
15+
"identifier": "us-central1-docker.pkg.dev/database-toolbox/toolbox/toolbox:0.18.0",
16+
"transport": {
17+
"type": "streamable-http",
18+
"url": "http://{host}:{port}"
19+
},
20+
"packageArguments": [
21+
{
22+
"type": "named",
23+
"name": "--tools-file",
24+
"description": "File path specifying the tool configuration.",
25+
"default": "tools.yaml",
26+
"isRequired": false
27+
},
28+
{
29+
"type": "named",
30+
"name": "--address",
31+
"description": "Address of the interface the server will listen on.",
32+
"value": "{host}",
33+
"variables": {
34+
"host": {
35+
"description": "address",
36+
"isRequired": true,
37+
"default": "127.0.0.1"
38+
}
39+
}
40+
},
41+
{
42+
"type": "named",
43+
"name": "--port",
44+
"description": "Port the server will listen on.",
45+
"value": "{port}",
46+
"variables": {
47+
"host": {
48+
"description": "port",
49+
"isRequired": true,
50+
"default": "5000"
51+
}
52+
}
53+
},
54+
{
55+
"type": "named",
56+
"name": "--log-level",
57+
"description": "Specify the minimum level logged.",
58+
"default": "info",
59+
"choices": ["debug", "info", "warn", "error"],
60+
"isRequired": true
61+
}
62+
]
63+
}
64+
]
65+
}

0 commit comments

Comments
 (0)