diff --git a/.claude/skills/marketplace-submissions/SKILL.md b/.claude/skills/marketplace-submissions/SKILL.md index c3838b6..bc9ac77 100644 --- a/.claude/skills/marketplace-submissions/SKILL.md +++ b/.claude/skills/marketplace-submissions/SKILL.md @@ -53,7 +53,7 @@ Status on 2026-11-24. Check the live state before acting on it. | Claude: plugin bundle | 1.3.0 rejected because the plugin did not declare the account server. 1.3.1 declares it; resubmit from its tag. | [claude-directory.md](references/claude-directory.md) | | OpenAI: plugin for ChatGPT and Codex | 1.2.1 rejected for its testing instructions. 1.2.2 was uploaded as a draft with the plain URL and showed only 32 tools in the desktop app. 1.3.1 uses the `toolsets` URL. Build it from the `v1.3.1` tag once the account server's short-instructions change is deployed, then upload it with the reviewer account's details. | [openai.md](references/openai.md) | | Cursor Marketplace | Local test, then submit | [cursor.md](references/cursor.md) | -| MCP Registry | Waits on a DNS record and the owner's approval of the server names | [mcp-registry.md](references/mcp-registry.md) | +| MCP Registry | Names are `com.voiceflow/voiceflow` and `com.voiceflow/docs`. Only the gated workflow publishes them. Waits on the DNS record and the `mcp-registry-production` environment. | [mcp-registry.md](references/mcp-registry.md) | | awesome-copilot | Issue github/awesome-copilot#6477 passed intake and waits for a maintainer | [other-listings.md](references/other-listings.md) | | skills.sh | No submission step | [other-listings.md](references/other-listings.md) | diff --git a/.claude/skills/marketplace-submissions/references/mcp-registry.md b/.claude/skills/marketplace-submissions/references/mcp-registry.md index 41b6409..4706502 100644 --- a/.claude/skills/marketplace-submissions/references/mcp-registry.md +++ b/.claude/skills/marketplace-submissions/references/mcp-registry.md @@ -1,60 +1,62 @@ # MCP Registry -Registry: https://registry.modelcontextprotocol.io. There is no web form; a -maintainer runs `mcp-publisher`. The entries are `mcp-registry/voiceflow/server.json` -and `mcp-registry/knowledge/server.json`. +Registry: https://registry.modelcontextprotocol.io. There is no web form. The +**Publish MCP Registry entries** workflow, `.github/workflows/publish-mcp.yml`, +publishes the entries in `mcp-registry/voiceflow/server.json` and +`mcp-registry/docs/server.json`. Never sign in to the registry from a laptop, +and never generate, read, or upload the signing key. | Name | Version | Remote URL | | --- | --- | --- | -| `com.voiceflow/voiceflow` | 3.0.0 | `https://mcp.voiceflow.com/mcp?version=3` | -| `com.voiceflow/knowledge` | 2.1.2 | `https://www.voiceflow.com/docs/mcp` | +| `com.voiceflow/voiceflow` | 3.0.0 | `https://mcp.voiceflow.com/mcp?version=3&dynamic=true` | +| `com.voiceflow/docs` | 1.0.0 | `https://www.voiceflow.com/docs/mcp` | -The docs entry leaves out `?logging=off` on purpose; see `mcp-registry/README.md`. -A published name cannot change and a published version cannot be edited, so -the owner approves the names before the first publish. +The account entry uses the dynamic URL because the registry's main users are +IDE hosts that cap long tool lists. The docs entry leaves out `?logging=off` on +purpose. `mcp-registry/README.md` explains both choices. -## Prove the domain with DNS +## Before the first publish -1. Make an Ed25519 key with OpenSSL 3 (macOS LibreSSL cannot), and keep it - outside every repository. `.gitignore` also blocks `*.pem`. - ```bash - OPENSSL=/opt/homebrew/opt/openssl@3/bin/openssl - KEY=/voiceflow-mcp-registry.pem - (umask 077 && "$OPENSSL" genpkey -algorithm Ed25519 -out "$KEY") - echo "v=MCPv1; k=ed25519; p=$("$OPENSSL" pkey -in "$KEY" -pubout -outform DER | tail -c 32 | base64)" - ``` -2. Add the printed value as one more TXT record on the apex, `voiceflow.com` - itself, in AWS Route 53. Keep the existing TXT values. The value holds only - the public key. -3. Check it: `dig TXT voiceflow.com +short | grep MCPv1`. +The infrastructure owner adds the `MCPv1` TXT value on `voiceflow.com` and +stores `MCP_REGISTRY_DNS_KEY` in the `mcp-registry-production` environment. A +repository admin sets that environment to `main` only, with required +reviewers. The steps are under "One-time setup" in `mcp-registry/README.md`. +Check that the DNS value is live: -Without DNS, `mcp-publisher login github` works for `io.github.voiceflow/...` -names. That needs new names in the entries and a release. +```bash +dig TXT voiceflow.com +short | grep MCPv1 +``` + +## Publish -## Install the publisher, pinned +A new version reaches `main` through a reviewed pull request that raises +`version` in `server.json`. Then run the workflow from `main`: a dry run first, +then a publish. Run them only when the owner asks. ```bash -D=~/bin && mkdir -p $D && cd $(mktemp -d) \ - && gh release download v1.8.7 -R modelcontextprotocol/registry \ - -p 'mcp-publisher_darwin_arm64.tar.gz' -p 'registry_1.8.7_checksums.txt' \ - && grep ' mcp-publisher_darwin_arm64.tar.gz$' registry_1.8.7_checksums.txt | shasum -a 256 -c - \ - && tar -xzf mcp-publisher_darwin_arm64.tar.gz -C $D mcp-publisher +gh workflow run publish-mcp.yml --repo voiceflow/agent-plugins --ref main -f publish=false +gh run list --workflow publish-mcp.yml --repo voiceflow/agent-plugins --limit 3 +gh run view --repo voiceflow/agent-plugins --log-failed ``` -## Log in and publish from the tag +The dry run checks the allowlist and fields, validates each entry with the +registry, and tests both live servers. Its summary shows each entry as new, +identical, or conflict. A conflict needs a new version. + +For the publish, run the first command with `-f publish=true`. The job waits +for a reviewer to approve the `mcp-registry-production` environment in GitHub. +It then publishes only the new versions and reads each record back. Confirm the +result in the public listing. The audit reads every page, including deleted +versions, and fails on a name outside the allowlist: ```bash -MCP_PRIVATE_KEY="$("$OPENSSL" pkey -in "$KEY" -noout -text | sed -n '/priv:/,/pub:/p' | sed '1d;$d' | tr -d ' :\n')" \ - ~/bin/mcp-publisher login dns --domain voiceflow.com - -TAG=; OUT="$(mktemp -d)" -git show "$TAG:mcp-registry/voiceflow/server.json" > "$OUT/voiceflow.json" -git show "$TAG:mcp-registry/knowledge/server.json" > "$OUT/knowledge.json" -~/bin/mcp-publisher validate "$OUT/voiceflow.json" && ~/bin/mcp-publisher validate "$OUT/knowledge.json" -~/bin/mcp-publisher publish "$OUT/voiceflow.json" && ~/bin/mcp-publisher publish "$OUT/knowledge.json" -curl -s "https://registry.modelcontextprotocol.io/v0.1/servers?search=com.voiceflow" +python3 -I scripts/mcp_registry.py audit ``` -Publish only after the owner approves the names and the record is live. Each -later publish needs a new `version` in `server.json`, raised in a release. When -the key rotates, remove the old TXT record first. +## If something goes wrong + +A failed read-back or an unexpected entry under `com.voiceflow/` needs the +owner. If the key may be exposed, follow "If the key may be exposed" in +`mcp-registry/README.md`: halt the workflow, delete the secret, rotate the key +with the DNS owner, audit the namespace with `python3 -I scripts/mcp_registry.py audit`, +review the workflow runs, and contact the registry maintainers. diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e857f5b..def8dc2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,6 @@ -# Braden remains a maintainer with write access in the Voiceflow organization. -* @Bradenream +# These paths run with the com.voiceflow MCP Registry signing key (the job runs its script with python -I); a repo admin must turn on "require review from code owners" in the main ruleset. +/.github/workflows/ @z4o4z @xavidop +/.github/CODEOWNERS @z4o4z @xavidop +/mcp-registry/ @z4o4z @xavidop +/scripts/mcp_registry.py @z4o4z @xavidop +/scripts/install_mcp_publisher.sh @z4o4z @xavidop diff --git a/.github/workflows/publish-mcp.yml b/.github/workflows/publish-mcp.yml new file mode 100644 index 0000000..68f5473 --- /dev/null +++ b/.github/workflows/publish-mcp.yml @@ -0,0 +1,103 @@ +name: Publish MCP Registry entries +# Publishes mcp-registry/*/server.json to registry.modelcontextprotocol.io. +# Leave "publish" unchecked for a dry run: it checks the entries and the live +# servers, and shows what would be published. It never reads the signing key. +# Run every Python script with -I: Python then imports nothing from the checkout +# but the script itself, so a file in scripts/ without a code owner cannot run here. +on: + workflow_dispatch: + inputs: + publish: + description: Publish new versions after approval. Runs only on main. + required: false + type: boolean + default: false +permissions: + contents: read +defaults: + run: + shell: bash +jobs: + check: + name: Check entries and live servers + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.sha }} + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.12' + - name: Install the pinned publisher + run: bash scripts/install_mcp_publisher.sh "$RUNNER_TEMP/mcp-publisher" + - name: Check the allowlist and smoke-test the live servers + run: python -I scripts/mcp_registry.py check + - name: Validate the entries with the registry + run: | + for manifest in mcp-registry/*/server.json; do + "$RUNNER_TEMP/mcp-publisher/mcp-publisher" validate "$manifest" + done + - name: Show what a publish would do + run: python -I scripts/mcp_registry.py plan + + publish: + name: Publish to the MCP Registry + needs: check + if: inputs.publish && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + timeout-minutes: 10 + # The environment holds MCP_REGISTRY_DNS_KEY, allows only main, and needs a reviewer's approval. + environment: mcp-registry-production + concurrency: + group: mcp-registry-production + cancel-in-progress: false + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.sha }} + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.12' + - name: Install the pinned publisher + run: bash scripts/install_mcp_publisher.sh "$RUNNER_TEMP/mcp-publisher" + # Plan again: the registry can change while the run waits for approval. + - name: Plan the publish + id: plan + run: | + python -I scripts/mcp_registry.py plan > "$RUNNER_TEMP/publish-list.txt" + if [ -s "$RUNNER_TEMP/publish-list.txt" ]; then + echo "publish=true" >> "$GITHUB_OUTPUT" + else + echo "publish=false" >> "$GITHUB_OUTPUT" + fi + - name: Validate the new entries + if: steps.plan.outputs.publish == 'true' + run: | + while IFS= read -r manifest; do + "$RUNNER_TEMP/mcp-publisher/mcp-publisher" validate "$manifest" + done < "$RUNNER_TEMP/publish-list.txt" + # The publisher reads the hex key from MCP_PRIVATE_KEY, so the key never appears in a command line. + - name: Sign in with the voiceflow.com DNS key + if: steps.plan.outputs.publish == 'true' + env: + MCP_PRIVATE_KEY: ${{ secrets.MCP_REGISTRY_DNS_KEY }} + run: | + if [[ ! "$MCP_PRIVATE_KEY" =~ ^[0-9a-f]{64}$ ]]; then + echo "::error::MCP_REGISTRY_DNS_KEY is missing or is not a 64-character hex Ed25519 key." + exit 1 + fi + "$RUNNER_TEMP/mcp-publisher/mcp-publisher" login dns --domain voiceflow.com + - name: Publish the new entries + if: steps.plan.outputs.publish == 'true' + run: | + while IFS= read -r manifest; do + "$RUNNER_TEMP/mcp-publisher/mcp-publisher" publish "$manifest" + done < "$RUNNER_TEMP/publish-list.txt" + - name: Sign out + if: always() && steps.plan.outputs.publish == 'true' + run: '"$RUNNER_TEMP/mcp-publisher/mcp-publisher" logout' + - name: Read back the public records + run: python -I scripts/mcp_registry.py verify diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a4b8ab..2aa77ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,7 @@ python3 scripts/sync_shared_references.py | `evals/` | Behavioral cases, protocols, and sanitized evidence | | `docs/` | Compatibility, release, provenance, and measurement guidance | | `skills.sh.json` | Tells the skills CLI where the skills live; not packaged | -| `mcp-registry/` | MCP Registry entries for the two remote servers; not packaged or published | +| `mcp-registry/` | MCP Registry entries for the two remote servers; not packaged. Only `.github/workflows/publish-mcp.yml` publishes them | | `scripts/openai/` | OpenAI directory package: test cases, MCP config, build, and checks; not packaged | | `.claude/skills/marketplace-submissions/` | Maintainer steps and field values for each directory listing | | `.submissions/` | Git-ignored submission output and private notes; never commit it | diff --git a/docs/releasing.md b/docs/releasing.md index dd21b5b..f3cf1e5 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -5,7 +5,10 @@ The repository is owned by the [Voiceflow organization](https://github.com/voiceflow/agent-plugins). The package is MIT-licensed, copyright Voiceflow, Inc. Braden Ream ([@Bradenream](https://github.com/Bradenream)) remains a maintainer with write -access; `.github/CODEOWNERS` routes reviews to that account. Changes to team +access. `.github/CODEOWNERS` names owners only for the MCP Registry publishing +path: the workflows, the MCP Registry entries, the publisher installer, the +registry script, and CODEOWNERS itself. The workflow runs that script with +`python -I`, so it imports no other file from the checkout. Changes to team access, administrator permissions, and repository security settings belong to the organization's administrators. @@ -51,11 +54,15 @@ transfer or settings change: protection alone is not sufficient for the automated release check below. - Require a pull request for the default/release branch, dismiss stale reviews, and require resolved review threads. The owner chose sole-maintainer operation: - zero approving reviews and no mandatory code-owner or last-pusher approval. + zero approving reviews and no mandatory last-pusher approval. The owner can merge their own passing PR; direct pushes remain blocked. Agent-driven merges still require the owner's explicit approval. When adding - another maintainer or transferring ownership, revisit this policy and require - approving code-owner review if independent review becomes available. + another maintainer or transferring ownership, revisit this policy. +- Turn on "Require review from Code Owners" in the same ruleset. CODEOWNERS + covers only the MCP Registry publishing path, so only a change to those files + needs a code owner's approval, and an author cannot approve their own change. + After you turn it on, check that a pull request that edits `.github/workflows/` + shows a required code-owner review. - Require these exact checks from the **GitHub Actions** app (integration ID `15368`), with strict/up-to-date checks enabled: `checks (ubuntu-latest)`, `checks (macos-latest)`, `checks (windows-latest)`, and @@ -175,6 +182,11 @@ field values for each directory. `scripts/openai/build_zip.sh ` builds the OpenAI package into `.submissions/`, which git ignores. Reviewer credentials go only into each portal's private fields. +A package release does not publish the MCP Registry entries. The **Publish MCP +Registry entries** workflow publishes them from `main`, after a reviewer +approves the `mcp-registry-production` environment. See +[mcp-registry/README.md](../mcp-registry/README.md). + Package docs connections send `logging=off`, so the Knowledge MCP keeps only anonymous counts for them. See [measurement](measurement.md). Releases do not add a separate analytics service. diff --git a/mcp-registry/README.md b/mcp-registry/README.md index dab7cd3..a65a17f 100644 --- a/mcp-registry/README.md +++ b/mcp-registry/README.md @@ -2,19 +2,119 @@ These files describe Voiceflow's two remote MCP servers for the official [MCP Registry](https://registry.modelcontextprotocol.io). They are not part of -the plugin package, and nothing in this repository publishes them. +the plugin package. Only the **Publish MCP Registry entries** workflow, +`.github/workflows/publish-mcp.yml`, publishes them. Nobody signs in to the +registry from a laptop. -| Folder | Server | URL | -| --- | --- | --- | -| `voiceflow/` | Voiceflow account MCP, OAuth | `https://mcp.voiceflow.com/mcp?version=3` | -| `knowledge/` | Voiceflow Knowledge docs MCP, no sign-in | The public docs MCP URL, without the package's `logging=off` option | +| Folder | Name | Server | URL | +| --- | --- | --- | --- | +| `voiceflow/` | `com.voiceflow/voiceflow` | Voiceflow account MCP, OAuth | `https://mcp.voiceflow.com/mcp?version=3&dynamic=true` | +| `docs/` | `com.voiceflow/docs` | Voiceflow docs MCP, no sign-in | The public docs MCP URL, without the package's `logging=off` option | + +The account entry adds `dynamic=true`. Most people who install from the +registry use IDE hosts such as VS Code with GitHub Copilot. These hosts cap or +trim long tool lists. With `dynamic=true`, the server lists about a dozen tools +and runs the rest by name. The setup guide gives these hosts the same URL. The docs entry has no `logging=off` option. People who add the server from the registry are treated like people who add it by hand. The docs server logs their requests in full, and its tools require `why`. -Publishing needs an owner decision on the server names, because a published -name is hard to change. The `com.voiceflow/` namespace also needs DNS or HTTP -verification of `voiceflow.com`. See the registry's +A published name cannot change. A published version cannot be edited, so each +change needs a new `version` value. + +## Publish a new version + +1. Raise `version` in the changed `server.json` in a pull request, and merge it. +2. Run **Publish MCP Registry entries** from `main` with **publish** unchecked. + This dry run does not use the signing key. It checks the names and fields, + validates each entry with the registry, and tests both live servers. The + run summary shows the plan for each entry: new, identical, or conflict. +3. Run it again from `main` with **publish** checked. The publish job waits + until a reviewer approves the `mcp-registry-production` environment. +4. The job plans again, because the registry can change while it waits. It + skips a version that is already active with the same content. It fails on a + conflict: the same version with different content, or a version that is + deprecated or deleted. Fix a conflict with a new version. +5. The job signs in with the DNS key, publishes each new version, and signs out. +6. The job reads back each public record. It fails unless the status is active + and the name, version, title, description, website URL, and remotes match + the manifest. + +The live tests change nothing. The docs server gets one synthetic question +through `ask_voiceflow`, with a `why` that names the automated check. The +answer must cite a docs URL. The docs server logs this call. The account +server gets `initialize` without credentials. It must answer HTTP 401 and point +to OAuth metadata that names an authorization server. The test never signs in. + +## Guardrails + +- The workflow publishes only `com.voiceflow/docs` and `com.voiceflow/voiceflow`, + the list in `scripts/mcp_registry.py`. The DNS key can publish any + `com.voiceflow/*` name, and any name under a subdomain such as + `com.voiceflow.example/*`. So this list is a guardrail, not a security boundary. +- Only a run from `main` can publish. The environment must also allow only + `main` and require a reviewer. +- The signing key is an environment secret. The dry run job cannot read it. + The publisher reads it from an environment variable, so it never appears in + a command line. +- `.github/CODEOWNERS` names owners for the workflows, the installer, the + script, and the manifests. The jobs run the script with `python -I`. Python + then imports nothing else from the checkout, so a new file in `scripts/` + without a code owner cannot run in the publish job. +- `scripts/install_mcp_publisher.sh` pins the publisher version and its SHA-256. + Change both together after you review the upstream release. + +## One-time setup + +The infrastructure owner proves the domain and stores the key. Nobody else +handles the private key. + +1. Make an Ed25519 key with OpenSSL 3. The LibreSSL that ships with macOS + cannot. Keep the key folder outside every repository. The commands print + only the TXT value, which holds the public key. + ```bash + OPENSSL=/opt/homebrew/opt/openssl@3/bin/openssl + KEY_DIR= + umask 077 + mkdir -p "$KEY_DIR" + KEY="$KEY_DIR/voiceflow-mcp-registry.pem" + "$OPENSSL" genpkey -algorithm Ed25519 -out "$KEY" + echo "v=MCPv1; k=ed25519; p=$("$OPENSSL" pkey -in "$KEY" -pubout -outform DER | tail -c 32 | base64)" + ``` +2. In AWS Route 53, add the printed value as one more value of the TXT record + on the apex, `voiceflow.com` itself. Keep SPF and every other value. + Check it with `dig TXT voiceflow.com +short | grep MCPv1`. +3. A repository admin creates the `mcp-registry-production` environment. Allow + only the `main` branch. Add required reviewers and turn on "Prevent + self-review". The admin also turns on "Require review from Code Owners" in + the `main` ruleset. +4. Upload the raw private key as hex, over standard input, as an environment + secret. Never store it as a repository or organization secret. + ```bash + "$OPENSSL" pkey -in "$KEY" -noout -text | awk '/priv:/{f=1;next}/pub:/{f=0}f' | tr -d ' :\n' \ + | gh secret set MCP_REGISTRY_DNS_KEY --env mcp-registry-production --repo voiceflow/agent-plugins + ``` +5. Run the dry run, then a publish, as described above. + +## If the key may be exposed + +1. Halt publishing. Disable the **Publish MCP Registry entries** workflow and + reject any run that waits for approval. +2. Delete `MCP_REGISTRY_DNS_KEY` from the `mcp-registry-production` environment. +3. With the DNS owner, remove the exposed `MCPv1` value from the apex TXT + record at once. Keep SPF and every other value. Then make a new key with the + setup steps above. Remove every stale `MCPv1` value. Anyone who holds a key + can sign in while its value is published. +4. Audit the namespace with `python3 -I scripts/mcp_registry.py audit`. It + reads every page of the public listing, including deleted versions and + subdomain names. It prints each name, version, and status, and fails on any + name outside the allowlist. Review the recent runs of the workflow too. +5. Contact the registry maintainers through + [modelcontextprotocol/registry](https://github.com/modelcontextprotocol/registry) + to remove entries that Voiceflow did not publish. + +Rotating the key stops new sign-ins only. A registry token that was issued +before the rotation stays valid until it expires, currently five minutes after +it was issued. See the registry's [authentication guide](https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/authentication.mdx). -Each published version needs a new `version` value. diff --git a/mcp-registry/knowledge/server.json b/mcp-registry/docs/server.json similarity index 58% rename from mcp-registry/knowledge/server.json rename to mcp-registry/docs/server.json index 4cce99a..ee7ff52 100644 --- a/mcp-registry/knowledge/server.json +++ b/mcp-registry/docs/server.json @@ -1,9 +1,9 @@ { "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", - "name": "com.voiceflow/knowledge", - "title": "Voiceflow Knowledge", - "description": "Answers Voiceflow product, API, and CLI questions from the public docs. No sign-in.", - "version": "2.1.2", + "name": "com.voiceflow/docs", + "title": "Voiceflow Docs MCP", + "description": "Get cited answers from Voiceflow product, API, CLI, and MCP docs. No sign-in required.", + "version": "1.0.0", "websiteUrl": "https://www.voiceflow.com/docs/mcp/knowledge", "remotes": [ { diff --git a/mcp-registry/voiceflow/server.json b/mcp-registry/voiceflow/server.json index 5c3ba5d..98e589f 100644 --- a/mcp-registry/voiceflow/server.json +++ b/mcp-registry/voiceflow/server.json @@ -8,7 +8,7 @@ "remotes": [ { "type": "streamable-http", - "url": "https://mcp.voiceflow.com/mcp?version=3" + "url": "https://mcp.voiceflow.com/mcp?version=3&dynamic=true" } ] } diff --git a/scripts/install_mcp_publisher.sh b/scripts/install_mcp_publisher.sh new file mode 100644 index 0000000..de5de16 --- /dev/null +++ b/scripts/install_mcp_publisher.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# CI-only Linux x64 install of the MCP Registry publisher for .github/workflows/publish-mcp.yml. +# The checksum was reviewed against the release's checksums file. Change the version and the +# checksum together, after reviewing the upstream release; never fetch the checksum at run time. +set -euo pipefail +version=1.8.16 +asset=mcp-publisher_linux_amd64.tar.gz +checksum=6e2f799550cf843c6fd3350498d56cc49be3dc0af1e6237eb0e6435c7a9d5c05 +target="${1:?Provide a tools directory outside the repository}" +scratch="$(mktemp -d)" +trap 'rm -rf -- "$scratch"' EXIT +mkdir -p -- "$target" +curl --fail --silent --show-error --location --proto '=https' --proto-redir '=https' \ + --tlsv1.2 --connect-timeout 15 --max-time 120 --retry 2 \ + "https://github.com/modelcontextprotocol/registry/releases/download/v$version/$asset" -o "$scratch/$asset" +printf '%s %s\n' "$checksum" "$scratch/$asset" | sha256sum --check --status +tar -xzf "$scratch/$asset" -C "$scratch" mcp-publisher +test -f "$scratch/mcp-publisher" && test ! -L "$scratch/mcp-publisher" +install -m 755 "$scratch/mcp-publisher" "$target/mcp-publisher" diff --git a/scripts/mcp_registry.py b/scripts/mcp_registry.py new file mode 100644 index 0000000..bd01de8 --- /dev/null +++ b/scripts/mcp_registry.py @@ -0,0 +1,401 @@ +"""Check, plan, and verify Voiceflow's MCP Registry entries in mcp-registry/. + +The publish workflow runs this file in the job that holds the registry signing +key. It therefore uses only the Python standard library and imports nothing +from this repository. It never reads the key and never publishes: the workflow +runs mcp-publisher for that. + + check Allowlist and manifest checks, then read-only smoke tests of each live server. + plan Print the manifests whose version is new. Fail when a version is already + published with different content or is not active. + verify Read back each public record and compare it with its manifest. + audit List every published version in the namespace. Fail on a name outside the allowlist. + +Run it with `python3 -I`, so Python imports nothing from the checkout but this file. +""" +import argparse +import json +import os +from pathlib import Path +import re +import sys +import time +import urllib.error +from urllib.parse import quote, urlencode +import urllib.request + +ROOT = Path(__file__).resolve().parents[1] +MANIFESTS = ROOT / "mcp-registry" +# The DNS key can publish any com.voiceflow/* name, and any name under a subdomain, such as +# com.voiceflow.example/*. This list keeps the workflow to these two servers. +ALLOWED_NAMES = ("com.voiceflow/docs", "com.voiceflow/voiceflow") +NAMESPACE_PREFIXES = ("com.voiceflow/", "com.voiceflow.") +REGISTRY = "https://registry.modelcontextprotocol.io" +AUDIT_PAGE_SIZE, AUDIT_MAX_PAGES = 100, 100 +SCHEMA = "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json" +FIELDS = ("$schema", "name", "title", "description", "version", "websiteUrl", "remotes") +OFFICIAL = "io.modelcontextprotocol.registry/official" +VERSION = re.compile(r"\d+\.\d+\.\d+") +USER_AGENT = "voiceflow-mcp-registry-check/1.0" +TIMEOUT = 30 +VERIFY_ATTEMPTS, VERIFY_DELAY = 3, 10 +PROTOCOL_VERSION = "2025-06-18" +# One synthetic question to the docs server's read-only ask tool. The listed URL has no logging=off, +# so the server logs this call; `why` says that it is an automated check. +DOCS_TOOL = "ask_voiceflow" +DOCS_ARGUMENTS = { + "initiator": "agent", + "purpose": "answers", + "why": "Automated MCP Registry listing check from the voiceflow/agent-plugins publish workflow.", + "question": "How do I connect an AI assistant to the Voiceflow docs MCP server?", +} +DOCS_CITATION = "https://www.voiceflow.com/docs/" + + +class CheckError(Exception): + """A check failed; the message says what to fix.""" + + +def load_manifests(): + return {path: json.loads(path.read_text(encoding="utf-8")) for path in sorted(MANIFESTS.glob("*/server.json"))} + + +def label(path): + return f"{path.parent.name}/server.json" + + +def manifest_problems(manifests): + """Return each reason these manifests must not be published. The names must be exactly ALLOWED_NAMES.""" + problems, names = [], [] + for path, manifest in manifests.items(): + where, name = label(path), manifest.get("name") + names.append(name) + if name not in ALLOWED_NAMES: + problems.append(f"{where}: {name} is not allowed; this workflow publishes only {', '.join(ALLOWED_NAMES)}") + extra = sorted(set(manifest) - set(FIELDS)) + if extra: + problems.append(f"{where}: unexpected fields {', '.join(extra)}") + if manifest.get("$schema") != SCHEMA: + problems.append(f"{where}: $schema must be {SCHEMA}") + for field in ("title", "description"): + if not isinstance(manifest.get(field), str) or not 0 < len(manifest[field]) <= 100: + problems.append(f"{where}: {field} must be 1 to 100 characters") + if not isinstance(manifest.get("version"), str) or not VERSION.fullmatch(manifest["version"]): + problems.append(f"{where}: version must look like 1.2.3") + if not str(manifest.get("websiteUrl", "")).startswith("https://"): + problems.append(f"{where}: websiteUrl must be https") + remotes = manifest.get("remotes") + if not (isinstance(remotes, list) and len(remotes) == 1 and isinstance(remotes[0], dict) + and remotes[0].get("type") == "streamable-http" + and str(remotes[0].get("url", "")).startswith("https://")): + problems.append(f"{where}: give exactly one streamable-http remote with an https URL") + for name in sorted({name for name in names if names.count(name) > 1}, key=str): + problems.append(f"{name} appears in more than one manifest") + for name in ALLOWED_NAMES: + if name not in names: + problems.append(f"no manifest for {name}") + return problems + + +def require_valid(manifests): + problems = manifest_problems(manifests) + if problems: + raise CheckError("manifests failed the checks:\n " + "\n ".join(problems)) + + +def request(method, url, body=None, headers=None): + """Send one request. Return (status, headers, body) for every HTTP status, including errors.""" + data = None if body is None else json.dumps(body).encode() + headers = {"User-Agent": USER_AGENT, **({"Content-Type": "application/json"} if data else {}), **(headers or {})} + try: + response = urllib.request.urlopen(urllib.request.Request(url, data, headers, method=method), timeout=TIMEOUT) + except urllib.error.HTTPError as error: + response = error + with response: + return response.status, response.headers, response.read() + + +# Registry read API: GET /v0.1/servers/{url-encoded name}/versions/{url-encoded version}. + +def record_url(name, version, registry=REGISTRY): + return f"{registry}/v0.1/servers/{quote(name, safe='')}/versions/{quote(version, safe='')}?include_deleted=true" + + +def fetch_record(name, version): + """Return the registry's record of one exact version, with deleted versions included, or None.""" + status, _, body = request("GET", record_url(name, version), headers={"Accept": "application/json"}) + if status == 404: + return None + if status != 200: + raise CheckError(f"registry returned HTTP {status} for {name} {version}") + return json.loads(body) + + +def record_status(record): + return ((record.get("_meta") or {}).get(OFFICIAL) or {}).get("status") + + +def differences(manifest, server): + """Name each field that differs between a manifest and a registry record. $schema is not content.""" + return sorted(key for key in (set(manifest) | set(server)) - {"$schema"} if manifest.get(key) != server.get(key)) + + +def decide(manifest, record): + """Return (decision, reason). The decision is new, identical, or conflict.""" + if record is None: + return "new", "this version is not in the registry" + changed = differences(manifest, record.get("server") or {}) + if changed: + return "conflict", f"this version is published with a different {', '.join(changed)}" + status = record_status(record) + if status != "active": + return "conflict", f"this version is published with status {status}" + return "identical", "this version is published and active with the same content" + + +def verify_problems(manifest, record): + """Return what is wrong with the public record of a manifest: status, or any field but $schema.""" + if record is None: + return ["not found in the registry"] + status = record_status(record) + problems = [] if status == "active" else [f"status is {status}, not active"] + changed = differences(manifest, record.get("server") or {}) + return problems + [f"{field} differs from the manifest" for field in changed] + + +# Streamable HTTP: a POST returns either one JSON body or a text/event-stream of JSON-RPC messages. + +def sse_events(lines): + """Yield the data of each server-sent event, one string per event.""" + data = [] + for line in lines: + line = line.rstrip("\r\n") + if not line: + if data: + yield "\n".join(data) + data = [] + continue + field, _, value = line.partition(":") + if field == "data": + data.append(value[1:] if value.startswith(" ") else value) + if data: + yield "\n".join(data) + + +def rpc_result(payloads, request_id): + """Return the result of the JSON-RPC response to request_id among JSON payloads.""" + for payload in payloads: + if not payload.strip(): + continue + message = json.loads(payload) + for item in message if isinstance(message, list) else [message]: + if isinstance(item, dict) and item.get("id") == request_id: + if "error" in item: + error = item["error"] if isinstance(item["error"], dict) else {} + raise CheckError(f"JSON-RPC error {error.get('code')}: {error.get('message')}") + return item.get("result") + raise CheckError(f"no JSON-RPC response to request {request_id}") + + +def rpc(url, message, session): + """Send one JSON-RPC message to a Streamable HTTP server and return the result, or None for a notification.""" + headers = {"Accept": "application/json, text/event-stream", "Content-Type": "application/json", + "User-Agent": USER_AGENT} + headers.update({key: value for key, value in (("Mcp-Session-Id", session.get("id")), + ("MCP-Protocol-Version", session.get("protocol"))) if value}) + data = json.dumps(message).encode() + try: + response = urllib.request.urlopen(urllib.request.Request(url, data, headers, method="POST"), timeout=TIMEOUT) + except urllib.error.HTTPError as error: + raise CheckError(f"{message['method']} returned HTTP {error.code}") from None + with response: + session["id"] = response.headers.get("Mcp-Session-Id") or session.get("id") + if "id" not in message: + return None + if response.headers.get_content_type() == "text/event-stream": + return rpc_result(sse_events(line.decode("utf-8") for line in response), message["id"]) + return rpc_result([response.read().decode("utf-8")], message["id"]) + + +def initialize_message(request_id=1): + return {"jsonrpc": "2.0", "id": request_id, "method": "initialize", + "params": {"protocolVersion": PROTOCOL_VERSION, "capabilities": {}, + "clientInfo": {"name": "voiceflow-mcp-registry-check", "version": "1.0"}}} + + +def smoke_docs(url): + """Initialize, list tools, and ask one synthetic question. The answer must cite the docs.""" + session = {} + result = rpc(url, initialize_message(), session) or {} + session["protocol"] = result.get("protocolVersion") + rpc(url, {"jsonrpc": "2.0", "method": "notifications/initialized"}, session) + tools = {tool.get("name"): tool for tool in (rpc(url, {"jsonrpc": "2.0", "id": 2, "method": "tools/list"}, + session) or {}).get("tools", [])} + tool = tools.get(DOCS_TOOL) + if tool is None: + raise CheckError(f"tools/list has no {DOCS_TOOL}; it lists {', '.join(sorted(map(str, tools)))}") + if not (tool.get("annotations") or {}).get("readOnlyHint"): + raise CheckError(f"{DOCS_TOOL} is not marked read-only, so the check will not call it") + schema = tool.get("inputSchema") or {} + missing = sorted(set(schema.get("required", [])) - set(DOCS_ARGUMENTS)) + if missing: + raise CheckError(f"{DOCS_TOOL} now requires {', '.join(missing)}; update DOCS_ARGUMENTS") + arguments = {key: value for key, value in DOCS_ARGUMENTS.items() if key in schema.get("properties", {})} + answer = rpc(url, {"jsonrpc": "2.0", "id": 3, "method": "tools/call", + "params": {"name": DOCS_TOOL, "arguments": arguments}}, session) or {} + if answer.get("isError"): + raise CheckError(f"{DOCS_TOOL} returned an error result") + text = "\n".join(item.get("text", "") for item in answer.get("content", []) if isinstance(item, dict)) + if DOCS_CITATION not in text + json.dumps(answer.get("structuredContent") or {}): + raise CheckError(f"{DOCS_TOOL} answered without a {DOCS_CITATION} citation") + if session.get("id"): + try: + request("DELETE", url, headers={"Mcp-Session-Id": session["id"]}) + except OSError: + pass + return f"{len(tools)} tools; {DOCS_TOOL} answered with a docs citation" + + +def resource_metadata_url(challenges): + """Return the resource_metadata URL from WWW-Authenticate header values, or None.""" + for challenge in challenges: + match = re.search(r'resource_metadata\s*=\s*(?:"([^"]*)"|([^\s,]+))', challenge) + if match: + return match.group(1) or match.group(2) + return None + + +def smoke_oauth(url): + """Send initialize without credentials. Expect 401 and protected-resource metadata. Never sign in.""" + status, headers, _ = request("POST", url, initialize_message(), + {"Accept": "application/json, text/event-stream"}) + if status != 401: + raise CheckError(f"initialize without sign-in returned HTTP {status}, not 401") + metadata_url = resource_metadata_url(headers.get_all("WWW-Authenticate") or []) + if not metadata_url or not metadata_url.startswith("https://"): + raise CheckError("the 401 response has no https resource_metadata in WWW-Authenticate") + status, _, body = request("GET", metadata_url, headers={"Accept": "application/json"}) + if status != 200: + raise CheckError(f"protected-resource metadata returned HTTP {status}") + servers = json.loads(body).get("authorization_servers") + if not (isinstance(servers, list) and servers and all(str(item).startswith("https://") for item in servers)): + raise CheckError("protected-resource metadata has no https authorization_servers") + return f"401 without sign-in; metadata names {len(servers)} authorization server(s)" + + +SMOKE_TESTS = {"com.voiceflow/docs": smoke_docs, "com.voiceflow/voiceflow": smoke_oauth} + + +def check(_args): + manifests = load_manifests() + require_valid(manifests) + print(f"{len(manifests)} manifests pass the allowlist and field checks") + failures = 0 + for manifest in manifests.values(): + name, url = manifest["name"], manifest["remotes"][0]["url"] + try: + print(f"pass {name} at {url}: {SMOKE_TESTS[name](url)}") + except (CheckError, OSError, ValueError) as error: + failures += 1 + print(f"FAIL {name} at {url}: {error}") + return 1 if failures else 0 + + +def plan_manifests(manifests): + """Return (rows, paths to publish, conflict count) for valid manifests.""" + rows, publish, conflicts = [], [], 0 + for path, manifest in manifests.items(): + decision, reason = decide(manifest, fetch_record(manifest["name"], manifest["version"])) + rows.append((manifest["name"], manifest["version"], decision, reason)) + if decision == "new": + publish.append(path) + elif decision == "conflict": + conflicts += 1 + return rows, publish, conflicts + + +def plan(_args): + manifests = load_manifests() + require_valid(manifests) + rows, publish, conflicts = plan_manifests(manifests) + for row in rows: + print("{} {}: {}, {}".format(*row), file=sys.stderr) + summary = os.environ.get("GITHUB_STEP_SUMMARY") + if summary: + with open(summary, "a", encoding="utf-8") as handle: + handle.write("| Server | Version | Plan | Reason |\n| --- | --- | --- | --- |\n") + handle.writelines("| `{}` | {} | {} | {} |\n".format(*row) for row in rows) + if conflicts: + print(f"error: {conflicts} conflict(s). Raise the version in the manifest, or ask the owner.", file=sys.stderr) + return 1 + for path in publish: + print(path.relative_to(ROOT).as_posix()) + return 0 + + +def verify(_args): + manifests = load_manifests() + require_valid(manifests) + failures = 0 + for manifest in manifests.values(): + for attempt in range(1, VERIFY_ATTEMPTS + 1): + problems = verify_problems(manifest, fetch_record(manifest["name"], manifest["version"])) + if not problems or attempt == VERIFY_ATTEMPTS: + break + time.sleep(VERIFY_DELAY) + failures += bool(problems) + print(f"{'FAIL' if problems else 'pass'} {manifest['name']} {manifest['version']}: " + f"{'; '.join(problems) or 'active and identical to the manifest'}") + return 1 if failures else 0 + + +def namespace_records(): + """Return every version in the namespace, deleted ones included, following each page cursor.""" + records, cursor, seen = [], None, set() + for _ in range(AUDIT_MAX_PAGES): + query = {"search": "com.voiceflow", "include_deleted": "true", "limit": AUDIT_PAGE_SIZE} + if cursor: + query["cursor"] = cursor + status, _, body = request("GET", f"{REGISTRY}/v0.1/servers?{urlencode(query)}", + headers={"Accept": "application/json"}) + if status != 200: + raise CheckError(f"registry list returned HTTP {status}") + page = json.loads(body) + records += [item for item in page.get("servers") or [] + if str((item.get("server") or {}).get("name", "")).startswith(NAMESPACE_PREFIXES)] + cursor = (page.get("metadata") or {}).get("nextCursor") + if not cursor: + return records + if cursor in seen: + raise CheckError("the registry returned the same page cursor twice; the listing is incomplete") + seen.add(cursor) + raise CheckError(f"the listing has more than {AUDIT_MAX_PAGES} pages; the audit stopped") + + +def audit(_args): + failures = 0 + rows = sorted((str(item["server"].get("name")), str(item["server"].get("version")), str(record_status(item))) + for item in namespace_records()) + for name, version, status in rows: + unexpected = name not in ALLOWED_NAMES + failures += unexpected + print(f"{'FAIL unexpected name' if unexpected else 'ok'} {name} {version} {status}") + print(f"{len(rows)} versions under com.voiceflow; {failures} outside the allowlist") + return 1 if failures else 0 + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + commands = parser.add_subparsers(dest="command", required=True) + for name, function in (("check", check), ("plan", plan), ("verify", verify), ("audit", audit)): + commands.add_parser(name).set_defaults(run=function) + args = parser.parse_args(argv) + try: + return args.run(args) + except (CheckError, OSError, ValueError) as error: + print(f"error: {error}", file=sys.stderr) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/validate.py b/scripts/validate.py index 99416bc..7c6a7de 100644 --- a/scripts/validate.py +++ b/scripts/validate.py @@ -6,6 +6,7 @@ from skill_references import check_references from cli_commands import drift_problems as cli_table_problems +from mcp_registry import ALLOWED_NAMES as REGISTRY_NAMES from sync_shared_references import drift_problems ROOT = Path(__file__).resolve().parents[1] @@ -32,12 +33,14 @@ # URL. Codex limits tool list size only for servers bundled inside a plugin, and OpenAI's plugin guidelines forbid # a generic executor for operations that are not listed as tools. A package line that names a host and the account # MCP URL must say whether that host adds the parameter. The changelog and the eval fixtures keep older URLs on -# purpose, so only the package is checked. The registry entry keeps the full-list URL. The setup guide must name -# each host below on a line that gives the URL, with the parameter for the hosts that add it, so a host cannot drop -# out of the table unnoticed. +# purpose, so only the package is checked. The setup guide must name each host below on a line that gives the URL, +# with the parameter for the hosts that add it, so a host cannot drop out of the table unnoticed. ACCOUNT_MCP_URL = "https://mcp.voiceflow.com/mcp?version=3" DYNAMIC_PARAMETER = "&dynamic=true" ACCOUNT_MCP_DYNAMIC_URL = ACCOUNT_MCP_URL + DYNAMIC_PARAMETER +# The MCP Registry entry gives the dynamic URL. The registry's main consumers are IDE hosts such as VS Code with +# GitHub Copilot, which cap or trim long tool lists, and the setup guide gives those hosts the same URL. +REGISTRY_ACCOUNT_MCP_URL = ACCOUNT_MCP_DYNAMIC_URL ACCOUNT_MCP_ENDPOINT = re.compile(r"https://mcp\.voiceflow\.com/mcp(?![\w/-])(?:\?[\w=&%-]+)?") DYNAMIC_URL_HOST_NAMES = ("Cursor", "Copilot", "Windsurf", "Antigravity") PLAIN_URL_HOST_NAMES = ("Codex", "Claude", "ChatGPT") @@ -303,11 +306,14 @@ def validate_listings(root=ROOT): skills_sh = json.loads((root / "skills.sh.json").read_text(encoding="utf-8")) assert skills_sh == {"$schema": SKILLS_SH_SCHEMA, "paths": ["./voiceflow/skills"]}, "skills.sh.json drift" # Registry users add the docs server themselves, so its entry omits the package's logging option. - expected = {ACCOUNT_MCP_URL, DOCS_MCP_URL.split("?")[0]} + expected = {REGISTRY_ACCOUNT_MCP_URL, DOCS_MCP_URL.split("?")[0]} entries = [json.loads(path.read_text(encoding="utf-8")) for path in sorted((root / "mcp-registry").glob("*/server.json"))] assert {remote["url"] for entry in entries for remote in entry["remotes"]} == expected, "Registry URLs differ" assert len({entry["name"] for entry in entries}) == len(entries) == len(expected), "One registry entry per server" + # The publish workflow refuses any other name, so validation catches a new name before it reaches main. + assert sorted(entry["name"] for entry in entries) == sorted(REGISTRY_NAMES), \ + f"Registry names must be exactly {', '.join(REGISTRY_NAMES)}" for entry in entries: assert entry["$schema"] == REGISTRY_SCHEMA and SEMVER.fullmatch(entry["version"]) assert re.fullmatch(r"com\.voiceflow/[a-z0-9-]+", entry["name"]), "Registry names use com.voiceflow/" diff --git a/tests/test_mcp_registry.py b/tests/test_mcp_registry.py new file mode 100644 index 0000000..4774000 --- /dev/null +++ b/tests/test_mcp_registry.py @@ -0,0 +1,325 @@ +"""MCP Registry publishing logic with synthetic manifests and records; no network, no sign-in.""" +import contextlib +import copy +import importlib.util +import io +import json +import os +from pathlib import Path +import re +import shutil +import subprocess +import sys +import tempfile +import unittest +from unittest.mock import patch +from urllib.parse import parse_qs, urlsplit + +ROOT = Path(__file__).resolve().parents[1] +SCRIPT = ROOT / "scripts/mcp_registry.py" +WORKFLOW = ROOT / ".github/workflows/publish-mcp.yml" +spec = importlib.util.spec_from_file_location("mcp_registry", SCRIPT) +registry = importlib.util.module_from_spec(spec) +spec.loader.exec_module(registry) + +OFFICIAL = registry.OFFICIAL +PYTHON_CALL = re.compile(r"(?