mini-mcp-demo
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mini-mcp-demoadd 2 and 40"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mini-mcp
MCP (Model Context Protocol), implemented from first principles in ~200 readable lines. A server, a client, and the JSON-RPC mechanics between them — the tool-calling core that every agent integration depends on, small enough to read in one sitting.
git clone https://github.com/harshadkhetpal/mini-mcp
cd mini-mcp
PYTHONPATH=src python3 -m minimcp.clientconnected: mini-mcp-demo protocol 2025-06-18
tools discovered: calc.add, text.word_count, text.summarize_naive
calc.add(2, 40) -> 42
word_count -> 6Why build this when SDKs exist
Frameworks hide the protocol, and hidden protocols produce engineers who can wire an
integration but cannot debug one. Implementing the core teaches what the SDKs
actually do: MCP is JSON-RPC 2.0 over a transport, plus three methods that matter —
initialize (handshake and capabilities), tools/list (discovery with JSON-Schema
descriptions), and tools/call (validated invocation). Once that is understood, every
MCP SDK reads as a convenience wrapper, which is what it is.
Related MCP server: mcp-anvil-lite
What's implemented
Piece | Detail |
Server | Tool registry via decorator, JSON-RPC dispatch, correct error codes (-32700 parse, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal) |
Schema validation | Minimal JSON-Schema subset (type, required, properties), written not imported |
Client | Spawns any stdio MCP server, handshakes, discovers, calls |
Demo server | Three deterministic tools, so the loop runs offline |
Scope is deliberate: resources, prompts, sampling and notifications are out. The tools subset is the part agents live on, and a complete small thing beats an incomplete big one.
Design decisions worth arguing with
Transport-agnostic server. handle_line maps one request string to one response
string. The same server runs over stdio, a socket, or a unit test calling it
directly — which is why the protocol tests need no subprocess and never flake.
Unknown tool arguments are rejected, not ignored. A tool receiving parameters it never declared is a bug on its way to production. Strictness here is what makes agent tool-calling debuggable.
Tool exceptions become protocol errors, not crashes. A buggy tool must not take
down the server or the session; the client gets -32603 with the message, and the
loop continues.
bool is not an integer. Python's bool subclasses int, so naive validators
accept True where a count belongs. This one doesn't, and a test pins it.
Testing
PYTHONPATH=src python3 -m pytest tests -qCovers the handshake, discovery, valid and invalid calls, every JSON-RPC error code, and one end-to-end test running the real client against the real server as a subprocess.
Licence
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA minimal Model Context Protocol server that provides basic utility tools including mathematical operations, text processing, hashing, and JSON validation. Implements JSON-RPC stdio transport for local testing and development.
- FlicenseAqualityCmaintenanceA minimal starting point for a Model Context Protocol server with stdio transport and one tool, enabling quick setup and custom tool addition.1
- AlicenseAqualityCmaintenanceMinimal typed scaffold for a local Model Context Protocol stdio server, providing echo and server_status tools.2MIT
- AlicenseAqualityCmaintenanceExposes a verified tool registry (calculator, sandboxed file read, web fetch) over MCP stdio, enabling any MCP-capable client to reuse the same tools from the inspectable ReAct loop.3MIT
Related MCP Connectors
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
x402-paid agent tools: 18 over HTTP, 14 over stdio. USDC per call, no API key.
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/harshadkhetpal/mini-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server