CRDCA ships an **MCP** (Model Context Protocol) server that speaks over standard input and output. An
agent that already speaks MCP —Claude Desktop, Cursor, any client of the protocol— can enroll a card,
sign it, renew it and verify someone else's without writing a line of code.

::: nota What it is not
It is not a fifth command of the client: `crdca` still has four verbs. The MCP server is a separate
binary, `crdca-mcp`, which speaks the protocol over stdio.
:::

## Start it

```bash
pip install crdca
crdca-mcp --lista
```

`--lista` prints the five tools and the two resources and exits. Without a flag the process listens on
standard input, which is what an MCP client does when it starts it.

## Configure it in a client

The block is the same everywhere: one command and no arguments.

```json
{
  "mcpServers": {
    "crdca": {
      "command": "crdca-mcp"
    }
  }
}
```

If the binary is not on the client's `PATH`, give the absolute interpreter path and the module:

```json
{
  "mcpServers": {
    "crdca": {
      "command": "python3",
      "args": ["-m", "crdca.mcp"]
    }
  }
}
```

## The five tools

| Tool | What it does | What it returns |
| --- | --- | --- |
| `crdca_enroll` | opens the account, creates or takes the key and requests the order; with the `card-01` token it completes issuance | account, order, CSR and, when completed, the chain |
| `crdca_sign` | signs the AgentCard with a detached JWS over JCS | the card with its `signatures` |
| `crdca_renew` | queries ARI and decides whether it is time to renew | the window, the decision and the replacement order |
| `crdca_instance` | issues one JWT credential per replica | the credentials and their verification |
| `crdca_verify` | verifies a signed card | `aceptada`, the codes and the level |

`crdca_verify` does the **local** check: the JWS signature against `x5c[0]`, that `kid` is the SPKI
fingerprint of the leaf, that the SAN URI is the origin URL and that the leaf is valid now. What needs
shared inputs —the chain against the trust package, the inclusion proof and the status list— is
declared under `no_verificado` instead of being faked: that is what the full middleware or the `authz`
filter are for.

::: limite The private key never comes back
`crdca_enroll` accepts `guardar_clave` and writes the key to that path with 0600 permissions. Without it
the key is generated and discarded, and the response says so. No result includes the private key.
:::

## The two resources

| URI | What it is |
| --- | --- |
| `crdca://codigos` | the fifteen verifier codes with their step, meaning and what to do |
| `crdca://api` | the 45 routes of the five services, with method, type and rate limit |

A resource is data the model reads without spending a call: it lets the agent know what an `R07` means
before deciding what to do with a rejection.

## A full run

1. The agent calls `crdca_enroll` with its card URL and `guardar_clave` pointing at its custody.
2. It publishes the `card-01` token with the same `crdca_enroll` and `publicar_token`.
3. It signs with `crdca_sign`, passing the card, the chain and the key.
4. It checks the result with `crdca_verify` and its own URL as `url_origen`.
5. When it is time, `crdca_renew` queries ARI and renews at half life.

The four steps are the same ones the CLI does: the MCP server has no second logic, it calls the same
SDK functions.
