api.lawyer
Early access

MCP

Three tools for the agent that buys.

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" }
    }
  }
}
TOOLfile_provisionalOne-shot order on the patent rail: mints a Matter via POST /orders and advances it until it waits on a Signer or terminates.
arguments
{ "title": "string", "inventor": "string", "listFeeUsd": 99 }
TOOLget_matterFetch a Matter, its Asset, and the append-only journal — GET /matters/:id.
arguments
{ "matterId": "m_1" }
TOOLadvance_matterOne propose → gate → commit turn — POST /matters/:id/advance. Returns the escalation when the next act is reserved.
arguments
{ "matterId": "m_1" }

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.