The Model Context Protocol (MCP) is often treated as a heavyweight integration requiring substantial SDKs and dependency trees. However, a new implementation by Calyx AI demonstrates that a functional tools-only MCP server can be built in a single file with zero external dependencies. The project, hosted in the agent-ops-kit-lite repository, uses only Node.js built-ins node:fs and node:readline to handle the entire protocol lifecycle in just 119 lines of code.
The Core Protocol Requirements
For a stdio transport server, the requirements are surprisingly minimal. The server must read JSON-RPC 2.0 messages from stdin and write valid JSON replies to stdout, strictly avoiding any non-MCP log output on the standard output stream. The implementation handles four specific methods: initialize, tools/list, tools/call, and ping. Notifications, which lack an id field, are silently ignored, ensuring the server stays compliant with the specification while keeping the codebase lean.
Error Handling Nuances
A critical learning moment for the developers involved distinguishing between protocol errors and tool execution errors. The initial version incorrectly categorized unknown tools or missing arguments as tool execution failures. The corrected implementation throws JSON-RPC error codes -32602 for invalid parameters and -32601 for unknown methods, while reserving isError: true results for actual runtime failures within the tool logic. This distinction is vital for clients to properly interpret server responses.
Testing and Deployment
The server includes five unit tests running on Node v26.7.0, utilizing dependency injection for network calls to ensure tests pass without external connectivity. Developers can manually test the server by piping JSON-RPC messages directly into the script via the shell. While currently tested in Claude Code, the stdio implementation suggests compatibility with other MCP clients, provided they use the standard node command with the script path.
Key Takeaways
- A functional MCP server requires only four methods and basic JSON-RPC handling.
- Strict separation of protocol errors (JSON-RPC codes) from tool errors (
isError) is essential for spec compliance. - Zero-dependency implementations are feasible for tools-only servers, reducing deployment complexity.
The Bottom Line
If your MCP server needs more than a few hundred lines of code, you are likely over-engineering the transport layer. The protocol is simple enough to implement directly, avoiding the bloat of SDKs for straightforward use cases.