Repository navigation
feat(skills): native skills extension on single-server endpoints (Spec 125 PR-5) - #1949
Conversation
…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
left a comment
There was a problem hiding this comment.
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.
Deploying mcpproxy-docs with
|
| 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 |
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>
|
Independent review for the release coordinator: opencode The reviewer returned FINDINGS. I checked each one against the code, and none blocks merge:
Race tests on the same merge tree: |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 44865907893 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
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. |
|
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. |
… 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.
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
enable_skillson and the server not excluded (expose_skills: false), the single-server instance is built withWithExtensions({"io.modelcontextprotocol/skills": {}})andWithResourceCapabilities. Aggregated endpoints (/mcp,/mcp/all,/mcp/code,/mcp/call,/mcp/p/…) never announce it (FR-030).internal/server/skills_native.go), insidesingleServerSessionGuard, in front of the transport: answersskills/list,skills/get,resources/readfor 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 oneskill_accessrow, not-found included.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 byping, and answers only if the transport accepts it. Any refusal is passed on unchanged.mcp_single_server.go, plan D14):acquireSingleServerEndpointtakes instance + transport + generation as one value undersingleServersMu, which serves as the endpoint lifecycle lock.404.withSingleServerEndpoint), sosingleServerNameForno longer depends on the live cache.RefreshSkillsAvailabilityand lazily on acquisition (covers per-serverexpose_skillscommits that emit no reload).runtime.AvailableSkillgainsFrontmatter(approved copy).Server.singleServerHTTPis gone: transports live on the surface and do not accumulate.Assumption:
resources/readis 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 realServer+ skills fixture)skills/list|get,resources/readvstools/callfor 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.initializepaused after acquisition across a retirement still answers with its upstream's instructions.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-digestson/mcp/s/hf: Verified 2 skills and 5 files: no conformance errors. Thehf-clidigest equals the onehuggingface.co/mcplists directly.skills/get→skill not found;resources/read→resource not found./mcpand/mcp/all: Inspector reportsskills_unsupported.skills/listandtools/list;/mcp/allsession id → 404 for both.enable_skillswas switched off by editing the config file: the old session → 404 (Session not found, the endpoint was retired); a new session →-32601.Checks run
go test -raceon the native, single-server and real-skills tests ininternal/server.go test -race ./internal/runtime -run Skill.golangci-lintv2 runs (bare and--build-tags server, 0 new issues).check-upstream-write-sites.sh.Cross-model review (opencode
github-copilot/gpt-6.1-sol, high)\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.-32022;skillstest.Fixture.SetInstructions) and is bounded;skills/getis compared with the listed entry.🤖 Generated with Claude Code