MCP
Tools for the agent that buys.
The tools stop exactly where the API stops: a reserved act never resolves in-band. The tool call returns waiting_on_signer, and the Matter moves again only when the Signer’s outcome comes back through the Gig seam.
Setup
The published package runs a stdio MCP server with zero dependencies. Point any MCP client at it.
$ npx -y api.lawyer mcp serve
{ "mcpServers": { "api.lawyer": { "command": "npx", "args": ["-y", "api.lawyer", "mcp", "serve"] } }}
Tools
Three tools carry the demand loop; three more read the surface. A reserved act never resolves in-band: the call returns waiting_on_signer.
healthzreadLiveness of the api.lawyer surface. Keyless.
getreadGET any api.lawyer path (the data tier is keyless — e.g. /matters, /pricing, /openapi.json).
list_mattersreadList matters. Returns an AXP outcome envelope (type: OK | EMPTY | BLOCKED).
get_matterdemand loopFetch a Matter, its Asset, and the append-only journal — GET /matters/:id.
{ "matterId": "m_1" }
advance_matterdemand loopOne propose → gate → commit turn — POST /matters/:id/advance. Returns the escalation when the next act is reserved.
{ "matterId": "m_1" }
file_provisionaldemand loopOne-shot order on the patent rail: mints a Matter via POST /orders and advances it until it waits on a Signer or terminates.
{ "title": "string", "inventor": "string", "listFeeUsd": 99 }
Run from source
src/mcp.ts is a stdio MCP server named api.lawyer. It speaks HTTP to this service (API_LAWYER_URL, default localhost:4902) and exposes the demand loop as tools — so a consumer-side agent can file, watch, and advance a Matter without ever crossing the authority membrane.
$ npx tsx packages/api/src/mcp.ts
{ "mcpServers": { "api-lawyer": { "command": "npx", "args": ["tsx", "packages/api/src/mcp.ts"], "env": { "API_LAWYER_URL": "http://localhost:4902" } } }}