You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@@ -13,49 +13,46 @@ By the end of this tutorial, you'll have:
13
13
14
14
## Prerequisites
15
15
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))
17
17
- GitHub repository with your MCP server code
18
-
- Basic understanding of CI/CD concepts
19
-
- 20-30 minutes
20
18
21
19
## GitHub Actions Setup
22
20
23
21
### Step 1: Create Workflow File
24
22
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:
26
24
27
25
```yaml
28
26
name: Publish to MCP Registry
29
27
30
28
on:
31
29
push:
32
-
tags: ["v*"] # Triggers on version tags like v1.0.0
30
+
tags: ["v*"] # Triggers on version tags like v1.0.0
33
31
34
32
jobs:
35
33
publish:
36
34
runs-on: ubuntu-latest
37
35
permissions:
38
-
id-token: write # Required for OIDC authentication
36
+
id-token: write # Required for OIDC authentication
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
74
65
75
66
- name: Login to MCP Registry
76
67
run: ./mcp-publisher login github-oidc
@@ -81,12 +72,9 @@ jobs:
81
72
82
73
### Step 2: Configure Secrets
83
74
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.
85
76
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).
90
78
91
79
### Step 3: Tag and Release
92
80
@@ -97,30 +85,18 @@ git tag v1.0.0
97
85
git push origin v1.0.0
98
86
```
99
87
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.
107
89
108
-
## Authentication Methods by CI Platform
90
+
## Authentication Methods
109
91
110
-
### GitHub Actions - OIDC (Recommended)
92
+
### GitHub Actions OIDC (Recommended)
111
93
112
94
```yaml
113
95
- name: Login to MCP Registry
114
96
run: mcp-publisher login github-oidc
115
97
```
116
98
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
124
100
125
101
```yaml
126
102
- name: Login to MCP Registry
@@ -131,7 +107,7 @@ The workflow will:
131
107
132
108
Add `MCP_GITHUB_TOKEN` secret with a GitHub PAT that has repo access.
133
109
134
-
### DNS Authentication (Any CI)
110
+
### DNS Authentication
135
111
136
112
For custom domain namespaces (`com.yourcompany/*`):
137
113
@@ -144,155 +120,22 @@ For custom domain namespaces (`com.yourcompany/*`):
144
120
145
121
Add your Ed25519 private key as `MCP_PRIVATE_KEY` secret.
146
122
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
175
124
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)
**"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)
Copy file name to clipboardExpand all lines: docs/guides/publishing/publish-server.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,12 @@
2
2
3
3
Complete guide to publishing an MCP server to the registry.
4
4
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
+
5
11
## What You'll Learn
6
12
7
13
By the end of this tutorial, you'll have:
@@ -339,6 +345,13 @@ You should see your server metadata returned in the JSON response.
339
345
340
346
**"Namespace not authorized"** - Your authentication method doesn't match your chosen namespace format.
341
347
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)
0 commit comments