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.

run the server
$ npx -y api.lawyer mcp serve
client config
{  "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.

healthzread

Liveness of the api.lawyer surface. Keyless.

getread

GET any api.lawyer path (the data tier is keyless — e.g. /matters, /pricing, /openapi.json).

arguments
{ "path": "/matters" }
list_mattersread

List matters. Returns an AXP outcome envelope (type: OK | EMPTY | BLOCKED).

arguments
{ "filter": "provisional" }
get_matterdemand loop

One Matter with its Asset and append-only journal.

arguments
{ "id": "m_1" }
advance_matterdemand loop

One propose → gate → commit turn on a Matter. When the next act is reserved, returns the typed escalation instead of faking success.

arguments
{ "id": "m_1" }
file_provisionaldemand loop

One-shot provisional patent filing order on the patent rail ($199 flat, no filing no charge). Preview build — orders route through the demo substrate.

arguments
{ "title": "Distributed ledger for credential attestation", "inventor": "Ada Inventor", "description": "One paragraph on the invention." }
get_rulesread

What 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.

arguments
{ "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.

run the server
$ npx tsx packages/api/src/mcp.ts
client config
{  "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.

ToolArguments
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" }