Skip to content

Commit 2ec36c1

Browse files
authored
feat(publish): publish to the official MCP Registry on release (#1585)
## Summary - Adds `server.json` declaring the npm and OCI packages under the `io.github.microsoft/playwright-mcp` namespace (already claimed via `mcpName` in `package.json`). - Adds a `publish-mcp-release-registry` job to `publish.yml` that runs after the npm release, auto-syncs `server.json`'s version from `package.json`, and publishes via `mcp-publisher` using GitHub OIDC (no PAT needed). - Unblocks enterprise users on `registryOnly` MCP policies (e.g. VS Code + Copilot in security-hardened setups) by listing `@playwright/mcp` in the official registry. Fixes #1477 ## Precedent [microsoft/mcp-dotnet-samples](https://github.com/microsoft/mcp-dotnet-samples/blob/main/.github/workflows/build-container.yaml) publishes `io.github.microsoft/awesome-copilot` to the registry from an hourly cron using the exact same flow (`id-token: write` + curl-fetched `mcp-publisher` + `login github-oidc`). It's been running successfully for weeks, so the GitHub-OIDC path is confirmed to work under `microsoft/*` corp policy — no DNS / Key Vault setup needed (unlike the reverted #1197 attempt that used the `com.microsoft/...` namespace). ## Notes - `server.json`'s committed version is just a placeholder; the workflow rewrites it from `package.json` before publish, so future `chore: mark vX.Y.Z` commits don't need to touch `server.json`. - First release after merge is the live test — no dry-run path.
1 parent 97e82bd commit 2ec36c1

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,46 @@ jobs:
6767
- run: npm run ctest
6868
- run: npm publish
6969

70+
publish-mcp-release-registry:
71+
if: github.event_name == 'release'
72+
needs: publish-mcp-release-npm
73+
runs-on: ubuntu-latest
74+
permissions:
75+
contents: read
76+
id-token: write # Required for GitHub OIDC auth to the MCP Registry
77+
steps:
78+
- uses: actions/checkout@v5
79+
80+
- name: Validate server.json version matches package.json
81+
run: |
82+
node -e "
83+
const pkg = require('./package.json');
84+
const server = require('./server.json');
85+
const mismatches = [];
86+
if (server.version !== pkg.version)
87+
mismatches.push(\`server.version=\${server.version} != package.version=\${pkg.version}\`);
88+
for (const p of server.packages) {
89+
if (p.version !== pkg.version)
90+
mismatches.push(\`packages[\${p.identifier}].version=\${p.version} != package.version=\${pkg.version}\`);
91+
}
92+
if (mismatches.length) {
93+
console.error('server.json is out of sync with package.json:');
94+
for (const m of mismatches) console.error(' ' + m);
95+
process.exit(1);
96+
}
97+
"
98+
99+
- name: Install mcp-publisher
100+
run: |
101+
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" \
102+
| tar xz mcp-publisher
103+
104+
- name: Authenticate with MCP Registry (GitHub OIDC)
105+
run: ./mcp-publisher login github-oidc
106+
107+
- name: Publish to MCP Registry
108+
run: ./mcp-publisher publish
109+
70110
publish-mcp-release-docker:
71111
if: github.event_name == 'release'
72112
runs-on: ubuntu-latest

server.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3+
"name": "io.github.microsoft/playwright-mcp",
4+
"description": "Playwright Tools for MCP",
5+
"repository": {
6+
"url": "https://github.com/microsoft/playwright-mcp",
7+
"source": "github"
8+
},
9+
"version": "0.0.71",
10+
"packages": [
11+
{
12+
"registryType": "npm",
13+
"identifier": "@playwright/mcp",
14+
"version": "0.0.71",
15+
"transport": {
16+
"type": "stdio"
17+
}
18+
},
19+
{
20+
"registryType": "oci",
21+
"registryBaseUrl": "https://playwright.azurecr.io",
22+
"identifier": "public/playwright/mcp",
23+
"version": "0.0.71",
24+
"transport": {
25+
"type": "stdio"
26+
}
27+
}
28+
]
29+
}

0 commit comments

Comments
 (0)