Thinking Agent MCP
The Thinking Agent MCP server enables AI models to extend their chain of thought, perform tree-structured multi-perspective analysis, and delegate subtasks to specialized agents.
chat_agent: Delegates independent, self-contained subtasks (e.g., logic, creativity, analysis, verification) to a non-thinking model. Fine-tune output viatemperature(0.0–2.0),top_p,max_tokens(default: 4096),seed(for reproducibility),stopsequences, and an optionalsystem_promptto define model behavior.create_branch: Creates tree-structured reasoning branches of four types —drill_down,verify,explore, orstash— for deep multi-perspective exploration, with automatic conclusion extraction.get_branch_details: Retrieves the complete raw reasoning process of any previously created branch node for full traceability.Context isolation: Tools are stateless; all necessary context must be self-contained in the input, preventing dependency on prior conversation history.
API backends: Supports DeepSeek official API (recommended) and SiliconFlow, configurable via environment variables or a local JSON config file.
Robust error handling: Structured error responses with types (
api,network,validation,config) and suggested actions (retry,backoff,fix_input) plus automatic retry with exponential backoff for transient failures.Integration: Works with any MCP-compatible client (e.g., Claude Desktop) via stdio transport, and includes testing frameworks for interactive, batch, and A/B comparison tests.
Click on "Install 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., "@Thinking Agent MCPCheck if 1729 is a prime number using the agent."
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.
Thinking Agent MCP
Extend your thinking model's chain of thought via MCP tools — a Model Context Protocol server that exposes chat_agent, create_branch, and get_branch_details tools, enabling thinking models to offload subtasks to non-thinking models and build tree-structured multi-perspective analysis.
Features
🧠 Chain of Thought Extension — Thinking models can delegate reasoning subtasks to non-thinking models via
chat_agent, extending effective reasoning depth beyond single-model token limits🌳 Tree-Structured Thinking —
create_branchenables recursive, multi-perspective exploration with four branch types (drill down / verify / explore / stash)🔍 Full Traceability —
get_branch_detailsretrieves the complete raw reasoning process of any created branch🛡️ Context Isolation — Tools are stateless and self-contained; all context must be packed into
input_text. No conversation history dependency🎛️ Parameter Control — Fine-grained control over tool model output via
temperature,top_p,seed,stop, andmax_tokens🔌 Dual API Support — Works with both DeepSeek official API (recommended) and SiliconFlow API
Related MCP server: Long Reasoning MCP Server
Table of Contents
Quick Start
# Clone and install
git clone https://github.com/ScarletLilith/DeepSeekV4Flash_Thinking_TreeMCP.git
cd meditatorMCP
npm install
# Configure API (see Configuration section below)
# edit test/config.json or set environment variables
# Start the server
npm run build
npm start
# Or run development mode
npm run devConfiguration
Configuration is loaded with the following priority: Environment variables > test/config.json
Option 1: DeepSeek Official API (Recommended)
export DEEPSEEK_API_KEY=sk-your-key
export DEEPSEEK_BASE_URL=https://api.deepseek.com
export DEEPSEEK_MODEL=deepseek-v4-proNote: DeepSeek's thinking mode uses
thinking: {type: "enabled"}(notenable_thinking: true).
Option 2: SiliconFlow API (Fallback)
export SILICONFLOW_API_KEY=sk-your-key
export SILICONFLOW_BASE_URL=https://api.siliconflow.cn/v1
export SILICONFLOW_MODEL=deepseek-ai/DeepSeek-V4-FlashConfig File
Create test/config.json (gitignored automatically):
{
"baseUrl": "https://api.deepseek.com",
"model": "deepseek-v4-pro",
"apiKey": "sk-xxx"
}Tools
chat_agent
Calls a non-thinking model to execute an independent subtask, extending the thinking model's chain of thought.
Parameters
Parameter | Type | Default | Description |
|
| required | Complete, self-contained task description with all context |
|
| optional | System prompt for role/behavior constraints |
|
|
| Sampling temperature (0.0–2.0). Low = precise, high = creative |
|
|
| Nucleus sampling threshold (0.0–1.0) |
|
|
| Maximum output tokens (enforced server-side via API) |
|
|
| Stop sequences; empty array = natural completion |
|
| optional | Random seed for reproducible output (with low temperature) |
Parameter Strategies
Verification: temperature=0.1, top_p=0.1, max_tokens=2048, seed=42
Exploration: temperature=1.2, top_p=0.95, max_tokens=4096
Balanced: temperature=0.5, top_p=0.8, max_tokens=4096create_branch
Creates a thinking branch node with recursive nesting support for deep multi-perspective analysis.
Parameters
Parameter | Type | Default | Description |
|
| required | Session ID, consistent within a single reasoning session |
|
| required | Self-contained subtask description (≥30 characters) |
|
|
| Branch type: |
|
|
| Parent node ID for tree nesting |
Four Branch Types:
Type | Temperature | Purpose |
| 0.2 | Deep-dive into a subproblem with focused precision |
| 0.0 | Verify a conclusion or hypothesis with maximal determinism |
| 1.0 | Divergent thinking from different angles with high creativity |
| 0.6 | Temporarily record intermediate thoughts for later reference |
Response
{
"status": "success",
"node_id": "n_a1b2c3d4",
"conclusion": "The extracted conclusion text...",
"confidence": 0.85,
"remaining_quota": 12,
"suggestions": [
"发散探索完成,可对有价值的方向用 drill_down 深入",
"还可创建 12 个分支,建议继续多角度探索"
]
}get_branch_details
Retrieves the complete raw reasoning process of a previously created branch node.
Parameters
Parameter | Type | Default | Description |
|
| required | Session ID |
|
| required | Branch node ID returned by |
Response
{
"status": "success",
"node_id": "n_a1b2c3d4",
"raw_process": "The complete raw reasoning output from the model..."
}Error Handling
Tools return structured errors with type and action fields for the thinking model to make informed decisions:
{
"success": false,
"type": "api",
"action": "report",
"error": "API authentication failed (401)",
"status_code": 401
}Error Type |
| Trigger |
|
| DNS resolution failure, connection refused |
|
| 429 rate limited |
|
| 401 authentication failure |
|
| 5xx server errors |
|
| Empty |
|
| Missing API Key / Model configuration |
The server-side retry mechanism uses exponential backoff with jitter (1s→3s→7s, max 3 retries) for 429 and 5xx errors. Network errors (ENOTFOUND, ECONNREFUSED, ECONNRESET) are not automatically retried.
MCP Client Setup
Claude Desktop
{
"mcpServers": {
"thinking-agent": {
"command": "node",
"args": ["path/to/meditatorMCP/dist/index.js"],
"env": {
"DEEPSEEK_API_KEY": "sk-your-key",
"DEEPSEEK_BASE_URL": "https://api.deepseek.com",
"DEEPSEEK_MODEL": "deepseek-v4-pro"
}
}
}
}Any MCP-compatible Client
Configure stdio transport to point to node dist/index.js in the project directory, with the required environment variables set.
Testing
The project includes both interactive and automated test frameworks:
# Interactive CLI (with tools mode)
npm run test:with-tool
# Interactive CLI (pure thinking, no tools)
npm run test:without-tool
# Automated comparison test (runs both scenarios + generates report)
npm run test:comparison
# Batch end-to-end tests
npm run test:batchTest Scripts
Script | Description |
| Interactive CLI test framework |
| Automated A/B comparison (with-tool vs without-tool) |
| Scenario A: thinking model + tools (standalone, DeepSeek) |
| Scenario B: pure thinking model (standalone, DeepSeek) |
| Batch end-to-end tests |
Scoring: Each question is evaluated against 10 objective checkpoints (50 total). Evaluation is done by human reviewers, not automated scripts.
Note: The test/config.json file contains your API key and is automatically gitignored.
Project Structure
├── src/
│ ├── index.ts # MCP Server entry point
│ ├── chatAgentTool.ts # Tool implementations (chat_agent, create_branch, get_branch_details)
│ ├── gatekeeper.ts # Input validation and quota enforcement
│ ├── strategyEngine.ts # Parameter strategy mapping (call_type → temperature/top_p)
│ ├── nodeStore.ts # Branch node storage and conclusion extraction
│ ├── schemas.ts # Zod validation schemas and TypeScript types
│ ├── logger.ts # Structured logging to stderr
│ └── polyfill.ts # Node 14 fetch polyfill
├── test/
│ ├── comparisonTest.ts # A/B comparison test
│ ├── testFramework.ts # Interactive CLI test framework
│ ├── batchTest.ts # Batch testing
│ ├── runA.js # Scenario A test (DeepSeek)
│ ├── runB.js # Scenario B test (DeepSeek)
│ └── config.json # API configuration (gitignored)
├── .env.example # Environment variable template
├── blueprint.md # Project design blueprint (Chinese)
├── package.json
├── tsconfig.json
└── README.mdDevelopment
# Build TypeScript
npm run build
# Start production server
npm run start
# Development mode (ts-node, no build step)
npm run devDesign Philosophy
Self-Contained Task Descriptions — All context must be packed into
input_text; tools never rely on conversation historyContext Isolation — Each tool call is stateless and independent, preventing context explosion in the main chain
Token Cost Optimization — Context is consumed by the cheaper non-thinking model's input tokens, not the thinking model's output tokens
Tree-Structured Reasoning — Complex problems are decomposed into independent branches, each analyzed separately, then synthesized
Benchmark: MCP Tools Impact on Output Quality
We conducted a controlled experiment comparing 3 approaches across 5 challenging engineering problems (distributed consensus, service mesh, RTOS kernel, columnar storage engine, multi-modal AI agent framework).
Test Groups
Group | Model | API | Tools |
A | GLM-5.2 | SiliconFlow | None |
B | DeepSeek-V4-Flash | DeepSeek Official | chat_agent + create_branch |
C | DeepSeek-V4-Flash | DeepSeek Official | None |
Key Results
Metric | A (GLM-5.2) | B (DS + Tools) | C (DS Pure) |
Total Output | 38,888 chars | 169,484 chars 🏆 | 57,565 chars |
Total Time | 705s | 1,516s | 239s 🏆 |
Total Tokens | 28,459 | 210,482 | 29,184 |
Total Cost | ¥0.75 | ¥0.21 | ¥0.06 🏆 |
Avg Output/Question | 7,778 chars | 33,897 chars (4.4x) 🏆 | 11,513 chars |
Tool Calls | 0 | 30 🏆 | 0 |
Cache Hit Rate | 0% | up to 68% 🏆 | 0% |
What We Found
With MCP tools, DeepSeek-V4-Flash produced 4.4x more detailed engineering solutions — including complete Go-style Raft consensus implementations, assembly-level RTOS scheduler code, and production-ready service mesh configurations
Tree-structured thinking (
create_branch) enabled the model to explore 5-6 levels deep on complex problems, creating subtrees for architecture, implementation, testing, and verificationCost comparison: GLM-5.2 costs 13x more than DeepSeek-V4-Flash pure thinking mode (¥0.75 vs ¥0.06) for comparable output quality. With tools enabled, DeepSeek-V4-Flash cost increased to ¥0.21 due to deeper exploration (3.7x more tokens), but remained 3.6x cheaper than GLM-5.2.
Cache hit rates reached 68% during multi-round tool calls, dramatically reducing effective input costs via DeepSeek's prefix caching
Full experiment results and data:
results/comparison/report.md
License
Available Tools
1 toolchat_agentA
调用独立、非思考模式的模型生成文本,用于延伸当前思维链。你可以传入任何需要独立完成且不受对话历史影响的子任务,包括但不限于:逻辑推理、发散联想、创意生成、优缺点分析、情景假设、步骤拆解、知识类比与迁移等。请确保 input_text 是一个完整、自包含的任务描述,明确任务类型与目标。通过调整 temperature(02)和 top_p(01)控制输出的确定性与多样性。对于需要精确复现的场景(如校验任务),建议设置 temperature 接近 0 并指定 seed。
| Name | Required | Description | Default |
|---|---|---|---|
| input_text | Yes | 完整、自包含的任务描述。需明确任务类型(推理/联想/类比/创意/评估等)并提供所有必要的上下文信息,使工具无需依赖外部信息即可独立完成任务。示例:'推理:已知X=5, Y=12,请推导Z=X²+Y²的值,并给出计算步骤。' | |
| system_prompt | No | 可选的系统提示词,用于设定角色或行为约束。如:'你是一个严谨的数学校验员,只输出最终结果。' | |
| temperature | No | 采样温度 0.0-2.0。低值(0.0-0.3)=确定/精确,高值(0.7-2.0)=创造/发散 | |
| top_p | No | 核采样阈值 0.0-1.0。与temperature配合使用控制输出多样性 | |
| max_tokens | No | 最大输出token数。通过API参数在服务端控制,非本地硬截断 | |
| stop | No | 停止序列,遇到这些字符串时停止生成。默认 ['\n\n'] 防止非思考模型自动续写,思考模型可按需覆盖 | |
| seed | No | 随机种子(需 API 支持)。设置后配合低 temperature 可实现输出复现 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description explains that the model is non-thinking, that input must be self-contained, and how temperature/top_p/seed control output. However, it lacks disclosure of potential side effects like token cost or API latency, and without annotations the burden is higher. The description is adequate but could be more explicit about behavioral traits such as statelessness or repeatability guarantees.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single paragraph that front-loads the purpose, then flows into usage guidelines and parameter details. Every sentence contributes meaning, but it is somewhat lengthy. For a tool with 7 parameters, this length is justified, and the structure is logical.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no annotations, the description covers the tool's full input contract and behavior adequately. It explains all parameters and their interplay. Missing are return value expectations (e.g., response format) and error handling, but for a straightforward generation tool, the provided context is sufficient for most use cases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Even though schema coverage is 100%, the description adds significant value: it explains what constitutes a valid input_text with examples, provides intuition for temperature and top_p ranges, clarifies the stop default's purpose (preventing automatic continuation), and advises on seed use for reproducibility. This goes well beyond the schema field descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool calls a non-thinking model to generate text for extending a thought chain, listing specific use cases like reasoning, creativity, and analysis. It uses a specific verb ('调用') and resource ('模型生成文本'), making the purpose unmistakable even without sibling tools for comparison.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit context: it is for independent subtasks not influenced by conversation history. It lists many appropriate scenarios and implies that the tool should not be used for tasks requiring conversational memory, though it does not formally state exclusions. Given no sibling tools, this is clear and sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
chat_agent
TDQS
Only one tool exists, so there is no possibility of confusion between tools. The tool's purpose is clearly described.
With a single tool, naming consistency is trivially maintained. The snake_case format is acceptable.
The server has only one tool, which is at the lower end of reasonable scope. While a single general-purpose tool can be useful, it feels thin for a server named 'Thinking Agent MCP'.
The tool surface is severely incomplete for a thinking agent server. It only provides text generation without any supporting tools for memory, planning, or verification.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Agent-to-agent reasoning-as-a-service: chain-of-thought, analysis, and decision support.
- LiminalityOAuthai.physea
Breaks a hard question or decision into checkable sub-questions, grounds each to a real tool.
1 - WauldoOAuthcom.wauldo
Stateless agentic tools over MCP: concept extraction, long-context, knowledge graph, planning.
Durable agent-to-agent handoffs and shared scratchpad for multi-agent workflows.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides a 'think' tool that allows Claude and other LLMs to add dedicated thinking steps during complex tool use scenarios, creating space for structured reasoning and improving problem-solving capabilities.MIT
- AlicenseAqualityCmaintenanceImplements Chain of Thought methodology for extended sequential thinking on complex reasoning tasks. Enables AI clients to break down and solve problems that require deep, step-by-step logical analysis.1231MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI-to-AI consultation for critical thinking and complex reasoning via OpenRouter, allowing one AI to delegate tasks to another AI model.10MIT
- AlicenseAqualityBmaintenanceAdds a deep_reasoning tool that consults stronger reasoning models (e.g., DeepSeek R1) to produce full reasoning traces for complex problems, helping the agent shape and cross-check its answers.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ScarletLilith/DeepSeekV4Flash_Thinking_TreeMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server