# Agent Identity MCP Server

MCP Server for AI agent identity and authorization. Create, verify, and manage agent identities with trust scores and scoped authorization tokens.

## Features

- **Agent Identities** — Create and manage unique agent identities with capabilities
- **Trust Scores** — Automatic trust scoring based on agent behavior history
- **Authorization Tokens** — Scoped, time-limited authorization for specific actions
- **Auto-Approval** — High-trust agents get automatic authorization for known capabilities
- **Identity Revocation** — Revoke compromised or misbehaving agent identities

## Installation

```bash
pip install agent-identity-mcp-server
```

## Usage with Claude Code

Add to your `.mcp.json`:

```json
{
  "mcpServers": {
    "agent-identity": {
      "command": "uvx",
      "args": ["agent-identity-mcp-server"]
    }
  }
}
```

## Tools

| Tool | Description |
|------|-------------|
| `create_agent_identity` | Create a new agent identity with name, owner, capabilities |
| `get_identity` | Look up an agent's identity and trust score |
| `authorize_action` | Request authorization for a specific action |
| `verify_authorization` | Verify if an authorization token is valid |
| `list_identities` | List all registered agent identities |
| `revoke_identity` | Revoke an agent's identity |

## Trust Score System

Trust scores range from 0.0 to 1.0 and are calculated from the agent's last 50 actions:

| Score | Level | Auto-Approve |
|-------|-------|--------------|
| 0.9+ | High | Yes |
| 0.7+ | Good | No |
| 0.5+ | Neutral | No |
| 0.3+ | Low | No |
| <0.3 | Critical | No |

## Authorization Flow

1. `create_agent_identity` — Register the agent
2. `authorize_action` — Request permission for an action
3. `verify_authorization` — Verify the token before executing
4. Trust score updates automatically based on activity

## Data Storage

All identity data is stored locally in SQLite at `~/.agent-identity/identities.db`.

## License

MIT
