Skip to content

feat(skills): native skills extension on single-server endpoints (Spec 125 PR-5) - #1949

Merged
Dumbris merged 10 commits into
mainfrom
codex/v075-skills-native-release
Nov 21, 2026
Merged

Dumbris merged 10 commits into
mainfrom
codex/v075-skills-native-release

Conversation

@Dumbris

@Dumbris Dumbris commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Spec 125 PR-5 (T047–T051): the native skills extension on /mcp/s/<server>. Part of #1895. Web UI (PR-4) is separate.

What changes

  • Announcement. With enable_skills on and the server not excluded (expose_skills: false), the single-server instance is built with WithExtensions({"io.modelcontextprotocol/skills": {}}) and WithResourceCapabilities. Aggregated endpoints (/mcp, /mcp/all, /mcp/code, /mcp/call, /mcp/p/…) never announce it (FR-030).
  • Interceptor (internal/server/skills_native.go), inside singleServerSessionGuard, in front of the transport: answers skills/list, skills/get, resources/read for that server's available skills only, with the upstream's addresses, from the approved copy byte for byte (FR-029/029a). If the output policy would block or change a file, the read is refused instead of rewritten. Skills whose address, file addresses or frontmatter the policy would change are left out of the listing. Sensitive-data detection runs on every read (DetectionText). Each access writes one skill_access row, not-found included.
  • Same checks as tools/call, reused rather than copied. mcp-go's protocol-version and session checks are unexported. So the interceptor first sends the request through the transport with its method replaced by ping, and answers only if the transport accepts it. Any refusal is passed on unchanged.
  • Endpoint lifecycle (mcp_single_server.go, plan D14):
    • acquireSingleServerEndpoint takes instance + transport + generation as one value under singleServersMu, which serves as the endpoint lifecycle lock.
    • Retirement detaches all three, shuts the transport down (closing open streams) and advances a generation baked into the session-id tag. Old ids get 404.
    • A GET stream also ends when its endpoint retires.
    • The upstream name rides on the request (withSingleServerEndpoint), so singleServerNameFor no longer depends on the live cache.
    • Endpoints are retired from RefreshSkillsAvailability and lazily on acquisition (covers per-server expose_skills commits that emit no reload).
  • runtime.AvailableSkill gains Frontmatter (approved copy). Server.singleServerHTTP is gone: transports live on the surface and do not accumulate.

Assumption: resources/read is answered by the interceptor, not an mcp-go resource template. Any upstream scheme then works, and all three methods share one instrumented path.

Tests (internal/server/skills_native_test.go, raw JSON-RPC over HTTP against a real Server + skills fixture)

  • T047: announcement, exact listing with upstream addresses, sha256/size of every read equals the listed digest, held skill absent and not found, aggregated endpoints neither announce nor answer, one activity row per access with outcomes.
  • T048: skills/list|get, resources/read vs tools/call for a missing session id, a foreign one, another generation's, a malformed one, an unsupported protocol version and a modern header without _meta. Same status, same body, and no skill rows written.
  • T050:
    • off → on → off → on: new session capabilities, old session 404, old GET stream closed, at most one transport.
    • acquisition racing retirement (8 goroutines, 40 toggles).
    • an initialize paused after acquisition across a retirement still answers with its upstream's instructions.
  • Excluded server and changed-upstream (SC-002): the changed bytes are never served before re-approval.
  • Mutation checks:
    • the probe disabled → T048 fails;
    • the ctx binding removed → paused-initialize test fails;
    • the generation left out of the ids, or retirement not closing the transport → off/on test fails.

Manual check (T051): official MCP Inspector 2.16.0, isolated core (scratch data dir, port 18765), upstream huggingface.co/mcp, 2 of 25 skills approved

  • --method skills/list --verify --require-digests on /mcp/s/hf: Verified 2 skills and 5 files: no conformance errors. The hf-cli digest equals the one huggingface.co/mcp lists directly.
  • A held skill: skills/get → skill not found; resources/read → resource not found.
  • /mcp and /mcp/all: Inspector reports skills_unsupported.
  • Sessions:
    • a missing session id → 404 for both skills/list and tools/list;
    • an /mcp/all session id → 404 for both.
    • After enable_skills was switched off by editing the config file: the old session → 404 (Session not found, the endpoint was retired); a new session → -32601.
  • Activity: list 2, get 1 + 1 not_found, read 6 + 1 not_found.

