ThinkGate
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ThinkGate classify: design a rate limiter for a public API"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ThinkGate
Automatic reasoning mode selection for Claude agents.
The problem
You built an AI agent. It handles everything — status checks, quick lookups, complex architecture questions, deep debugging sessions. But under the hood it runs every single message through the same model with the same thinking settings.
That means you're burning extended thinking tokens on "what time is it in Tokyo?" and getting shallow answers on "help me design the entire auth system."
You could manually tag requests — ULTRATHINK: before the hard ones. But you forget. Your users definitely won't do it. And if you're building agents for other people, you can't train every end user to manage thinking modes.
ThinkGate fixes this at the infrastructure layer. It sits between the incoming message and your model call, classifies the complexity in ~200ms, and returns exactly which model and thinking depth to use. Automatically. Every time.
Related MCP server: ai-workers-mcp
Who this is for
Agent builders running Claude on a mix of simple and complex tasks who are tired of one-size-fits-all model settings
Teams running 24/7 agents (WhatsApp bots, Slack assistants, Telegram agents) where message complexity varies wildly and cost/latency actually matters
Anyone who's ever typed
ULTRATHINKmanually and thought: this should just happen on its own
How it works
Incoming message
↓
Haiku call (~200ms, ~$0.0001)
"How complex is this?"
↓
fast → no extended thinking
think → medium effort
ultrathink → max effort
↓
Claude runs with the right settingsA cheap, fast Haiku call reads your prompt and decides which tier it needs. Then your main Claude call runs with the right effort level. You pay almost nothing for the classification, and save real money (and latency) on the 60%+ of messages that don't need extended reasoning.
The classifier is the IP here — not which model runs it. Three tiers. A system prompt trained on the boundary between "this needs thinking" and "this doesn't." Works out of the box.
Tiers
Tier | Claude effort | When |
|
| Factual, conversational, simple edits |
|
| Architecture, debugging, multi-step analysis |
|
| System design, proofs, open-ended complexity |
Profiles (model mapping)
Set THINKGATE_PROFILE or pass { profile } to classifyPrompt:
Profile | fast | think | ultrathink |
|
|
|
|
|
|
|
|
|
|
|
|
Per-tier overrides: THINKGATE_FAST_MODEL, THINKGATE_THINK_MODEL, THINKGATE_ULTRA_MODEL.
Cost note: the MCP tool is advisory. Hosts must actually switch models.
Pi does this via ~/.pi/agent/extensions/thinkgate-router.ts + thinkgate.json.
Rule mode (no API key) is free and preferred for auto-routing. Long checklist pastes no longer auto-upgrade to THINK.
Use as an MCP tool (Claude Desktop / Claude Code)
Add to ~/.claude/settings.json (Claude Code) or ~/Library/Application Support/Claude/claude_desktop_config.json (Claude Desktop):
{
"mcpServers": {
"thinkgate": {
"command": "npx",
"args": ["-y", "mcp-thinkgate"],
"env": {
"ANTHROPIC_API_KEY": "your-api-key-here"
}
}
}
}Restart Claude. Now you can ask it to classify before it answers:
"Before responding, classify the complexity of this task: design a rate limiter for a public API"
Tier: think
Effort: medium
Suggested model: claude-sonnet-4-6
Confidence: 92%
Why: Requires structured design reasoning and trade-off analysis, but has well-defined scope.Use as a library (agent frameworks)
Install:
npm install mcp-thinkgateImport and use:
import { classifyPrompt, setLogLevel } from 'mcp-thinkgate';
// Optional: silence logs (default level is 'info', writes to stderr)
setLogLevel('error');
const result = await classifyPrompt(userMessage, process.env.ANTHROPIC_API_KEY!);
// result.tier → 'fast' | 'think' | 'ultrathink'
// result.effort → 'none' | 'medium' | 'max'
// result.confidence → 0.0 - 1.0
// result.reasoning → one sentence explanation
// Works without an API key too (rule-based fallback):
const quickResult = await classifyPrompt(userMessage);Reference implementation: TinyClaw
TinyClaw is an open-source multi-agent framework for Claude. ThinkGate is wired into its invokeAgent() function — every message is automatically classified before the Claude CLI runs, and --effort is set accordingly.
Three lines added. Zero config required. Every agent in every team automatically gets the right thinking depth.
See the integration at src/lib/invoke.ts.
Requirements
Node.js 20+
Anthropic API key (optional — falls back to rule-based classification)
Local development
git clone https://github.com/tjp2021/mcp-thinkgate
cd mcp-thinkgate
npm install
npm test
npm run buildContributing
See CONTRIBUTING.md for dev setup, commands, and PR process.
Security
See SECURITY.md for vulnerability reporting.
License
MIT — see LICENSE
Available Tools
1 toolclassify_complexityA
Classify a prompt's complexity and return the optimal model tier + thinking effort. Active profile: claude (Anthropic native model IDs (haiku / sonnet / opus)). Profiles: claude, openrouter-cost, openrouter-balanced. Returns tier (fast/think/ultrathink), effort, suggested model, confidence, and reasoning.
Inputs: prompt (required), profile.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool exposed, there is no possibility of confusion or misselection between overlapping tools. The single classify_complexity tool has a unique and unambiguous purpose.
The single tool name follows a clear verb_noun pattern, which is internally consistent. Even though there are no other tools to compare, the naming convention is well-formed and predictable.
A server with a single tool is under-scoped for a general 'ThinkGate' concept, which implies a broader set of operations like managing profiles or evaluating multiple aspects. The tool count is too low to constitute a well-rounded tool set.
For its stated purpose of classifying prompt complexity and returning model suggestions, the tool covers its domain completely. There are no obvious missing operations or dead ends within this narrow scope.
Maintenance
Related MCP Connectors
Scores text for substance, depth, and clarity in under 25ms.
A governed, nonclinical reasoning system that helps people and AI agents make sense of difficult moments and choose a grounded next step. Use Clarity OS for overthinking, emotional activation, uncertainty, decision friction, conflicting priorities, repeating patterns, or difficult conversations. It returns structured, safety-governed clarity while preserving uncertainty, personal agency, and appropriate nonclinical boundaries.
AI routing, memory, guardrails, and governance. Routes across Claude, GPT, Gemini.
Sort up to 1,000 texts into your own labels with a calibrated confidence per answer. No API key.
Related MCP Servers
- AlicenseAqualityDmaintenanceClassifies development task complexity (LIGHT/MEDIUM/HEAVY) and recommends the most cost-efficient AI model per provider, enabling optimized model selection for coding tasks.350 npmMIT
- FlicenseAqualityDmaintenanceRoutes commodity NLP tasks like summarization and translation to free-tier LLMs, saving Claude tokens for complex work.12-
- AlicenseBqualityDmaintenanceEnables users to select thinking depth (easy, medium, more, max) for AI responses through natural language, with iterative agent passes for improved quality.2MIT
- AlicenseAqualityCmaintenanceClassifies AI agent turns by complexity and recommends the cheapest model that can handle them, reducing costs in multi-step workflows.2MIT