chadtmiller.com/monolith
An atproto PDS
0
0
Every method as an MCP tool and a CLI command, from its lexicon
Merged Approved
This pull makes every method with a JSON answer an MCP tool on /mcp, and every method except subscribeRepos a pds CLI command. Both are built from the lexicons at build time, and the server, the CLI and the lexicon crate are now three crates behind one pds binary. I found nothing that has to change.
- Spec:
spec/COMMANDS.mdcovers names, argument typing, which methods get a tool or command, answers, exit codes, and auth. It is linked fromSLICE.md,AGENTS.mdandreview.md. The README says what is built, not how. The endpoint's header checks, Origin rejection and notification handling come fromspec/mcpthrough COMMANDS.md's reference to the transport. COMMANDS.md could say so in a line. - Harness: The new checks only add strictness. A tool schema is compared with the lexicon on properties, types, bounds, required, descriptions and annotations. Tool and CLI answers are compared with the reference's. Every MCP message is validated against
schema.json. The tool path maps an unknown error name to status 0, which makes it differ from the reference, so nothing is loosened.EPIPEon stdin is ignored only when the command exits early. TheviaCommandharness drops arguments that arenulland arguments the lexicon doesn't list. COMMANDS.md says whynullcan't be a flag. No check relies on the other. - Server: The new crates add no atproto or MCP crates.
reqwestis used only by the CLI. - Not checked: I could not verify the reasons in
conformance.yamlagainst the conformance suite's source, which is undernode_modules. The two groups of excuses (the suite's own diagnostic tools, and the unserved list methods) are plausible given the server's capabilities.
Approved
Since my approval, the only change is in spec/COMMANDS.md. It now says that the endpoint's header, Origin and protocol-version checks come from the transport and mcp/basic/versioning.md. That is the line I suggested last round. It only documents existing behaviour, so my approval stands.
Merged as 5d29450
Every method the server serves is now also an MCP tool on its
/mcpendpoint and a command of apdsCLI, made from its lexicon (spec/COMMANDS.md).com.atproto.repo.createRecordis the toolrepo_create_recordand the commandpds repo create-record: the same arguments, as tool arguments or--flags, and the same answer. A method added to the server is a tool and a command at once.pds:pds serveruns the server;pds <group> <command>calls a running server (PDS_URL,PDS_TOKEN).pds-serveris now a library.pds-lexicon: the lexicons, embedded at build time, as data: arguments, tool and command names, input schemas, annotations;pds-cli;pds, the binary.2026-07-28, stateless, tools only. Every method with a JSON answer has a tool (getRepo, which answers a CAR file, is CLI-only). Queries arereadOnlyHint;deleteRecord,putRecordandapplyWritesaredestructiveHint, and the other procedures explicitly aren't. A tool passes its token to the method as XRPC does.-reads standard input. It prints one line of JSON; exit status 1 for an error the method answers ({status, error, message}), 2 for a usage error, 3 when the server can't be reached.repoanddidmay be left out, for the account's DID.Harness.
compare.mjs --commandssends 40% of its requests through the method's tool or command, held to the reference as the rest are, including during crashes and forgetRepo's CAR bytes. First it checks:server/discoverandtools/list;-32602for an unknown tool and for a malformed call;Every MCP message is validated against MCP's
schema.json.conformance.mjsruns MCP's conformance suite against the endpoint again; the 7 excused checks and their reasons are inconformance.yaml.Planted bugs:
-literally instead of reading standard input: seeds 31, 32 and 33 fail at steps 84, 38 and 8;repo: they fail at steps 9, 2 and 9;Checked:
just gates: all 15 harness runs and 16 crate tests, in 167s. The first full run lost a run to a harness bug,EPIPEwriting standard input to a command that had already exited, which only shows under load; it's fixed in the last commit.🤖 Generated with Claude Code