1. Conduid
  2. AI
  3. io.github.tjp2021/mcp-thinkgate
MCP server · AI

io.github.tjp2021/mcp-thinkgate

Auto-classifies prompt complexity and routes to the right Claude thinking mode. No API key needed.

Unclaimed ai
37Low

Scored 7 months ago · breakdown

About io.github.tjp2021/mcp-thinkgate

io.github.tjp2021/mcp-thinkgate is an MCP server published by tjp2021 in the AI category: auto-classifies prompt complexity and routes to the right Claude thinking mode. No API key needed.

The repository has 3 stars and 0 forks, with the last commit 2 months ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

Claude Code
claude mcp add io-github-tjp2021-mcp-thinkgate -- npx -y mcp-thinkgate
npx
npx -y mcp-thinkgate

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about io.github.tjp2021/mcp-thinkgate

Powered by Claude · Grounded in docs

I know everything about io.github.tjp2021/mcp-thinkgate. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

ThinkGate

CI

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.


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 ULTRATHINK manually 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 settings

A 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
fast none Factual, conversational, simple edits
think medium Architecture, debugging, multi-step analysis
ultrathink max System design, proofs, open-ended complexity

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-thinkgate

Import 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 build

Contributing

See CONTRIBUTING.md for dev setup, commands, and PR process.

Security

See SECURITY.md for vulnerability reporting.

License

MIT — see LICENSE

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About io.github.tjp2021/mcp-thinkgate

How do I install io.github.tjp2021/mcp-thinkgate?

Run claude mcp add io-github-tjp2021-mcp-thinkgate -- npx -y mcp-thinkgate, then add the server to your MCP client's configuration.

Is io.github.tjp2021/mcp-thinkgate safe to use with an AI agent?

Its trust score is 37 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is io.github.tjp2021/mcp-thinkgate still maintained?

Yes — the last commit was 2 months ago. The repository has 3 stars and 0 forks.