# ThinkGate MCP server

> Automatically classifies prompt complexity to route AI agents to the appropriate model and reasoning depth.

- Repository: https://github.com/tjp2021/mcp-thinkgate
- Page: https://hostedmcp.org/servers/tjp2021/mcp-thinkgate
- Transport: stdio
- Stars: 3
- License: MIT
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' mcp-thinkgate -- npx -y mcp-thinkgate
```

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

```json
{
  "mcpServers": {
    "mcp-thinkgate": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-thinkgate"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "mcp-thinkgate": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-thinkgate"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

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

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

```json
{
  "mcpServers": {
    "mcp-thinkgate": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-thinkgate"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-thinkgate --env 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' -- npx -y mcp-thinkgate
```

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

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

[mcp_servers.mcp-thinkgate.env]
ANTHROPIC_API_KEY = "<YOUR_ANTHROPIC_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY>' mcp-thinkgate npx -- -y mcp-thinkgate
```

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

```json
{
  "mcpServers": {
    "mcp-thinkgate": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-thinkgate"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "<YOUR_ANTHROPIC_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `ANTHROPIC_API_KEY` | no | yes | Optional. Enables AI-powered classification via Haiku (more accurate). Falls back to rule-based classification if not provided. Get a key at https://console.anthropic.com |

## FAQ

### Does ThinkGate require an API key?

No, it can work without an API key using a rule-based fallback mode.

### How does the classification process work?

It uses a fast, inexpensive Haiku call to analyze the prompt complexity and determine the required effort tier.

### What are the different reasoning tiers available?

There are three tiers: fast (no extended thinking), think (medium effort), and ultrathink (max effort).

### Can I use this with models other than Claude?

Yes, you can use different profiles like openrouter-cost or openrouter-balanced to map to various models.