Checks run

  • go test -race on the native, single-server and real-skills tests in internal/server.
  • go test -race ./internal/runtime -run Skill.
  • Both golangci-lint v2 runs (bare and --build-tags server, 0 new issues).
  • check-upstream-write-sites.sh.
  • Docs site build.

Cross-model review (opencode github-copilot/gpt-6.1-sol, high)

  • Round 1 (interceptor): P0. Frontmatter was checked against the output policy in its serialized form, so an escaped ESC (\u001b) passed a stripping policy. Fixed in 7fd333f: every key and string value is now checked decoded. Regression test added, and it fails on the old code.
  • Round 2 (lifecycle): P1. The native flag was read before waiting for the build locks, so a concurrent switch could build an endpoint with stale capabilities. Fixed in 48dfe66: the flag is decided again under the lock.
  • Round 3 (tests/docs): six P2 test-strength findings. Fixed in acbc3a6:
    • the modern-version parity case now asserts -32022;
    • the stream must be an open SSE stream before the toggle;
    • the race test proves interleaving;
    • the paused initialize checks the upstream's exact instructions (new skillstest.Fixture.SetInstructions) and is bounded;
    • skills/get is compared with the listed entry.
  • Round 4 (whole diff): VERDICT: CLEAN.

🤖 Generated with Claude Code

…c 125 PR-5)

