Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ on:
push:
branches: [master]
workflow_dispatch:
inputs:
publish_registry:
description: 'Re-publish the current server.json to the MCP registry (npm published but the registry step failed)'
type: boolean
default: false

# contents: changesets/action commits the version PR and creates the
# GitHub Release at publish time
Expand Down Expand Up @@ -99,7 +104,11 @@ jobs:
publish-registry:
name: Publish to MCP Registry
needs: release
if: needs.release.outputs.published == 'true'
# The registry validates the manifest only at publish time, i.e. after npm
# has already gone out — so this job can fail on its own and leave the
# registry a version behind. `workflow_dispatch` with publish_registry
# re-runs just this half against whatever server.json currently says.
if: needs.release.outputs.published == 'true' || inputs.publish_registry
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
Expand All @@ -109,11 +118,24 @@ jobs:
- uses: actions/checkout@v4

# server.json is bumped in the version PR by scripts/sync-version.js, so
# by now it should already match. Fail loudly rather than publish a stale
# entry that points at a version npm does not have.
- name: Verify server.json matches the published version
# after a release it should already match. On a manual re-run there is no
# released version to compare against and server.json itself is the
# source of truth.
- name: Resolve the version to publish
id: target
env:
VERSION: ${{ needs.release.outputs.version }}
RELEASED: ${{ needs.release.outputs.version }}
run: |
VERSION="${RELEASED:-$(node -p "require('./server.json').version")}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "publishing $VERSION"

# Fail loudly rather than point the registry at something npm does not
# have — either because the manifest is stale, or because a manual re-run
# was fired before the matching npm publish landed.
- name: Verify server.json matches a published npm version
env:
VERSION: ${{ steps.target.outputs.version }}
run: |
node -e '
const s = require("./server.json");
Expand All @@ -125,6 +147,7 @@ jobs:
}
console.log(`server.json is in sync at ${v}`);
'
npm view "pseudonym-mcp@$VERSION" version

- name: Install mcp-publisher
run: |
Expand Down
2 changes: 1 addition & 1 deletion server.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.woladi/pseudonym-mcp",
"description": "MCP tools for locally pseudonymizing sensitive text before cloud LLM work and restoring tokens afterward.",
"description": "Locally pseudonymizes sensitive text before cloud LLM work and restores the tokens afterward.",
"repository": {
"url": "https://github.com/woladi/pseudonym-mcp.git",
"source": "github"
Expand Down
32 changes: 32 additions & 0 deletions tests/server-manifest.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { describe, it, expect } from 'vitest'
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'

const readJson = <T>(name: string): T =>
JSON.parse(readFileSync(resolve(process.cwd(), name), 'utf-8')) as T

// The MCP registry only validates server.json at publish time — which happens
// after npm has already gone out, so a rejected manifest leaves the registry
// stranded on an older version. These are the constraints that bit us (v0.7.5
// was rejected for a 105-character description); check them in CI instead.
describe('server.json (MCP registry manifest)', () => {
const server = readJson<{
name: string
description: string
packages: Array<{ identifier: string; registryType: string }>
}>('server.json')
const packageJson = readJson<{ name: string; mcpName: string }>('package.json')

it('keeps the description within the registry limit of 100 characters', () => {
expect(server.description.length).toBeLessThanOrEqual(100)
})

it('claims the same server name as the published npm package', () => {
expect(server.name).toBe(packageJson.mcpName)
})

it('points at this npm package', () => {
expect(server.packages[0]?.registryType).toBe('npm')
expect(server.packages[0]?.identifier).toBe(packageJson.name)
})
})
Loading