fix(mcp): validate all tools and pass client conformance checks
Problem and behavior
Capve published no output contracts, accepted invalid tool inputs, and could execute tools sent as notifications. It also lacked current MCP discovery and request metadata handling. This adds MCP 2026-07-28 support while preserving legacy clients, validates inputs and successful outputs for all 93 tools, corrects safety annotations, and rejects invalid origins before host routing or authentication.
Text exports retain their literal contents, including numeric zone IDs. Tool failures remain visible to clients without exposing backend exception details. The catalog now passes Inspector without nullable-schema portability warnings.
Validation
- 273 tests passed, including all 93 tools called through authenticated
/mcprequests with real Worker/D1 fixtures, populated reports, CRUD, and exports. - Typecheck, production build, and frozen-lockfile install passed.
- Official SDK v1 and v2 discovery/catalog/tool calls passed; SDK interoperability now runs in CI.
- Inspector 2.15.0: strict catalog and tool call passed, zero warnings.
- Official conformance 0.1.16: five checks passed across four applicable scenarios.
- MCPJam 6.2.2: 100/100 for 2026-07-28 and three legacy revisions. Modern coverage: 23 passed, 19 inapplicable, two optional-feature probes unexecuted. Those unexecuted probes are not counted as passing.
- Manufact mcp-use CLI 2.12.4: legacy, automatic, and modern discovery and tool calls passed.
bun run test:mcp:clients and bun run test:mcp:external create and clean disposable local fixtures. docs/mcp-testing.md records tester versions, commands, sources, coverage and limitations; an optional OpenAI Responses API smoke script is included.
Remaining external checks
These are local results, not a hosted Manufact score or ChatGPT approval. Capve has no existing Manufact catalog score; authenticated ChatGPT plugins still need OAuth instead of personal bearer tokens. The live OpenAI smoke test and hosted evaluations have not run against this undeployed code. No production deployment or merge was performed. Martin must merge after CI/review approval, let the deployment workflow finish, then rerun hosted checks with a disposable account.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Capve now supports MCP 2026-07-28 alongside legacy clients, with discovery metadata and input and output contracts for all 93 tools. Invalid tool calls and origins are rejected, while tool errors stay visible without exposing backend exception details.
- Corrects tool safety annotations and preserves ASN numbers as literal text in exports.
- Adds SDK interoperability checks to CI, plus client testing scripts and setup documentation.
- Documents OpenAI Responses API access and the OAuth limitation for direct ChatGPT plugins.
Summary by CodeRabbit
- New Features
- Expanded MCP compatibility with modern protocol versions, improved tool discovery, and clearer tool input and output schemas.
- Added guidance for connecting through the OpenAI Responses API and confirming the connected account before making changes.
- Bug Fixes
- Improved protection against MCP requests from untrusted origins and clarified error responses.
- Improved ASN-based report grouping.
- Documentation
- Added MCP testing guidance, including supported client checks and the limitation that direct authenticated ChatGPT plugins require OAuth, which is not supported.