Draft: Upgrade MCP SDK & Cloudflare transport; add resource generation, validation, and CI#50
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Originvalidation for the MCP transport.Description
package.jsonandpackage-lock.json, declaring@modelcontextprotocol/sdk@^1.29.0,agents@^0.0.115,zod@^3.25.76, andajv@^8.17.1plus Worker test and Wrangler dev deps.createTrailgenicMcpServerusingMcpServerfrom@modelcontextprotocol/sdk/server/mcp.jswith Zod/Ajv input-schema adapters, Ajv runtime validation, per-tool annotations,isError: truebusiness-error results, and conditioning date-range error behavior (lib/mcp-server.js).createMcpHandlerfromagents/mcpwith JSON response mode and a fresh server instance per request, add Accept-normalization, strict JSONContent-Typechecks, MCP protocol-version validation, and configurable MCP allowed origins (tool-registry/worker.js).trailgenic://datasets/{id}andtrailgenic://physiology/{slug}(lib/resources.js) and include resources in discovery/capabilities/tool-registry outputs.mainfor datasets so missing bundled data returns a clear server error; preserve all dataset files andworkers/permit-poller/unchanged.BUILD.versionto1.4.0andreleasedto2026-07-14, and advertise supported MCP protocol versions2025-11-25and2025-06-18(lib/registry.js).scripts/validate-json.mjs,scripts/validate-registry.mjs, purenode:testregistry tests, a Worker-oriented Vitest file scaffold, and CI workflows.github/workflows/ci.ymland updated deploy workflow.Testing
npm run lint) and basic source checks which completed successfully.node --test tests/registry.test.mjs) and registry parity checks (node scripts/validate-registry.mjs), both succeeded.node scripts/validate-json.mjs) which succeeded.npm ci, Worker-runtime Vitest tests (npm run test:workers), andwranglerdry-run failed locally because the environment returned403 Forbiddenfrom the npm registry for required packages, so Worker runtime tests, Wrangler dry-run, bundle-size measurements, CI runs on GitHub Actions, and live acceptance could not be completed here.Codex Task