Skip to content

Commit cd511f4

Browse files
docs(security): pin and verify mcp-publisher installer (modelcontextprotocol#1523)
## Motivation and Context Fixes modelcontextprotocol#1505. The GitHub Actions publishing guide downloaded `mcp-publisher` through the mutable `releases/latest` URL and extracted it without checking the published Sigstore bundle. The three credential-bearing examples now pin the release to `v1.8.1`, download the archive and its bundle separately, verify the release workflow identity and GitHub Actions OIDC issuer with `cosign verify-blob`, and extract only after verification. ## How Has This Been Tested? - Parsed all three fenced workflow examples with PyYAML and checked the pinned version, cosign installer, and verification flags. - Verified the published `v1.8.1` Linux amd64 archive against its published Sigstore bundle with cosign v3.0.6 (the version installed by the pinned cosign-installer action); verification returned `Verified OK`. - Ran `git diff --check`. ## Breaking Changes None. This only hardens the documented installer workflow; existing registry APIs and authentication commands are unchanged. ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing users to update) - [x] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally (documentation/workflow validation listed above) - [x] I have added appropriate error handling - [x] I have added or updated documentation as needed ## Additional context The release version is intentionally explicit so upgrades are reviewable. The Sigstore certificate identity is constrained to this repository's release workflow and the selected tag. --------- Co-authored-by: Radoslav Dimitrov <[email protected]>
1 parent 63d22fa commit cd511f4

1 file changed

Lines changed: 69 additions & 7 deletions

File tree

‎docs/modelcontextprotocol-io/github-actions.mdx‎

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ sidebarTitle: GitHub Actions
1111

1212
In your server project directory, create a `.github/workflows/publish-mcp.yml` file. Here is an example for npm-based local server, but the MCP Registry publishing steps are the same for all package types:
1313

14+
The examples pin `mcp-publisher` to a specific release and verify its Sigstore
15+
bundle before extracting it. When upgrading, update `MCP_PUBLISHER_VERSION` to
16+
the intended release tag deliberately; do not switch back to the mutable
17+
`releases/latest` URL.
18+
1419
<CodeGroup>
1520

1621
```yaml OIDC authentication (recommended)
@@ -26,6 +31,8 @@ jobs:
2631
permissions:
2732
id-token: write # Required for OIDC authentication
2833
contents: read
34+
env:
35+
MCP_PUBLISHER_VERSION: v1.8.1
2936

3037
steps:
3138
- name: Checkout code
@@ -54,9 +61,26 @@ jobs:
5461

5562
### Publish MCP server:
5663

57-
- name: Install mcp-publisher
64+
- name: Install cosign
65+
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
66+
67+
- name: Download and verify mcp-publisher
5868
run: |
59-
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
69+
set -euo pipefail
70+
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
71+
arch="$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"
72+
archive="mcp-publisher_${os}_${arch}.tar.gz"
73+
base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}"
74+
75+
curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
76+
curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
77+
cosign verify-blob \
78+
--bundle "$archive.sigstore.json" \
79+
--certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \
80+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
81+
"$archive"
82+
tar xzf "$archive" mcp-publisher
83+
rm -f "$archive" "$archive.sigstore.json"
6084
6185
- name: Authenticate to MCP Registry
6286
run: ./mcp-publisher login github-oidc
@@ -87,6 +111,8 @@ jobs:
87111
environment: mcp-registry-publish
88112
permissions:
89113
contents: read
114+
env:
115+
MCP_PUBLISHER_VERSION: v1.8.1
90116

91117
steps:
92118
- name: Checkout code
@@ -115,9 +141,26 @@ jobs:
115141

116142
### Publish MCP server:
117143

118-
- name: Install mcp-publisher
144+
- name: Install cosign
145+
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
146+
147+
- name: Download and verify mcp-publisher
119148
run: |
120-
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
149+
set -euo pipefail
150+
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
151+
arch="$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"
152+
archive="mcp-publisher_${os}_${arch}.tar.gz"
153+
base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}"
154+
155+
curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
156+
curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
157+
cosign verify-blob \
158+
--bundle "$archive.sigstore.json" \
159+
--certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \
160+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
161+
"$archive"
162+
tar xzf "$archive" mcp-publisher
163+
rm -f "$archive" "$archive.sigstore.json"
121164
122165
- name: Authenticate to MCP Registry
123166
run: ./mcp-publisher login github --token ${{ secrets.MCP_GITHUB_TOKEN }}
@@ -144,6 +187,8 @@ jobs:
144187
runs-on: ubuntu-latest
145188
permissions:
146189
contents: read
190+
env:
191+
MCP_PUBLISHER_VERSION: v1.8.1
147192

148193
steps:
149194
- name: Checkout code
@@ -172,9 +217,26 @@ jobs:
172217

173218
### Publish MCP server:
174219

175-
- name: Install mcp-publisher
220+
- name: Install cosign
221+
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
222+
223+
- name: Download and verify mcp-publisher
176224
run: |
177-
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
225+
set -euo pipefail
226+
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
227+
arch="$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')"
228+
archive="mcp-publisher_${os}_${arch}.tar.gz"
229+
base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}"
230+
231+
curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
232+
curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
233+
cosign verify-blob \
234+
--bundle "$archive.sigstore.json" \
235+
--certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \
236+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
237+
"$archive"
238+
tar xzf "$archive" mcp-publisher
239+
rm -f "$archive" "$archive.sigstore.json"
178240
179241
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
180242
# TODO: Replace `example.com` with your domain name
@@ -245,7 +307,7 @@ The workflow will run tests, build the package, publish the package to npm, and
245307
| Error Message | Action |
246308
| --- | --- |
247309
| "Authentication failed" | Ensure `id-token: write` permission is set for OIDC, or check secrets. |
248-
| "invalid audience" | Your `mcp-publisher` binary is too old for this registry deployment. Re-run the install step shown above so you pick up the latest release. |
310+
| "invalid audience" | Your `mcp-publisher` binary is too old for this registry deployment. Update `MCP_PUBLISHER_VERSION` to a compatible release and rerun the workflow. |
249311
| "Package validation failed" | Verify your package successfully published to the package registry (e.g., npm, PyPI), and that your package has the [necessary verification information](./package-types). |
250312

251313
{/* prettier-ignore-end */}

0 commit comments

Comments
 (0)