How to Automate Publishing with GitHub Actions changedregistry/github-actions
Nearest release: v2.1.305, published under an hour before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 20 Oct 2026 20:02 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 20 Oct 2026 20:07 UTC.
Upstream edited
Recorded here
Lines+177added
Lines−179removed
From line
1
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits3to this page, all time
The whole hunk
from line 1, old and new numbered
/
from line 1
11# How to Automate Publishing with GitHub Actions
22
3<Note>
4 The MCP Registry is currently in preview. Breaking changes or data resets may occur before general availability. If you encounter any issues, please report them on [GitHub](https://github.com/modelcontextprotocol/registry/issues).
5</Note>
3> [!NOTE]
4>
5> The MCP Registry is currently in preview. Breaking changes or data resets may occur before general availability. If you encounter any issues, please report them on [GitHub](https://github.com/modelcontextprotocol/registry/issues).
66
77## Step 1: Create a Workflow File
88
99In 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:
1010
11<CodeGroup>
12 ```yaml OIDC authentication (recommended) theme={null}
13 name: Publish to MCP Registry
11```yaml OIDC authentication (recommended) theme={null}
12name: Publish to MCP Registry
1413
15 on:
16 push:
17 tags: ["v*"] # Triggers on version tags like v1.0.0
14on:
15 push:
16 tags: ["v*"] # Triggers on version tags like v1.0.0
1817
19 jobs:
20 publish:
21 runs-on: ubuntu-latest
22 permissions:
23 id-token: write # Required for OIDC authentication
24 contents: read
18jobs:
19 publish:
20 runs-on: ubuntu-latest
21 permissions:
22 id-token: write # Required for OIDC authentication
23 contents: read
2524
26 steps:
27 - name: Checkout code
28 uses: actions/checkout@v5
25 steps:
26 - name: Checkout code
27 uses: actions/checkout@v5
2928
30 ### Publish underlying npm package:
29 ### Publish underlying npm package:
3130
32 - name: Set up Node.js
33 uses: actions/setup-node@v5
34 with:
35 node-version: "lts/*"
31 - name: Set up Node.js
32 uses: actions/setup-node@v5
33 with:
34 node-version: "lts/*"
3635
37 - name: Install dependencies
38 run: npm ci
36 - name: Install dependencies
37 run: npm ci
3938
40 - name: Run tests
41 run: npm run test --if-present
39 - name: Run tests
40 run: npm run test --if-present
4241
43 - name: Build package
44 run: npm run build --if-present
42 - name: Build package
43 run: npm run build --if-present
4544
46 - name: Publish package to npm
47 run: npm publish
48 env:
49 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45 - name: Publish package to npm
46 run: npm publish
47 env:
48 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5049
51 ### Publish MCP server:
50 ### Publish MCP server:
5251
53 - name: Install mcp-publisher
54 run: |
55 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
52 - name: Install mcp-publisher
53 run: |
54 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
5655
57 - name: Authenticate to MCP Registry
58 run: ./mcp-publisher login github-oidc
56 - name: Authenticate to MCP Registry
57 run: ./mcp-publisher login github-oidc
5958
60 # Optional:
61 # - name: Set version in server.json
62 # run: |
63 # VERSION=${GITHUB_REF#refs/tags/v}
64 # jq --arg v "$VERSION" '.version = $v' server.json > server.tmp && mv server.tmp server.json
59 # Optional:
60 # - name: Set version in server.json
61 # run: |
62 # VERSION=${GITHUB_REF#refs/tags/v}
63 # jq --arg v "$VERSION" '.version = $v' server.json > server.tmp && mv server.tmp server.json
6564
66 - name: Publish server to MCP Registry
67 run: ./mcp-publisher publish
68 ```
65 - name: Publish server to MCP Registry
66 run: ./mcp-publisher publish
67```
6968
70 ```yaml PAT authentication theme={null}
71 name: Publish to MCP Registry
69```yaml PAT authentication theme={null}
70name: Publish to MCP Registry
7271
73 on:
74 push:
75 tags: ["v*"] # Triggers on version tags like v1.0.0
72on:
73 push:
74 tags: ["v*"] # Triggers on version tags like v1.0.0
7675
77 jobs:
78 publish:
79 runs-on: ubuntu-latest
80 permissions:
81 contents: read
76jobs:
77 publish:
78 runs-on: ubuntu-latest
79 permissions:
80 contents: read
8281
83 steps:
84 - name: Checkout code
85 uses: actions/checkout@v5
82 steps:
83 - name: Checkout code
84 uses: actions/checkout@v5
8685
87 ### Publish underlying npm package:
86 ### Publish underlying npm package:
8887
89 - name: Set up Node.js
90 uses: actions/setup-node@v5
91 with:
92 node-version: "lts/*"
88 - name: Set up Node.js
89 uses: actions/setup-node@v5
90 with:
91 node-version: "lts/*"
9392
94 - name: Install dependencies
95 run: npm ci
93 - name: Install dependencies
94 run: npm ci
9695
97 - name: Run tests
98 run: npm run test --if-present
96 - name: Run tests
97 run: npm run test --if-present
9998
100 - name: Build package
101 run: npm run build --if-present
99 - name: Build package
100 run: npm run build --if-present
102101
103 - name: Publish package to npm
104 run: npm publish
105 env:
106 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
102 - name: Publish package to npm
103 run: npm publish
104 env:
105 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
107106
108 ### Publish MCP server:
107 ### Publish MCP server:
109108
110 - name: Install mcp-publisher
111 run: |
112 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
109 - name: Install mcp-publisher
110 run: |
111 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
113112
114 - name: Authenticate to MCP Registry
115 run: ./mcp-publisher login github --token ${{ secrets.MCP_GITHUB_TOKEN }}
113 - name: Authenticate to MCP Registry
114 run: ./mcp-publisher login github --token ${{ secrets.MCP_GITHUB_TOKEN }}
116115
117 # Optional:
118 # - name: Set version in server.json
119 # run: |
120 # VERSION=${GITHUB_REF#refs/tags/v}
121 # jq --arg v "$VERSION" '.version = $v' server.json > server.tmp && mv server.tmp server.json
116 # Optional:
117 # - name: Set version in server.json
118 # run: |
119 # VERSION=${GITHUB_REF#refs/tags/v}
120 # jq --arg v "$VERSION" '.version = $v' server.json > server.tmp && mv server.tmp server.json
122121
123 - name: Publish server to MCP Registry
124 run: ./mcp-publisher publish
125 ```
122 - name: Publish server to MCP Registry
123 run: ./mcp-publisher publish
124```
126125
127 ```yaml DNS authentication theme={null}
128 name: Publish to MCP Registry
126```yaml DNS authentication theme={null}
127name: Publish to MCP Registry
129128
130 on:
131 push:
132 tags: ["v*"] # Triggers on version tags like v1.0.0
129on:
130 push:
131 tags: ["v*"] # Triggers on version tags like v1.0.0
133132
134 jobs:
135 publish:
136 runs-on: ubuntu-latest
137 permissions:
138 contents: read
133jobs:
134 publish:
135 runs-on: ubuntu-latest
136 permissions:
137 contents: read
139138
140 steps:
141 - name: Checkout code
142 uses: actions/checkout@v5
139 steps:
140 - name: Checkout code
141 uses: actions/checkout@v5
143142
144 ### Publish underlying npm package:
143 ### Publish underlying npm package:
145144
146 - name: Set up Node.js
147 uses: actions/setup-node@v5
148 with:
149 node-version: "lts/*"
145 - name: Set up Node.js
146 uses: actions/setup-node@v5
147 with:
148 node-version: "lts/*"
150149
151 - name: Install dependencies
152 run: npm ci
150 - name: Install dependencies
151 run: npm ci
153152
154 - name: Run tests
155 run: npm run test --if-present
153 - name: Run tests
154 run: npm run test --if-present
156155
157 - name: Build package
158 run: npm run build --if-present
156 - name: Build package
157 run: npm run build --if-present
159158
160 - name: Publish package to npm
161 run: npm publish
162 env:
163 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
159 - name: Publish package to npm
160 run: npm publish
161 env:
162 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
164163
165 ### Publish MCP server:
164 ### Publish MCP server:
166165
167 - name: Install mcp-publisher
168 run: |
169 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
166 - name: Install mcp-publisher
167 run: |
168 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
170169
171 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
172 # TODO: Replace `example.com` with your domain name
173 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
174 - name: Authenticate to MCP Registry
175 run: ./mcp-publisher login dns --domain example.com --private-key ${{ secrets.MCP_PRIVATE_KEY }}
170 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
171 # TODO: Replace `example.com` with your domain name
172 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
173 - name: Authenticate to MCP Registry
174 run: ./mcp-publisher login dns --domain example.com --private-key ${{ secrets.MCP_PRIVATE_KEY }}
176175
177 # Optional:
178 # - name: Set version in server.json
179 # run: |
180 # VERSION=${GITHUB_REF#refs/tags/v}
181 # jq --arg v "$VERSION" '.version = $v' server.json > server.tmp && mv server.tmp server.json
176 # Optional:
177 # - name: Set version in server.json
178 # run: |
179 # VERSION=${GITHUB_REF#refs/tags/v}
180 # jq --arg v "$VERSION" '.version = $v' server.json > server.tmp && mv server.tmp server.json
182181
183 - name: Publish server to MCP Registry
184 run: ./mcp-publisher publish
185 ```
186</CodeGroup>
182 - name: Publish server to MCP Registry
183 run: ./mcp-publisher publish
184```
187185
188186## Step 2: Add Secrets
189187
No line in this hunk matches that.