# Sanction MCP server

> Provides an authorization plane for AI agents to manage spending, tool usage, credentials, and resource provisioning through human-in-the-loop approvals.

- Repository: https://github.com/ericlovold/sanction
- Page: https://hostedmcp.org/servers/ericlovold/sanction
- Transport: stdio, remote
- Stars: 3
- Latest version: 0.10.0

## Install

### Claude Code

```sh
claude mcp add --env 'SANCTION_API_KEY=<YOUR_SANCTION_API_KEY>' sanction -- npx -y sanction-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "sanction": {
      "command": "npx",
      "args": [
        "-y",
        "sanction-mcp"
      ],
      "env": {
        "SANCTION_API_KEY": "<YOUR_SANCTION_API_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "sanction": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "sanction-mcp"
      ],
      "env": {
        "SANCTION_API_KEY": "<YOUR_SANCTION_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"sanction","type":"stdio","command":"npx","args":["-y","sanction-mcp"],"env":{"SANCTION_API_KEY":"<YOUR_SANCTION_API_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "sanction": {
      "command": "npx",
      "args": [
        "-y",
        "sanction-mcp"
      ],
      "env": {
        "SANCTION_API_KEY": "<YOUR_SANCTION_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add sanction --env 'SANCTION_API_KEY=<YOUR_SANCTION_API_KEY>' -- npx -y sanction-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.sanction]
command = "npx"
args = ["-y", "sanction-mcp"]

[mcp_servers.sanction.env]
SANCTION_API_KEY = "<YOUR_SANCTION_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'SANCTION_API_KEY=<YOUR_SANCTION_API_KEY>' sanction npx -- -y sanction-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "sanction": {
      "command": "npx",
      "args": [
        "-y",
        "sanction-mcp"
      ],
      "env": {
        "SANCTION_API_KEY": "<YOUR_SANCTION_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SANCTION_API_KEY` | yes | yes | Agent API key (pxy_...). Create one at https://getsanction.com or via POST /api/v1/wallets then POST /api/v1/agents. |
| `SANCTION_API_URL` | no | no | Sanction API base URL. |
| `SANCTION_WALLET_ID` | no | no | Optional override for sanction_wallet_status; by default the wallet derives from the agent key. |

## FAQ

### How does an agent request human approval?

The agent calls the `sanction_authorize_tool` function with `require_approval: true` and the proposed action. Approvals can be handled via an approval link or a configured Slack channel.

### Can I use Sanction for free?

Yes, individuals can use Sanction for free without needing a credit card for personal or production use.

### What happens if an agent's request is denied?

The agent receives a stable machine string code explaining the denial, allowing it to branch and replan its actions.

### Is the audit log tamper-evident?

Yes, Sanction provides signed, hash-chained snapshots of decisions that can be verified to ensure no data was altered or reordered.
