MCP's core idea demystified with raw Python
KUSHAL BARAL strips Model Context Protocol down to its essentials by building a minimal two-version implementation using only Python's standard library — no SDKs, no external dependencies — to show that MCP is fundamentally just structured JSON exchanged between a client and a server.
Score breakdown
Developers building or integrating MCP servers can use this mental model — and the zero-dependency Python reference code — to understand exactly what the SDK is abstracting before writing production tooling.
- 01MCP (Model Context Protocol) is used by Claude, Cursor, and a wide range of AI tooling.
- 02The author built two minimal MCP implementations using only Python's standard library — no external dependencies.
- 03Basic version: client sends JSON over stdin, server runs a tool and replies with JSON on stdout.
KUSHAL BARAL's post cuts through the complexity surrounding Model Context Protocol by reducing it to its conceptual minimum: a server exposes tools (functions an AI can call), a client discovers and invokes those tools by name, and every message is JSON with a predictable shape. He notes that while the real MCP spec layers on capability negotiation, resource types, prompt templates, and SSE transport, the fundamental client-asks/server-responds loop remains unchanged.
To cement this understanding, he built two Python implementations using only the standard library.
To cement this understanding, he built two Python implementations using only the standard library. The basic version is the absolute minimum — a client sends a raw JSON request, the server reads it from stdin, runs a tool, and replies with JSON on stdout. The richer version introduces a JSON-RPC-style handshake: an `initialize` step where the server returns its name and version, a `tools/list` call where the client discovers available tools, and a `tools/call` step where the client invokes a tool with arguments. He points out that real MCP uses stdio transport for local servers and SSE for remote ones — the same concept with more sophisticated plumbing. The full code is available on GitHub at `kushal1o1/Mcp-basics`.
Key facts
- 01MCP (Model Context Protocol) is used by Claude, Cursor, and a wide range of AI tooling.
- 02The author built two minimal MCP implementations using only Python's standard library — no external dependencies.
- 03Basic version: client sends JSON over stdin, server runs a tool and replies with JSON on stdout.
- 04Richer version adds a three-step JSON-RPC-style flow: `initialize`, `tools/list`, and `tools/call`.
- 05Real MCP uses stdio transport for local servers and SSE transport for remote ones.
- 06The protocol's purpose is to let any AI agent talk to any server without custom glue code.
- 07Full source code is published at github.com/kushal1o1/Mcp-basics.