Skip to content

MCP 2025-11-25 spec compliance, security hardening and dependency updates - #42

Merged
kiliczsh merged 14 commits into
mainfrom
next
Jul 21, 2026
Merged

MCP 2025-11-25 spec compliance, security hardening and dependency updates#42
kiliczsh merged 14 commits into
mainfrom
next

Conversation

@kiliczsh

Copy link
Copy Markdown
Owner

Summary

This PR brings the server into full compliance with the MCP 2025-11-25 specification, hardens the HTTP transport, and updates all dependencies including a transitive security cleanup. Version bumped to 2.1.0.

Spec compliance (2025-11-25)

  • SEP-1303: Input validation and MongoDB runtime errors are now returned as tool execution errors (isError: true) instead of protocol errors, so models can see the failure and self-correct. Unknown tool names remain protocol errors (-32602 InvalidParams) and cancellation still propagates as AbortError.
  • Task gating: the task-augmented execution path is only entered when the client explicitly sends task request params.
  • Implementation metadata: added title, description and websiteUrl to the server info returned during initialize.
  • Verified tool input schemas compile under JSON Schema 2020-12 (strict mode, Ajv) and tool names conform to SEP-986 naming guidance — no changes needed.

Security

  • Origin header validation on HTTP transport (DNS rebinding protection): invalid origins now receive 403 Forbidden as required by the Streamable HTTP spec. Non-browser clients (no Origin header) and localhost origins are allowed by default; additional origins can be granted via --allowed-origins or MCP_HTTP_ALLOWED_ORIGINS.
  • Dependency overrides: forced patched versions of 13 vulnerable transitive packages (shell-quote, qs, hono, ws, express-rate-limit and others), reducing bun audit findings from 57 (1 critical, 16 high) to 3 moderate. The remaining findings require upstream SDK updates.

Dependencies

  • @modelcontextprotocol/sdk 1.26 → 1.29 (adapted to the relocated RequestTaskStore and stricter sendNotification typing)
  • mongodb 7.1 → 7.5, zod 3 → 4, @biomejs/biome 2.3 → 2.5, @types/node 25 → 26, @modelcontextprotocol/inspector 0.19 → 1.0
  • TypeScript intentionally stays on 5.9 pending TS7 ecosystem support.

Testing

  • E2E over stdio JSON-RPC against a MongoDB test matrix: standalone, replica set, no-auth, auth+keyFile replica set, and TLS (with CA validation) across server versions 4.4, 6.0, 7.0 and 8.2 — 7/7 passing.
  • Error semantics suite (valid call, missing collection, invalid pipeline type, unknown operator, unknown tool) — 5/5 passing.
  • Origin validation verified live over HTTP: no-Origin and localhost allowed, cross-origin rejected with 403, allowlist flag honored.
  • Build (tsup), typecheck and lint clean; MCP Inspector 1.0 verified working.

- Move RequestTaskStore import to shared/protocol.js (relocated in 1.29)
- Narrow sendProgress notification type to match stricter sendNotification signature
- Verified against MongoDB 8.2.11 replica set: initialize negotiates 2025-11-25,
  all capabilities intact, tools/call working
Input validation and MongoDB runtime errors now return isError results
so the model can self-correct; unknown tool names remain protocol errors
(InvalidParams) and cancellation still propagates as AbortError.
…ion)

Invalid origins now receive 403 Forbidden as required by the Streamable
HTTP spec. Localhost origins and non-browser clients (no Origin header)
are allowed by default; additional origins can be granted via
--allowed-origins or MCP_HTTP_ALLOWED_ORIGINS.
… 26)

zod is unused in src and only satisfies the SDK peer range; typescript
stays on 5.9 pending TS7 ecosystem support, inspector stays on 0.19.
Verified via MCP against all 7 test variants (4.4 through 8.2, RS, TLS).
Forces patched versions of 13 transitive packages (shell-quote, qs,
hono, ws, express-rate-limit and others), reducing audit findings from
57 (1 critical, 16 high) to 3 moderate. Remaining findings need
upstream SDK updates (hono 2.x major, dual-major ajv tree).
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@kiliczsh
kiliczsh merged commit 655e68f into main Jul 21, 2026
2 checks passed
@kiliczsh
kiliczsh deleted the next branch July 21, 2026 21:19
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.

1 participant