@writhq/mcp
v0.2.1
Published
Writ MCP server — give an MCP-capable runtime (Claude Code, etc.) a verifiable agent passport. Tools to check status and present signed X-Passport assertions for real economic actions.
Maintainers
Readme
@writhq/mcp
Writ — KYA (Know Your Agent). A verifiable agent passport, over MCP.
An MCP server that gives an MCP-capable
runtime (Claude Code, and any other MCP client) a Writ passport: it holds the
agent's local keypair and exposes tools to check status and present signed
X-Passport assertions for real economic actions.
npx @writhq/mcpTools
| Tool | What it does |
|---|---|
| passport_status | Show the agent's identity: registered agt_ id, configured mandate/platform, and whether the passport is reachable. Call this first. |
| passport_present | Sign an assertion and present it to any platform endpoint via the X-Passport header. Amount in minor units (cents). |
| passport_sign | Present signed authority to sign a document — class, counterparty, liability. Writ attests the authority; the counterparty executes the signature. |
| passport_refill_demo | Refill the Northbank Sandbox brokerage with a signed assertion. Amount in dollars. Demonstrates ALLOW / per-tx DENY / period DENY / revoked DENY. |
passport_sign — signature authority
The second thing a mandate can authorize. Instead of may this agent move $500, it asks may this agent put its principal's name on this paper, at this liability:
passport_sign
url https://esign.example.com/envelopes/env_8821/sign
document_class nda # nda | msa | sow | order_form | dpa | other
counterparty Northwind Logistics GmbH
liability_minor 2500000 # $25,000 of exposure, in cents
document_text "MUTUAL NON-DISCLOSURE AGREEMENT\n\n…"Pass either document_text (hashed locally with the same function the
counterparty uses — nothing but the digest ever leaves the machine) or
document_hash if you already computed it. Supplying both, or neither, is an
error rather than a guess.
The mandate decides. Paper of a class it does not list denies document_class;
a document over the per-document liability cap denies per_tx_cap; too much
cumulative exposure this period denies period_cap.
Writ attests the authority — that a live, scoped mandate from a KYC'd principal covered paper of this class at this liability — and signs a record of that decision. It never produces the signature; the e-signature platform still does that. None of this is a qualified electronic signature (eIDAS/QES).
Configure it in Claude Code
Add to your MCP config (e.g. ~/.claude/mcp.json, or a project .mcp.json):
{
"mcpServers": {
"writ": {
"command": "npx",
"args": ["-y", "@writhq/mcp"],
"env": {
"PASSPORT_URL": "https://api.writhq.com"
}
}
}
}Generic MCP client
Any stdio MCP client can launch it:
{
"command": "npx",
"args": ["-y", "@writhq/mcp"],
"env": { "PASSPORT_URL": "https://api.writhq.com" }
}Point it at a local stack by setting PASSPORT_URL to it — e.g.
http://localhost:8787 for wrangler dev. Production is the default precisely
so that forgetting the variable cannot leave an agent talking to nothing.
Configuration
| Env var | Default | Purpose |
|---|---|---|
| PASSPORT_URL | https://api.writhq.com | Passport service base URL. Set it to point at a local stack. |
| NORTHBANK_URL | http://localhost:3100 | Demo brokerage base URL (for passport_refill_demo). |
| PASSPORT_AGENT_HOME | ./.passport-agent | Where the agent keypair + context are stored. |
Before it can transact
The agent needs a registered identity and a mandate first. Either:
- run
@writhq/sdk/passport-agentCLI to create the keypair, have a principal register the public key, and set the mandate/platform context; or - run the repo's
npm run seed, which provisions a KYC'd principal, registers the agent, issues the Northbank mandate, and wires the context in one step.
Then passport_status will show registered: true and
passport_refill_demo will run the full ALLOW/DENY flow. The keystore is shared
with @writhq/sdk (same PASSPORT_AGENT_HOME), so seeding once wires both.
To see the entire flow end to end without any setup, run
npx @writhq/demo against the live
sandbox.
Home: https://writhq.com · Docs: https://writhq.com/docs/ · API: https://api.writhq.com
License
MIT © Tundra Industries
