# Two-Key

> Two-Key is an open-source MCP server for security. Authorization proxy that needs a rule check and AI judges to approve each tool call. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://insomniac-vibelabs.github.io/Insomniac-VibeLabs-Webpage/two-key.html
- **Repository:** https://github.com/insomniac-vibelabs/two-key
- **MCP Registry name:** io.github.Insomniac-VibeLabs/two-key
- **Categories:** security, AI models and LLM tooling
- **Listing updated:** 2026-11-14

## About

The agent never holds the keys. It proposes an action, and two independent checks must both say yes before a single-use token lets the call run. The policy key compiles signed rules to bytecode and checks real arguments such as tool, amount and counterparty, ignoring anything the agent claims about them. The judgment key uses one or more LLM judges under a written constitution, and startup refuses a judge that shares the agent's credential.

Defaults lean to denial: a missing, slow or confused judge counts as no, and a fault in the rules check is a deny. Placed in front of another MCP server with two-key mcp-proxy, it shows the agent only the tools you signed. Every decision goes to an encrypted, hash-chained ledger and can be copied to syslog or an HTTPS webhook without argument values.

It is an Apache-2.0 beta written in Python with one required dependency, and the author says it complements rather than replaces content filters, DLP or user login. Version 0.8.0 added two optional desktop windows, a ledger viewer and a constitution editor.

## Features

- **Dual-key approval:** Deterministic policy plus LLM judges must both agree.
- **Single-use tokens:** Tokens are bound to the exact approved arguments and expire fast.
- **MCP proxy mode:** Exposes only signed tools of the server it fronts.
- **Encrypted ledger:** Hash-chained audit log with signed heads.
- **SIEM forwarding:** Sends decisions to syslog or HTTPS in several schemas.
- **Choice of judges:** Judges from xAI, OpenAI, Anthropic, Gemini or a local model.

## Good for

- Guard an agent that can send payments or emails
- Put approval rules in front of a third-party MCP server
- Keep a verifiable audit trail of agent actions
- Run judges from two vendors for high-assurance setups

## Install

### Claude Code (Terminal)

```sh
claude mcp add two-key -- uvx two-key
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "two-key": {
      "command": "uvx",
      "args": [
        "two-key"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "two-key": {
      "command": "uvx",
      "args": [
        "two-key"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "two-key": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "two-key"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "two-key": {
      "command": "uvx",
      "args": [
        "two-key"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "two-key": {
      "command": "uvx",
      "args": [
        "two-key"
      ]
    }
  }
}
```

## FAQ

### What licence is it?

Apache-2.0.

### Which judge models work?

xAI, OpenAI, Anthropic, Gemini or a local model such as Ollama.

### What if a judge fails?

Silence counts as no, so the call is denied.

### Is it production ready?

The project calls itself a beta heading toward 1.0.

### Is Two-Key free?

Yes. Two-Key is open source, so you can use and self-host it for free.

### How do I add Two-Key to Claude Code?

Run this command in your terminal: claude mcp add two-key -- uvx two-key

### What are the best alternatives to Two-Key?

The closest alternatives to Two-Key are REA, Claude Code Ultimate Guide, Agent Roast, Midplane and Leash.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [Leash](https://ai-powered.com/mcp/leash): Leash is a free MCP server for security.
- [Tinplate Edge AI Safety, Security & EU Compliance](https://ai-powered.com/mcp/tinplate-edge-ai-safety-security-and-eu-compliance): Tinplate Edge AI Safety, Security & EU Compliance is a freemium MCP server for security.
- [SecureCloud](https://ai-powered.com/mcp/securecloud): SecureCloud is a free MCP server for security.
- [Eikino](https://ai-powered.com/mcp/eikino): Eikino is a freemium MCP server for security.

---
Source: https://ai-powered.com/mcp/two-key
