Skip to content

Commit 06da545

Browse files
authored
Merge branch 'main' into main
2 parents 3076b44 + 2e0961f commit 06da545

File tree

4 files changed

+68
-3
lines changed

4 files changed

+68
-3
lines changed

.github/workflows/pre-release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Pre-release
2+
3+
permissions: read-all
4+
5+
on:
6+
push:
7+
branches:
8+
- release-please-*
9+
10+
jobs:
11+
pre-release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Install MCP Publisher
20+
run: |
21+
export TAG=$(curl -sL https://api.github.com/repos/modelcontextprotocol/registry/releases/latest | jq -r ".tag_name")
22+
export VERSION="${TAG#v}"
23+
export OS=$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
24+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/${TAG}/mcp-publisher_${VERSION}_${OS}.tar.gz" | tar xz mcp-publisher
25+
26+
- name: Verify server.json
27+
run: npm run verify-server-json-version

.github/workflows/publish-to-npm-on-tag.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ jobs:
7979

8080
- name: Install MCP Publisher
8181
run: |
82-
export VERSION="1.2.1"
82+
export TAG=$(curl -sL https://api.github.com/repos/modelcontextprotocol/registry/releases/latest | jq -r ".tag_name")
83+
export VERSION="${TAG#v}"
8384
export OS=$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
84-
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v${VERSION}/mcp-publisher_${VERSION}_${OS}.tar.gz" | tar xz mcp-publisher
85+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/${TAG}/mcp-publisher_${VERSION}_${OS}.tar.gz" | tar xz mcp-publisher
8586
8687
- name: Login to MCP Registry
8788
run: ./mcp-publisher login github-oidc

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"test:only": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
2020
"test:only:no-build": "node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
2121
"test:update-snapshots": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-force-exit --test --test-update-snapshots \"build/tests/**/*.test.js\"",
22-
"prepare": "node --experimental-strip-types scripts/prepare.ts"
22+
"prepare": "node --experimental-strip-types scripts/prepare.ts",
23+
"verify-server-json-version": "node --experimental-strip-types scripts/verify-server-json-version.ts"
2324
},
2425
"files": [
2526
"build/src",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* @license
3+
* Copyright 2025 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import {execSync} from 'node:child_process';
8+
import fs from 'node:fs';
9+
10+
const serverJsonFilePath = './server.json';
11+
const serverJson = JSON.parse(fs.readFileSync(serverJsonFilePath, 'utf-8'));
12+
fs.unlinkSync(serverJsonFilePath);
13+
14+
// Create the new server.json
15+
execSync('./mcp-publisher init');
16+
17+
const newServerJson = JSON.parse(fs.readFileSync(serverJsonFilePath, 'utf-8'));
18+
19+
const propertyToVerify = ['$schema'];
20+
const diffProps = [];
21+
22+
for (const prop of propertyToVerify) {
23+
if (serverJson[prop] !== newServerJson[prop]) {
24+
diffProps.push(prop);
25+
}
26+
}
27+
28+
fs.writeFileSync('./server.json', JSON.stringify(serverJson, null, 2));
29+
30+
if (diffProps.length) {
31+
throw new Error(
32+
`The following props did not match the latest init value:\n${diffProps.map(
33+
prop => `- "${prop}": "${newServerJson[prop]}"`,
34+
)}`,
35+
);
36+
}

0 commit comments

Comments
 (0)