long-form, short-form, working drafts · since 2008
141 NOTES IN PRINT
MCP on the Wire
The Model Context Protocol, taken apart one message at a time. Every note here hand-rolls the work an SDK would do for you: the JSON-RPC 2.0 framing, the initialize handshake and version negotiation, both transports, all three server primitives, the three client primitives, and the plumbing they share. The code is Go, and the reason for writing it by hand is that a protocol you have only seen through a wrapper is a protocol you cannot debug.
The series runs in specification order and each note assumes the ones before it. The handshake note takes JSON-RPC for granted, and by the time the security note argues about where the trust boundary sits, it assumes you already know what a tool description is and where it lands in a model’s context. Start at the beginning if any of that is new.
The last note is one server that uses every primitive, runs over both stdio and Streamable HTTP, sits behind OAuth 2.1, is tested end to end, and comes with a single annotated trace through all of it. For the engineering around the protocol rather than the protocol itself, see MCP by Design.