A real JSON-RPC 2.0 server running in this page: parse, dispatch, error objects, notifications. No SDK, no framework, no mock: the same code ships as a Node stdio server.
db.restock mutates this table. vault.secret only answers when the scoped token is presented.
No request sent yet.
The dispatch function below is mirrored line for line in mcp-server.mjs, a dependency-free Node program that reads one JSON-RPC message per line on stdin and writes responses to stdout. A test client ships next to it:
node mcp-server.mjs # the server, waiting on stdin
node mcp-client-test.mjs # spawns it, runs initialize, tools/list,
# db.query, and vault.secret with and
# without the token, prints the transcript
That mapping is the whole lesson: MCP is JSON-RPC over a pipe. The page is a demo surface; the protocol is identical.