Skip to content

Commit 35556e9

Browse files
authored
ci: publish to the official MCP registry on release (#21)
1 parent 39f2957 commit 35556e9

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,39 @@ jobs:
5353
run: |
5454
npm pkg delete scripts.prepare
5555
npm publish --provenance --access public --tag=canary
56+
57+
# Publishes server.json to the Official MCP Registry.
58+
# `needs: release` gates it on a successful npm publish, so the registry is
59+
# never updated before the package actually exists on npm. Running as a
60+
# separate job means a registry hiccup still can't roll back the release.
61+
# NOTE: the registry CLI + schema are evolving — verify against
62+
# https://github.com/modelcontextprotocol/registry before relying on this.
63+
mcp-registry:
64+
name: Publish to MCP Registry
65+
needs: release
66+
if: ${{ !github.event.release.prerelease }}
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Sync version into server.json
72+
run: |
73+
VERSION="${GITHUB_REF_NAME#v}"
74+
jq --arg v "$VERSION" '.version = $v | (.packages[] |= (.version = $v))' server.json > server.json.tmp
75+
mv server.json.tmp server.json
76+
77+
- name: Install mcp-publisher
78+
run: |
79+
ARCH=$(uname -m)
80+
case "$ARCH" in
81+
x86_64) ARCH=amd64 ;;
82+
aarch64|arm64) ARCH=arm64 ;;
83+
esac
84+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
85+
curl -fsSL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_${OS}_${ARCH}.tar.gz" | tar xz mcp-publisher
86+
87+
- name: Login (GitHub OIDC)
88+
run: ./mcp-publisher login github-oidc
89+
90+
- name: Publish
91+
run: ./mcp-publisher publish

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"version": "0.0.0",
33
"name": "@upstash/mcp-server",
4+
"mcpName": "io.github.upstash/mcp-server",
45
"description": "MCP server for Upstash",
56
"license": "MIT",
67
"type": "module",

server.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3+
"name": "io.github.upstash/mcp-server",
4+
"description": "Manage Upstash databases and resources through the Upstash Developer API.",
5+
"repository": {
6+
"url": "https://github.com/upstash/mcp-server",
7+
"source": "github"
8+
},
9+
"version": "0.0.0",
10+
"packages": [
11+
{
12+
"registryType": "npm",
13+
"registryBaseUrl": "https://registry.npmjs.org",
14+
"identifier": "@upstash/mcp-server",
15+
"version": "0.0.0",
16+
"transport": {
17+
"type": "stdio"
18+
},
19+
"environmentVariables": [
20+
{
21+
"name": "UPSTASH_EMAIL",
22+
"description": "Email address of your Upstash account.",
23+
"isRequired": true,
24+
"isSecret": false
25+
},
26+
{
27+
"name": "UPSTASH_API_KEY",
28+
"description": "Upstash Developer API key (create one at https://console.upstash.com/account/api).",
29+
"isRequired": true,
30+
"isSecret": true
31+
},
32+
{
33+
"name": "UPSTASH_BOX_API_KEY",
34+
"description": "Upstash Box API key for Box-related tools.",
35+
"isRequired": false,
36+
"isSecret": true
37+
}
38+
]
39+
}
40+
]
41+
}

0 commit comments

Comments
 (0)