No description
Find a file
2026-01-20 09:07:31 +01:00
src turn developer agent into claude code mcp server 2026-01-20 09:07:31 +01:00
.env.example turn developer agent into claude code mcp server 2026-01-20 09:07:31 +01:00
.gitignore turn developer agent into claude code mcp server 2026-01-20 09:07:31 +01:00
Cargo.lock turn developer agent into claude code mcp server 2026-01-20 09:07:31 +01:00
Cargo.toml turn developer agent into claude code mcp server 2026-01-20 09:07:31 +01:00
README.md turn developer agent into claude code mcp server 2026-01-20 09:07:31 +01:00

Developer

An MCP (Model Context Protocol) server that acts as an AI operator for Claude Code. It allows you to configure permissions and rules, then delegate tasks to Claude Code with AI-powered supervision.

How It Works

┌─────────────────────────────────────────────────────────────┐
│                      MCP Server                              │
│  ┌──────────────┐         ┌──────────────┐                  │
│  │  configure   │         │    prompt    │   ← MCP Tools    │
│  └──────┬───────┘         └──────┬───────┘                  │
│         │                        │                          │
│         ▼                        ▼                          │
│  ┌────────────────────────────────────────┐                 │
│  │            Operator Agent              │                 │
│  │   (Calls OpenRouter API directly)      │                 │
│  │   - Holds permission context           │                 │
│  │   - Reviews prompts before execution   │                 │
│  └──────────────────┬─────────────────────┘                 │
│                     │                                       │
│                     ▼                                       │
│  ┌────────────────────────────────────────┐                 │
│  │          Claude Code Process           │                 │
│  │   - Receives vetted prompts            │                 │
│  │   - Executes with --dangerously-skip   │                 │
│  └────────────────────────────────────────┘                 │
└─────────────────────────────────────────────────────────────┘

MCP Tools

configure

Set up the operator with permissions and rules:

configure("Allow all file operations in /home/user/project, but no network access")
configure("Read-only access to the codebase, can suggest changes but not apply them")
configure("Full access to src/ directory, read-only for config files")

The operator AI processes your natural language instructions and extracts:

  • Working directory
  • Allowed permissions
  • Rules and restrictions

prompt

Send a task to Claude Code:

prompt("Refactor the authentication module to use JWT tokens")
prompt("Fix the bug in the payment processing code")
prompt("Add unit tests for the user service")

The operator:

  1. Reviews the prompt against configured permissions
  2. May modify the prompt to add safety constraints
  3. Runs Claude Code with the vetted prompt
  4. Returns the result

Quick Start

1. Build

cargo build --release

2. Add to Claude Code

# Add the MCP server with your OpenRouter API key
claude mcp add --transport stdio developer \
  --env OPENROUTER_API_KEY=your-openrouter-api-key \
  -- /path/to/developer/target/release/developer

Or add to ~/.claude.json manually:

{
  "mcpServers": {
    "developer": {
      "type": "stdio",
      "command": "/path/to/developer/target/release/developer",
      "env": {
        "OPENROUTER_API_KEY": "your-openrouter-api-key"
      }
    }
  }
}

3. Use in Claude Code

  1. First, configure the operator:

    Use the developer configure tool to allow file operations in /Users/me/myproject

  2. Then send prompts:

    Use the developer prompt tool to add input validation to the user registration form

Environment Variables

Variable Description Required
OPENROUTER_API_KEY OpenRouter API key for the operator AI Yes
RUST_LOG Log level (e.g., developer=debug) No

How the Operator Works

The operator is an AI agent that directly calls the OpenRouter API:

  1. Understands permissions: When you configure it, it extracts structured rules from your natural language instructions

  2. Reviews prompts: Before sending to Claude Code, it checks if the prompt aligns with configured permissions

  3. Adds constraints: It may modify prompts to include working directory context or safety reminders

  4. Denies violations: If a prompt would violate rules, it denies execution with an explanation

Security Model

  • Operator vetting: All prompts pass through the operator AI (via OpenRouter) before reaching Claude Code
  • Permission context: The operator maintains awareness of allowed directories and operations
  • Skip permissions flag: Claude Code runs with --dangerously-skip-permissions because the operator already vetted the prompt
  • No network by default: Unless explicitly configured, the operator denies network-related operations

Development

# Run with debug logging
RUST_LOG=developer=debug cargo run

# Build release
cargo build --release

Architecture

  • src/main.rs - MCP server with configure and prompt tools
  • src/operator.rs - Operator agent that calls OpenRouter API directly
  • src/claude_code.rs - Claude Code subprocess management

Requirements

  • Rust 1.70+
  • Claude Code CLI installed and authenticated
  • OpenRouter API key