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"] } }}
Clients that connect by address use the hosted connector, https://mcp.api.lawyer/mcp, which serves the same tools under the same names. Connect your agent has the setup for each client.
Tools
Three tools carry the demand loop and four 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).
{ "path": "/matters" }
list_mattersreadList matters. Returns an AXP outcome envelope (type: OK | EMPTY | BLOCKED).
{ "filter": "provisional" }
get_matterdemand loopOne Matter with its Asset and append-only journal.
{ "id": "m_1" }
advance_matterdemand loopOne propose → gate → commit turn on a Matter. When the next act is reserved, returns the typed escalation instead of faking success.
{ "id": "m_1" }
file_provisionaldemand loopOne-shot provisional patent filing order on the patent rail ($199 flat, no filing no charge). Preview build — orders route through the demo substrate.
{ "title": "Distributed ledger for credential attestation", "inventor": "Ada Inventor", "description": "One paragraph on the invention." }
get_rulesreadWhat the law reserves for a matter type in the Client's state: one row per act (act, reserved, credential, jurisdiction) from the Jurisdiction Rules table. Keyless.
{ "matterType": "contract_review", "clientState": "CA" }
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" } } }}
The from-source server registers four of the tools, and its Matter argument is matterId rather than id.
| Tool | Arguments |
|---|---|
file_provisional | { "title": "string", "inventor": "string", "listFeeUsd": 99 } |
get_matter | { "matterId": "m_1" } |
advance_matter | { "matterId": "m_1" } |
get_rules | { "matterType": "contract_review", "clientState": "CA" } |