/mcp/s/<server> now speaks io.modelcontextprotocol/skills natively when
enable_skills is on and the server is not excluded (T047-T051, #1895):

- The instance is built with the extension and the resources capability;
  aggregated endpoints never announce it (FR-030).
- An interceptor inside singleServerSessionGuard answers skills/list,
  skills/get and resources/read for the server's AVAILABLE skills only,
  with the upstream's addresses, serving the approved copy byte for byte
  (FR-029, FR-029a). A policy that would block or change text withholds it
  instead of rewriting. Each access writes one skill_access row, not-found
  included.
- Transport checks are reused, not copied: the request is first sent
  through the transport with its method replaced by "ping", and any refusal
  (missing/foreign/stale session id, unsupported protocol version) is
  replayed unchanged, so the methods get exactly the refusal tools/call gets.
- Endpoint lifecycle (plan D14): instance, transport and generation are
  acquired together under the cache lock; retirement detaches all three,
  shuts the transport down (closing open streams) and advances a
  generation baked into session ids, so an old session is refused. The
  upstream name is bound to the request, so a retired in-flight initialize
  still answers with its upstream's instructions. Retired from
  RefreshSkillsAvailability and lazily on acquisition.

Assumption (documented): resources/read is handled by the interceptor rather
than an mcp-go resource template, so any upstream scheme works and all three
methods share one instrumented path.

Verified with the official MCP Inspector 2.16.0 against an isolated core and
huggingface.co/mcp: skills/list --verify --require-digests verified 2 approved
skills / 5 files, digests equal to the upstream's; held skills not found;
/mcp and /mcp/all report the extension unsupported; after switching
enable_skills off the old session answers 404 and a new one gets
method-not-found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Dumbris Dumbris left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address two transport-parity questions before merge. Validate the original MCP method header against the original JSON-RPC method before rewriting either for the SDK probe, preserving the SDK error shape. Also verify that native skills do not intercept ordinary resource reads previously supported by the same single-server endpoint. Include the regression coverage or identify where the existing dispatch proves parity.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0733283
Status: ✅  Deploy successful!
Preview URL: https://3c9fbe0a.mcpproxy-docs.pages.dev
Branch Preview URL: https://codex-v075-skills-native-rel.mcpproxy-docs.pages.dev

View logs

Dumbris and others added 3 commits November 20, 2026 12:52
The stored frontmatter JSON escapes control characters, so checking its
serialized form let a decoded ESC through a stripping policy. Every key and
string value is now checked decoded (review round 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ild locks

A first request that read the switch, then waited behind a catalog rebuild
while a refresh ran, built an endpoint with the old capabilities (review
round 2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Modern-version parity asserts the version refusal itself; the stream must be
an open SSE stream before the toggle; the race test asserts acquisitions
interleave with retirements; the paused initialize checks the upstream's
exact instructions (fixture gains SetInstructions) and is bounded; skills/get
is compared with the listed entry (review round 3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Dumbris

Dumbris commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Independent review for the release coordinator: opencode github-copilot/gpt-6.1-sol --variant high, two chunks (A: internal/server/skills_native.go; B: the single-server endpoint wiring). Reviewed on the merge of this PR's head 303fa31 with main ad12abf, with the mcp-go v1.0.0 source available to the reviewer.

The reviewer returned FINDINGS. I checked each one against the code, and none blocks merge:

  • Session ids are not caller-bound and not tracked (P1 as reported). This is the existing /mcp/s/<server> design on main (singleServerSessionIDs: "Like the default manager it tracks nothing"). The native probe passes each request through the same transport validation, so skills requests get exactly the treatment tools/call gets, and authorization still runs on every request. This is not a regression. D14's wording "this caller" is stronger than the endpoint implements.
  • Unsupported legacy protocol-version header accepted (P2). mcp-go checks the header only on the modern branch, so tools/call accepts it too. Same behaviour as tools/call.
  • Follow-ups (P3, not release-blocking): (1) a blocked skill whose file has a non-skill:// address gets the SDK's "handler not found" reply and writes no skill_access row; (2) the binary-file refusal differs from not-found, but only for an available skill; (3) native skill_access rows can record an empty or stale profile, because admission uses listOnlyProfileResolution; (4) sensitive-data detection does not run on frontmatter in skills/list and skills/get output.

Race tests on the same merge tree: go test -race ./internal/server -run 'Skill|Native|SingleServer', bare and -tags server, both pass.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: codex/v075-skills-native-release

Available Artifacts

  • archive-darwin-amd64 (33 MB)
  • archive-darwin-arm64 (30 MB)
  • archive-linux-amd64 (20 MB)
  • archive-linux-arm64 (18 MB)
  • archive-windows-amd64 (33 MB)
  • archive-windows-arm64 (29 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (29 MB)
  • installer-dmg-darwin-arm64 (26 MB)
  • smart-mcp-proxymcpproxy-go7ZZM6F.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 44865907893 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

codecov-commenter commented Nov 20, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 82.32323% with 105 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/server/skills_native.go 80.26% 57 Missing and 32 partials ⚠️
internal/server/mcp_single_server.go 90.38% 6 Missing and 4 partials ⚠️
internal/skills/skillstest/fixture.go 40.00% 5 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Regenerate ROADMAP.md (scripts/gen-roadmap.py) after #1947 and #1950.
@Dumbris

Dumbris commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Merged origin/main (29f9ce6, includes #1950 5f37ac9) into this branch as 1bc5337. Only conflict: the generated ROADMAP.md, regenerated (--check clean). fixture.go, tasks.md and docs/features/skills.md auto-merged. On the merged tree: go build (bare and -tags server), go vet, and race tests ./internal/skills/... + runtime (Skill|Exposure), ./internal/server (Skill|Native|SingleServer, bare and -tags server) and ./internal/httpapi (-tags server) all pass. No #1949 code changed versus 303fa31, so the earlier review stands; merging when CI is green on 1bc5337.

@Dumbris

Dumbris commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Delta 1bc5337..0733283 (intent error no longer echoes the caller's data_sensitivity value; capacity hint in injectAuthMetadata) reviewed: opencode github-copilot/gpt-6.1-sol --variant high, verdict CLEAN; go build, go vet and race tests for internal/contracts pass. Non-blocking doc drift: docs/features/intent-declaration.md:286 still shows the old message with the quoted value. Merging when CI is green on 0733283.

@Dumbris
Dumbris merged commit 8a28d57 into main Nov 21, 2026
75 of 77 checks passed
Dumbris added a commit that referenced this pull request Nov 21, 2026
… PR-4b) (#1951)

Completes the operator review queue portion of #1895 (Spec 125 PR-4b).
Administrators can see pending or changed skills in Home and the review
queue and open the server's Skills tab to review the exact version.
Includes Web/native labels, runtime visibility and event handling, and
regression coverage.

The implementation owner is finishing the independent review and full
test evidence. This draft starts CI in parallel. The release coordinator
will validate it together with #1950 and #1949.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants