# Agent Clinic

> Agent Clinic is a paid MCP server for agent testing. Pay-per-visit diagnostic for AI agent run logs, examined on your own model. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Paid
- **Platforms:** API, CLI
- **Website:** https://clinic.sosell.al
- **MCP Registry name:** io.github.mohammedalmohaish-cyber/agent-clinic
- **Categories:** [agent testing](https://ai-powered.com/categories/agent-testing)
- **Listing updated:** 2026-11-27

## About

Agent Clinic reviews a failed or messy agent run by sending its instructions to your own model rather than uploading the log. You pay one USDC amount per visit over x402 on Base, receive a set of instructions split into eleven review passes, and your agent runs those passes against its own run log and produces a report with findings tied to exact quoted lines.

Each finding points back to a line in the log, and a verification pass drops any quote that cannot be found word for word. The report includes a suggested corrected instruction file that the agent owner reviews before applying, so nothing in the agent's settings changes automatically.

The clinic is aimed at people running tool-using agents who want to understand why a run went wrong, such as repeated failing tool calls or claims unsupported by tool results. Spending is capped per call and per day through environment variables, and the wallet only needs USDC.

## Features

- **Pay-per-visit pricing:** Each visit costs one dollar in USDC on Base, with no account or subscription.
- **Runs on your own model:** The examination happens on the model your agent chooses, so the log stays off the clinic's servers.
- **Quote-checked findings:** Each finding quotes the log line behind it, and unmatched quotes are removed.
- **Corrected instruction file:** The report includes a suggested revised instruction file for the owner to review.
- **Spending caps:** Per-call and daily spending limits are set through environment variables and refuse visits before signing.
- **MCP server integration:** Runs as a stdio MCP server installable from npm for use with compatible AI clients.

## Good for

- Finding why an agent repeatedly calls a tool with the wrong arguments
- Checking whether an agent claims results it never retrieved
- Reviewing an agent's instructions for conflicting or blocking rules
- Reducing wasted tokens and retry loops in a long-running agent

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add agent-clinic --env AGENT_PRIVATE_KEY='<AGENT_PRIVATE_KEY>' -- npx -y agent-clinic-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add agent-clinic --env AGENT_PRIVATE_KEY='<AGENT_PRIVATE_KEY>' -- npx -y agent-clinic-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.agent-clinic]
command = "npx"
args = ["-y", "agent-clinic-mcp"]
env = { AGENT_PRIVATE_KEY = "<AGENT_PRIVATE_KEY>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e AGENT_PRIVATE_KEY='<AGENT_PRIVATE_KEY>' agent-clinic npx -- -y agent-clinic-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

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

```json
{
  "mcpServers": {
    "agent-clinic": {
      "command": "npx",
      "args": [
        "-y",
        "agent-clinic-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<AGENT_PRIVATE_KEY>"
      }
    }
  }
}
```

## FAQ

### Does the clinic see my run log?

No. The visit request carries no log field, and the examination runs on your agent's own model. Only optional check-ins such as stage names and counts are sent, unless you choose to share the full report.

### What does a visit cost?

One dollar per visit, paid in USDC on Base. Payment is final and there are no refunds. Your own model's token costs are separate.

### Which network does the MCP server use by default?

Base mainnet, eip155:8453. Base Sepolia testnet is available by setting NETWORK to eip155:84532.

### What happens if the answer is lost?

Running the visit again with the same request_id returns the same visit without charging again, before the visit expires after three days.

### How do I add Agent Clinic to Claude Code?

Run this command in your terminal: claude mcp add agent-clinic --env AGENT_PRIVATE_KEY='<AGENT_PRIVATE_KEY>' -- npx -y agent-clinic-mcp

### What are the best alternatives to Agent Clinic?

The closest alternatives to Agent Clinic are Agent Failure Archive, AI Agent Audit and Action Review, AgentPing and AI Agent Security Scanner.

## Where this comes from

- Description: written from the project's website and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Agent Failure Archive](https://ai-powered.com/mcp/agent-failure-archive): Agent Failure Archive is a freemium MCP server for agent testing.
- [AI Agent Audit and Action Review](https://ai-powered.com/mcp/ai-agent-audit-and-action-review): AI Agent Audit and Action Review is a paid MCP server for agent testing.
- [AgentPing](https://ai-powered.com/mcp/agentping): AgentPing is a freemium MCP server for agent testing.
- [AI Agent Security Scanner](https://ai-powered.com/mcp/ai-agent-security-scanner): AI Agent Security Scanner is a freemium MCP server for security.

---
Source: https://ai-powered.com/mcp/agent-clinic
