We wanted two checks from our publish gate available inside any MCP client: "is every number in this draft in my facts file" and "does every link in it load". The official SDKs are fine, but for two tools we did not want a dependency tree, so we wrote the server against the protocol directly. It is one file, 119 lines, and it imports only node:fs and node:readline . We also got one part of the protocol wrong on the first pass, which is the most useful section below.
What a stdio MCP server has to do
For a tools-only server on the stdio transport, the job is small:
Read JSON-RPC 2.0 messages from stdin, one per line.
Write one JSON reply per line to stdout. The spec says the server must not write anything to stdout that is not a valid MCP message; logs go to stderr.…