mcp

MCP 2026-07-28 protocol types, JSON-RPC codec and SEP-2243 header validation. No dependencies.

mcp
model-context-protocol
json-rpc
protocol
moon add marianoguerra/mcp@0.7.0
Download zip
Version
0.7.0
License
MIT
Last updated
2 days ago
Downloads
97
README

#marianoguerra/mcp

Protocol types, JSON-RPC codec and SEP-2243 header validation for the Model Context Protocol, 2026-07-28 ("modern") era.

No dependencies. Builds on native, js, wasm and wasm-gc. Nothing here does I/O, so you can use it from a browser or a wasm host and supply your own transport.

moon add marianoguerra/mcp

#What is in it

PackagePurpose
@jsonrpcJSON-RPC 2.0 frames, request-id generation, the modern error codes (-32020 HeaderMismatch, -32021 MissingRequiredClientCapability, -32022 UnsupportedProtocolVersion)
@metaThe _meta envelope every modern request carries, resultType classification (complete / input_required), and the reserved io.modelcontextprotocol/* keys
@base64Standard base64 over bytes, both ways — the codec behind the =?base64?…?= header sentinel and behind every resources/read blob
@xmcpheaderSEP-2243 x-mcp-header scanning: RFC 9110 token validation, static-reachability, the =?base64?…?= sentinel, and the tool-exclusion rule
@hypermediaThe org.marianoguerra.mcp/hypermedia extension: HTTP-shaped metadata on results — content type, disposition, RFC 9457 problem details, RFC 8288 links — and the resolution that says what a content block holds and where that answer came from. See docs/hypermedia.md
@transportThe Transport and ResponseStream traits, so you can plug in your own I/O

#Why this is separate

The modern era has no handshake: every request is self-describing via _meta, and a conforming client MUST drop a tool whose x-mcp-header annotations are invalid. Both of those are pure computation over JSON, and neither should require an I/O stack. Depending on this module alone keeps that true.

For a working client over HTTP or stdio, use marianoguerra/mcp-client.