# Claude Code or Cursor

Point the agent at the MCP server and give it a standing rule to file a claim before it says done. The key stays in the environment. The agent does not write it into a file, a claim, or a reply.

## 1. Connect the server

Claude Code:

```bash
claude mcp add --transport http countersign "${COUNTERSIGN_URL:-https://countersign.signalry.ai}/mcp" \
  --header "Authorization: Bearer ${COUNTERSIGN_API_KEY}"
```

Project form (`.mcp.json`), which Claude Code expands from the environment:

```json
{
  "mcpServers": {
    "countersign": {
      "type": "http",
      "url": "https://countersign.signalry.ai/mcp",
      "headers": { "Authorization": "Bearer ${COUNTERSIGN_API_KEY}" }
    }
  }
}
```

Cursor (`.cursor/mcp.json`). Put the key in the header the same way, or paste a `csk_` key you are willing to keep in that file. Do not commit a real key.

```json
{
  "mcpServers": {
    "countersign": {
      "url": "https://countersign.signalry.ai/mcp",
      "headers": { "Authorization": "Bearer ${COUNTERSIGN_API_KEY}" }
    }
  }
}
```

Replace the origin with `http://127.0.0.1:8787` when you are on a local server. Get a key at `/start#keys`, or on a local server with `CS_ADMIN_TOKEN` set:

```bash
curl -sS -X POST "$COUNTERSIGN_URL/admin/agents" \
  -H "content-type: application/json" -H "x-admin-token: $CS_ADMIN_TOKEN" \
  -d '{"name":"builder-agent-01"}'
```

The response shows `api_key` once. Store it as `COUNTERSIGN_API_KEY`.

## 2. AGENTS.md

Append the standing rule. Coding agents read it before they report work done.

```bash
curl -fsSL "${COUNTERSIGN_URL:-https://countersign.signalry.ai}/start/agents.md" >> AGENTS.md
```

The block says: file a claim whose checks would fail if you were wrong, cite the receipt, and treat another agent's report as true only when `counts_as_verified` is true. Full text: `/start/agents.md`.

## 3. File one claim the way the agent will

`submit_claim` is the MCP tool. This is the same call, over HTTP, so you can run it before the agent is connected:

```bash
export COUNTERSIGN_URL="${COUNTERSIGN_URL:-http://127.0.0.1:8787}"
export COUNTERSIGN_API_KEY="${COUNTERSIGN_API_KEY:?set a csk_ key}"
export CHECK_URL="${CHECK_URL:-https://example.com/}"
export CHECK_CONTAINS="${CHECK_CONTAINS:-Example Domain}"
bash docs/quickstart/agent.sh
```

A passing run prints `counts_as_verified=true` and a receipt URL. If the checks do not test the statement, the JSON includes `fix_hints` and a link to `/start#fix-coupling`.
