Skip to content

Commit ba86c6b

Browse files
authored
docs: simplify GitHub Actions publishing guide (#446)
Simplifies the GitHub Actions publishing guide to be more concise and easier to follow: ## Changes - Streamlined MCP publisher installation with single-line curl command (no more chmod/directory operations) - Condensed authentication methods into compact sections - Reduced language-specific examples to essential steps only - Updated GitHub Actions to use latest versions (v5) - Made test/build steps optional with `--if-present` flag - Added helpful AI assistant prompt tip to publish-server.md ## Result The guide is now much more succinct while maintaining all essential information, following the same simplified approach as the main publishing guide.
1 parent 9322e78 commit ba86c6b

File tree

2 files changed

+42
-186
lines changed

2 files changed

+42
-186
lines changed

docs/guides/publishing/github-actions.md

Lines changed: 29 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,46 @@ By the end of this tutorial, you'll have:
1313

1414
## Prerequisites
1515

16-
- Already published your server manually (complete [Publishing Tutorial](publish-server.md) first)
16+
- Understand general publishing requirements like package verification (see the [publishing guide](publish-server.md))
1717
- GitHub repository with your MCP server code
18-
- Basic understanding of CI/CD concepts
19-
- 20-30 minutes
2018

2119
## GitHub Actions Setup
2220

2321
### Step 1: Create Workflow File
2422

25-
Create `.github/workflows/publish-mcp.yml` in your repository:
23+
Create `.github/workflows/publish-mcp.yml`. Here's an example for NPM-based packages, but the MCP registry publishing steps are the same for all package types:
2624

2725
```yaml
2826
name: Publish to MCP Registry
2927

3028
on:
3129
push:
32-
tags: ["v*"] # Triggers on version tags like v1.0.0
30+
tags: ["v*"] # Triggers on version tags like v1.0.0
3331

3432
jobs:
3533
publish:
3634
runs-on: ubuntu-latest
3735
permissions:
38-
id-token: write # Required for OIDC authentication
36+
id-token: write # Required for OIDC authentication
3937
contents: read
4038

4139
steps:
4240
- name: Checkout code
43-
uses: actions/checkout@v4
41+
uses: actions/checkout@v5
4442

45-
- name: Setup Node.js # Adjust for your language
46-
uses: actions/setup-node@v4
43+
- name: Setup Node.js # Adjust for your language
44+
uses: actions/setup-node@v5
4745
with:
48-
node-version: "20"
49-
registry-url: "https://registry.npmjs.org"
46+
node-version: "lts/*"
5047

5148
- name: Install dependencies
5249
run: npm ci
5350

5451
- name: Run tests
55-
run: npm test
52+
run: npm run test --if-present
5653

5754
- name: Build package
58-
run: npm run build
55+
run: npm run build --if-present
5956

6057
- name: Publish to npm
6158
run: npm publish
@@ -64,13 +61,7 @@ jobs:
6461

6562
- name: Install MCP Publisher
6663
run: |
67-
# Build publisher from source (requires Go)
68-
git clone https://github.com/modelcontextprotocol/registry publisher-repo
69-
cd publisher-repo
70-
make publisher
71-
cp bin/mcp-publisher ../mcp-publisher
72-
cd ..
73-
chmod +x mcp-publisher
64+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
7465
7566
- name: Login to MCP Registry
7667
run: ./mcp-publisher login github-oidc
@@ -81,12 +72,9 @@ jobs:
8172
8273
### Step 2: Configure Secrets
8374
84-
For npm publishing, add your NPM token to repository secrets:
75+
You don't need any secrets for publishing to the MCP Registry using GitHub OIDC.
8576
86-
1. Go to repository Settings → Secrets and variables → Actions
87-
2. Add `NPM_TOKEN` with your npm access token
88-
89-
**Note:** GitHub OIDC authentication requires no additional secrets for MCP Registry publishing.
77+
However you might need to add secrets for your package registry. For example the workflow above needs a `NPM_TOKEN` (which you can add in Settings → Secrets and variables → Actions).
9078

9179
### Step 3: Tag and Release
9280

@@ -97,30 +85,18 @@ git tag v1.0.0
9785
git push origin v1.0.0
9886
```
9987

100-
The workflow will:
101-
102-
1. Run tests
103-
2. Build your package
104-
3. Publish to npm
105-
4. Automatically authenticate with the MCP Registry
106-
5. Publish updated server.json
88+
The workflow runs tests, builds your package, publishes to npm, and publishes to the MCP Registry.
10789

108-
## Authentication Methods by CI Platform
90+
## Authentication Methods
10991

110-
### GitHub Actions - OIDC (Recommended)
92+
### GitHub Actions OIDC (Recommended)
11193

11294
```yaml
11395
- name: Login to MCP Registry
11496
run: mcp-publisher login github-oidc
11597
```
11698

117-
**Advantages:**
118-
119-
- No secrets to manage
120-
- Automatically scoped to your repository
121-
- Most secure option
122-
123-
### GitHub Actions - Personal Access Token
99+
### GitHub Personal Access Token
124100

125101
```yaml
126102
- name: Login to MCP Registry
@@ -131,7 +107,7 @@ The workflow will:
131107

132108
Add `MCP_GITHUB_TOKEN` secret with a GitHub PAT that has repo access.
133109

134-
### DNS Authentication (Any CI)
110+
### DNS Authentication
135111

136112
For custom domain namespaces (`com.yourcompany/*`):
137113

@@ -144,155 +120,22 @@ For custom domain namespaces (`com.yourcompany/*`):
144120

145121
Add your Ed25519 private key as `MCP_PRIVATE_KEY` secret.
146122

147-
## Language-Specific Examples
148-
149-
### Python Project
150-
151-
```yaml
152-
name: Publish Python MCP Server
153-
154-
on:
155-
push:
156-
tags: ["v*"]
157-
158-
jobs:
159-
publish:
160-
runs-on: ubuntu-latest
161-
permissions:
162-
id-token: write
163-
contents: read
164-
165-
steps:
166-
- uses: actions/checkout@v4
167-
168-
- name: Setup Python
169-
uses: actions/setup-python@v4
170-
with:
171-
python-version: "3.11"
172-
173-
- name: Install Poetry
174-
run: pipx install poetry
123+
## Examples
175124

176-
- name: Build package
177-
run: poetry build
178-
179-
- name: Publish to PyPI
180-
run: poetry publish
181-
env:
182-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
125+
See these real-world examples of automated publishing workflows:
126+
- [NPM, Docker and MCPB](https://github.com/domdomegg/airtable-mcp-server)
127+
- [NuGet](https://github.com/domdomegg/time-mcp-nuget)
128+
- [PyPI](https://github.com/domdomegg/time-mcp-pypi)
183129

184-
- name: Install MCP Publisher
185-
run: |
186-
git clone https://github.com/modelcontextprotocol/registry publisher-repo
187-
cd publisher-repo && make publisher && cd ..
188-
cp publisher-repo/bin/mcp-publisher mcp-publisher
189-
190-
- name: Publish to MCP Registry
191-
run: |
192-
./mcp-publisher login github-oidc
193-
./mcp-publisher publish
194-
```
195-
196-
### Docker Project
130+
## Tips
197131

132+
You can keep your package version and server.json version in sync automatically with something like:
198133
```yaml
199-
name: Publish Docker MCP Server
200-
201-
on:
202-
push:
203-
tags: ["v*"]
204-
205-
jobs:
206-
publish:
207-
runs-on: ubuntu-latest
208-
permissions:
209-
id-token: write
210-
contents: read
211-
212-
steps:
213-
- uses: actions/checkout@v4
214-
215-
- name: Setup Docker Buildx
216-
uses: docker/setup-buildx-action@v3
217-
218-
- name: Login to Docker Hub
219-
uses: docker/login-action@v3
220-
with:
221-
username: ${{ secrets.DOCKER_USERNAME }}
222-
password: ${{ secrets.DOCKER_PASSWORD }}
223-
224-
- name: Extract version
225-
id: version
226-
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
227-
228-
- name: Build and push
229-
uses: docker/build-push-action@v5
230-
with:
231-
context: .
232-
push: true
233-
tags: yourname/your-server:${{ steps.version.outputs.version }}
234-
labels: |
235-
io.modelcontextprotocol.server.name=io.github.yourname/your-server
236-
237-
- name: Install MCP Publisher
238-
run: |
239-
git clone https://github.com/modelcontextprotocol/registry publisher-repo
240-
cd publisher-repo && make publisher && cd ..
241-
cp publisher-repo/bin/mcp-publisher mcp-publisher
242-
243-
- name: Publish to MCP Registry
244-
run: |
245-
./mcp-publisher login github-oidc
246-
./mcp-publisher publish
247-
```
248-
249-
## Best Practices
250-
251-
### 1. Version Alignment
252-
253-
Keep your package version and server.json version in sync:
254-
255-
```yaml
256-
- name: Update server.json version
257-
run: |
134+
- run: |
258135
VERSION=${GITHUB_REF#refs/tags/v}
259-
jq --arg version "$VERSION" '.version = $version' server.json > tmp.json
260-
mv tmp.json server.json
261-
```
262-
263-
### 2. Conditional Publishing
264-
265-
Only publish to registry after package publishing succeeds:
266-
267-
```yaml
268-
- name: Publish to npm
269-
run: npm publish
270-
id: npm-publish
271-
272-
- name: Publish to MCP Registry
273-
if: steps.npm-publish.outcome == 'success'
274-
run: ./mcp-publisher publish
136+
jq --arg v "$VERSION" '.version = $v' server.json > tmp && mv tmp server.json
275137
```
276138

277139
## Troubleshooting
278-
279-
**"Publisher binary not found"** - Ensure you download the correct binary for your CI platform (linux/mac/windows).
280-
281-
**"Authentication failed"** - For GitHub OIDC, verify `id-token: write` permission is set. For other methods, check secret configuration.
282-
283-
**"Package validation failed"** - Ensure your package was published successfully before MCP Registry publishing runs.
284-
285-
**"Version already exists"** - Each server.json version must be unique. Consider using build numbers: `1.0.0-build.123`.
286-
287-
## What You've Accomplished
288-
289-
You now have automated MCP server publishing that:
290-
291-
- Triggers on version tags
292-
- Runs tests before publishing
293-
- Publishes to package registry first
294-
- Automatically publishes to MCP Registry
295-
- Handles authentication securely
296-
- Provides failure notifications
297-
298-
Your MCP server publishing is now fully automated - just tag a release and everything happens automatically!
140+
- **"Authentication failed"**: Ensure `id-token: write` permission is set for OIDC, or check secrets
141+
- **"Package validation failed"**: Verify your package published to your registry (NPM, PyPi etc.) successfully first, and that you have done the necessary validation steps in the [Publishing Tutorial](publish-server.md)

docs/guides/publishing/publish-server.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Complete guide to publishing an MCP server to the registry.
44

5+
> [!TIP]
6+
> Using an agentic AI coding assistant? Just use this prompt:
7+
> ```
8+
> Read https://raw.githubusercontent.com/modelcontextprotocol/registry/refs/heads/main/docs/guides/publishing/publish-server.md and https://raw.githubusercontent.com/modelcontextprotocol/registry/refs/heads/main/docs/guides/publishing/github-actions.md. Evaluate the best way to publish this server to the registry (prefer automated CI flows over manual flows where possible), and implement that. If possible, validate the server.json against the $schema before telling the user you are done, using a proper json schema library or tool available on the user's machine. If you get stuck, guide the user through the parts of the publishing process they need to do (e.g. logging into the publisher CLI if doing manual pubishing).
9+
> ```
10+
511
## What You'll Learn
612
713
By the end of this tutorial, you'll have:
@@ -339,6 +345,13 @@ You should see your server metadata returned in the JSON response.
339345

340346
**"Namespace not authorized"** - Your authentication method doesn't match your chosen namespace format.
341347

348+
## Examples
349+
350+
See these real-world examples of published servers:
351+
- [NPM, Docker and MCPB example](https://github.com/domdomegg/airtable-mcp-server)
352+
- [NuGet example](https://github.com/domdomegg/time-mcp-nuget)
353+
- [PyPI example](https://github.com/domdomegg/time-mcp-pypi)
354+
342355
## Next Steps
343356

344357
- **Update your server**: Publish new versions with updated server.json files

0 commit comments

Comments
 (0)