Skip to main content
Glama

MCP Think Tank

by flight505

MCP智库

概述

MCP Think Tank 是一个强大的模型上下文协议 (MCP) 服务器,旨在增强CursorClaude @Web等 AI 助手的功能。它为增强推理、持久记忆和负责任的工具使用提供了一个结构化的环境。

关键功能包括先进的顺序思维和链式推理、具有版本控制功能的强大知识图谱存储系统,以及具有调用限制保障措施的智能工具编排。该平台使人工智能能够通过结构化分析解决复杂问题,维护跨会话的知识,并利用网络搜索等外部资源,同时遵守可配置的使用限制。

🎯 哲学

MCP智库建立在三个核心原则之上:

  1. 优雅简约:简约、精心设计的工具,可以补充人工智能功能,而不是试图复制它们。
  2. 增强反思:温和的指导可以促进更好的推理和自我反思,而不受严格的约束。
  3. 持久上下文:简单但有效的知识图谱提供了跨对话的记忆。

主要特点

  • 💭思考工具:用于结构化推理和自我反思的专用空间。
  • 🧩知识图谱:简单有效的持久记忆系统。
  • 📝任务管理工具:计划、跟踪和更新任务,与知识图谱集成。
  • 🌐 Web 研究工具 (Exa) :使用 Exa API 搜索网络并获取来源答案。
  • 🔍记忆工具:用于存储和检索知识图谱中信息的易于使用的工具。
  • 🤝客户端支持:与 Cursor、Claude @Web 和其他 MCP 客户端无缝集成。
  • 🛡️工具编排和调用限制:内置安全措施,通过可配置的限制实现高效、负责任的工具使用。
  • 内容缓存:通过自动重复检测对文件和 URL 操作进行性能优化。
  • 🔄顺序思维:实现具有进度跟踪的多步骤推理过程。
  • 🔎自我反思:自动反思以提高推理质量。
  • 📊结构化输出:自动格式化思维过程以提高可读性。
  • 🔗研究整合:将网络研究结果无缝融入推理流程。

结构化思维的好处

利用think工具为系统推理提供专用空间,鼓励:

  • 明确问题定义
  • 相关背景收集
  • 逐步分析
  • 自我反思推理
  • 完善的结论

最近的研究强调了使用结构化思维带来的显著改善:

  • 复杂决策任务相对提高54%
  • 增强多次试验的一致性
  • 提高了软件工程基准测试的性能

详细功能

除了核心列表之外,MCP Think Tank 还提供了用于高级 AI 交互的复杂功能。

结构化思维(思考工具)

think工具是实现高级人工智能推理的核心机制。它提供了一个专用的结构化环境,让人工智能能够系统地分解问题、收集上下文、分析选项并进行自我反思。与非结构化的响应相比,这能够促进更深入的分析和更高质量的输出。它支持顺序步骤,并与研究和记忆工具无缝集成。

自我反思功能

思考工具包含强大的自我反思功能,可以通过selfReflect: true参数启用:

mcp_think-tool_think({ structuredReasoning: "...", selfReflect: true, reflectPrompt: "Optional custom reflection prompt" })

启用自我反思功能后,AI 会收到反思自身推理的提示。这符合 MCP 的设计理念,即增强而非取代 AI 能力。

您可以使用reflectPrompt参数自定义用于反射的提示,使其适用于特定的推理任务或领域。如果未指定,则使用默认提示,要求识别不一致之处、逻辑错误并提供改进建议。

知识图谱记忆

知识图谱为不同的交互和会话提供持久记忆。它使人工智能能够逐渐加深对项目、其组成部分和相关概念的理解。

  • 带时间戳的观察:所有内存条目都包含用于跟踪的元数据。
  • 重复预防:智能实体匹配避免冗余条目。
  • 自动链接:基于启发式的关系创建连接相关概念(可配置)。
  • 高级查询:使用强大的memory_query工具,按时间、标签、关键词等筛选记忆,进行历史分析并追踪概念演变。轻松查找过去48小时或任何特定时间段内的最新条目。
  • 内存维护:包括修剪和管理内存增长的工具。
  • 关键内存工具upsert_entitiesadd_observationscreate_relationssearch_nodesmemory_queryopen_nodes等工具用于与图表交互。

任务管理工具

一套工具允许人工智能直接在对话流程中管理项目任务。这将规划和执行与知识图谱整合在一起,使人工智能能够了解项目状态和优先级。

关键任务工具
  • plan_tasks :同时创建具有优先级和依赖关系的多个任务
  • list_tasks :按状态和优先级过滤任务
  • next_task :获取最高优先级的任务并将其标记为正在进行中
  • complete_task :将任务标记为已完成
  • update_tasks :使用新信息更新现有任务

网络研究工具(Exa)

利用 Exa API,MCP Think Tank 提供了获取外部信息的工具。这使得人工智能能够从网络上访问最新信息,为其推理提供依据并提供可靠的答案。

  • exa_search :根据查询执行网络搜索。
  • exa_answer :获得对事实问题的简洁、有来源的答案。

**注意:**使用这些工具需要配置您的 Exa API 密钥。请参阅配置部分。

工具编排与保障

MCP Think Tank 包含全面的功能,以确保负责任且高效地使用工具。

  • 使用限制:可配置每次用户交互的最大工具调用次数( TOOL_LIMIT ,默认值:25)。此限制仅计算单条用户消息中的连续工具调用次数,并在用户发送新消息时自动重置。
  • 自动跟踪:所有工具调用均被记录和监控。
  • 优雅降级:当达到限制时,系统会尝试返回部分结果。
  • 智能缓存:相同的工具调用和重复的文件/URL 内容获取将自动缓存,从而减少执行时间和资源占用。缓存行为和大小可配置( CACHE_TOOL_CALLSCONTENT_CACHE )。
  • 可配置访问:工具白名单可以限制特定环境中可用的工具。
  • 错误处理:强大的错误处理为达到限制或无效工具调用等问题提供清晰的反馈。

📦安装

⚠️**重要提示阅读此内容:**在 Cursor 或 Claude 中更新到新版本的 MCP Think Tank 时,您可能会创建 MCP Think Tank 服务器的多个实例,从而导致创建额外的 Node.js 实例,从而降低系统性能 - 这是 MCP 服务器的已知问题 - 请终止系统中的所有 mcp-think-tank 进程,并检查是否只有一个 node.js 实例正在运行。

⚠️ task.jsonl 位于 ~/.mcp-think-tank/ 目录。该文件与 kg 文件分离,因为智库可能会与 kg 文件中先前创建的任务混淆。如果文件过大,或者您想启动新项目并确保文件中没有任务,请删除 task.jsonl 文件的内容。在未来的版本中,任务可能会与 kg 文件合并,以确保已完成的任务和关系存储在内存中,并且不会出现重复的任务。

NPX(推荐)

使用 MCP Think Tank 最简单的方法是通过 Cursor 中的 NPX 使用 mcp.json 文件,该文件无需全局安装即可运行最新版本,

npx mcp-think-tank@2.0.7

对于最新版本(可能存在兼容性问题):

npx mcp-think-tank@latest

一些用户在 Cursor 中使用 npx @latest 时遇到问题,如果是这样,请尝试在 .json 文件中指定版本 mcp-think-tank@2.0.7,或者全局安装它:

全局安装

对于持久命令行工具:

npm install -g mcp-think-tank mcp-think-tank

⚙️ 配置

MCP Think Tank 主要通过环境变量或通过 MCP 客户端的配置(如 Cursor 的.cursor/mcp.json )进行配置。

快速入门:基本设置

  1. 安装 MCP Think Tank (参见上面的安装)。
  2. 获取您的 Exa API 密钥(网络搜索工具所需):
    • exa.ai注册并复制您的 API 密钥。
  3. 重要的 STDIO 服务器已被弃用- MCP 行业正在转向基于 HTTP 的传输,- 未来的更新将不支持 STDIO 服务器。
  4. 配置您的 MCP 服务器(对于 Cursor,添加到.cursor/mcp.json ):
{ "mcpServers": { "think-tank": { "command": "npx", "args": ["-y", "mcp-think-tank@2.0.7"], "type": "streamable-http", "env": { "MEMORY_PATH": "/absolute/path/to/your/project/memory.jsonl", "EXA_API_KEY": "your-exa-api-key-here", } } } }

基本变量

  • MEMORY_PATH必需。内存存储文件的绝对路径。**重要提示:**务必为每个项目设置唯一的MEMORY_PATH ,以避免项目间的知识图谱冲突。如果省略,则默认为~/.mcp-think-tank/memory.jsonl
  • EXA_API_KEYExa 网络搜索工具所需。您从exa.ai获取的 API 密钥。

高级配置

  • TOOL_LIMIT :每次用户交互允许的最大工具调用次数(默认值: 25 )。计数器会随着每条新的用户消息自动重置,确保您在单次交互中最多可以连续调用 25 次工具。
  • CACHE_TOOL_CALLS :启用/禁用相同工具调用的缓存(默认值: true )。
  • TOOL_CACHE_SIZE :缓存工具调用的最大数量(默认值: 100 )。
  • CACHE_CONTENT :启用/禁用文件/URL 操作的基于内容的缓存(默认值: true )。
  • CONTENT_CACHE_SIZE :内容缓存中的最大项目数(默认值: 50 )。
  • CONTENT_CACHE_TTL :缓存内容的生存时间(毫秒)(默认值: 300000 - 5 分钟)。
  • MCP_DEBUG :启用调试日志记录(默认值: false )。
  • MCP_LISTEN_PORT :为 MCP 服务器设置自定义端口(默认值:TCP 服务器为3399 ,与stdio无关)。
  • LOG_LEVEL :设置日志级别( debuginfowarnerror )(默认值: info )。
  • AUTO_LINK :在知识图谱中启用自动实体链接(默认值: true )。

记忆维护

  • MIN_SIMILARITY_SCORE :防止重复时的实体匹配阈值(默认值: 0.85 )。
  • MAX_OPERATION_TIME :批量内存操作的最长时间(以毫秒为单位)(默认值: 5000 )。

.cursor/mcp.json中的高级设置示例配置:

{ "mcpServers": { "think-tank": { "command": "npx", "args": ["-y", "mcp-think-tank@2.0.7"], "env": { "MEMORY_PATH": "./project-memory.jsonl", "EXA_API_KEY": "your-exa-api-key-here", "TOOL_LIMIT": "50", "CACHE_CONTENT": "true", "CONTENT_CACHE_SIZE": "100", "MCP_DEBUG": "false", "AUTO_LINK": "true" } } } }

💡**性能提示:**对于大型项目,增加TOOL_LIMIT和缓存大小可以提升性能,但会增加内存占用。请监控您的使用模式并进行相应调整。但在 Cursor 中,工具限制应为 25,以避免达到限制并从上次工具调用中恢复执行 - 目前许多 Cursor 用户报告在 0.49.6 版本中存在恢复问题。这与 MCP Think Tank 无关。

💡**注意:**如果您在 YOLO 模式或 Vibe 编码中使用 Cursor,我建议您启动新的聊天上下文,并告知 Cursor 应该使用 MCP Think Tank 来创建实体、观察值和关系。这将帮助您充分利用 MCP Think Tank。

上下文启动的一个例子是,在项目的.cursor文件夹中保留一个Prime.md文件,其中包含以下内容:

# Context Prime > Follow the instructions to understand the context of the project. ## Run the following command eza . --tree --git-ignore ## Read the following files > Read the files below to get the context of the project. > list of files: README.md ... ## MCP Think Tank Tools > Test the MCP tools, first use 'show_memory_path' to remind the user of the current memory path file used, then use the 'memory_query' tool to find and read recent entities and observations for the last 48 hours so you are up to date. > Automatically utilize the MCP Think Tank to autonomously track project context, dynamically adding entities, observations, and relations to the knowledge graph while proactively querying for relevant information and historical insights. Use integrated planning and task management tools to enhance project efficiency. Keep track of the project and its context without the user having to ask for it. > Dont do anything else.

有关 MCP 服务器的更多详细信息,请参阅Cursor MCP 文档

项目规则设置(用于光标/AI)

为了确保 Cursor 和其他兼容代理能够有效利用 MCP Think Tank 的工具,您需要为 AI 提供指导。这通常通过项目规则来实现。请按如下方式创建一条“自动附加”项目规则

1. 在 Cursor 中添加新规则

  1. 打开光标。
  2. 转到命令面板( Cmd+Shift+PCtrl+Shift+P )。
  3. 选择**“新建光标规则”**
  4. 命名规则(例如, mcp-think-tank.mdc )。
  5. 在规则编辑器中,设置元数据并粘贴以下示例中的规则内容。

2. 示例规则文件( .cursor/rules/mcp-think-tank.mdc

这个 Markdown 文件作为AI 的上下文,指导它何时以及如何使用可用的工具。

rule type: auto attach use globs: **/*.js,**/*.ts,**/*.jsx,**/*.tsx,**/*.md, **/*.py, **/*.json

----- 规则开始 -----

Regularly utilize MCP Think Tank tools to maintain an updated knowledge graph and maximize its potential. Simply call the tools in your prompt. ## Quick Decision Tree 1. 🤔 **Complex problem to analyze?** → Use `think` to structure reasoning and reflect 2. 🔍 **Need past context or information?** → Use `memory_query` (time-based) or `search_nodes` (keyword-based) 3. 📊 **Planning implementation steps?** → Use `plan_tasks` to create and track work 4. 🌐 **Need current external information?** → Use `exa_search` (general search) or `exa_answer` (factual questions) ## Critical Memory Management (Automatic Use Required) | When to automatically use memory | Tool to use | |------------------|------------| | At session start | `memory_query` with recent time filter (last 24h) | | After completing significant analysis | `upsert_entities` to store conclusions | | When context seems missing | `memory_query` with relevant keyword | | Every ~30 minutes in long sessions | `upsert_entities` to create checkpoint | | When switching between major topics | `think` + `upsert_entities` to summarize progress | | Before session end | `upsert_entities` to store session summary | ## Core Workflows ### Workflow 1: Problem Analysis → Solution 1. `memory_query` → Check for relevant past work 2. `think` → Structure reasoning about the problem 3. `plan_tasks` → Break down implementation steps 4. `upsert_entities` → Store conclusions in memory ### Workflow 2: Research → Knowledge Capture 1. `memory_query` → Check if already researched 2. `exa_search` → Find current information 3. `think` → Analyze findings 4. `upsert_entities` → Document key concepts ### Workflow 3: Context Recovery (Session Resume) 1. `memory_query` → Retrieve recent work (past 24-48h) 2. `open_nodes` → Get details on relevant entities 3. `think` → Synthesize context and plan next steps 4. Continue where left off ### Workflow 4: Task Management 1. `list_tasks` → Review current work status 2. `next_task` → Identify priority task 3. `complete_task` → Mark finished work 4. `upsert_entities` → Document completion ## Trigger Patterns (Automatic Tool Use) | When user... | Automatically use... | |--------------|----------------------| | Asks complex question requiring analysis | `think` | | Mentions "remember" or refers to past work | `memory_query` with time filter → `open_nodes` | | Uses "research" or "find latest" | `memory_query` (check if already known) → `exa_search` | | Asks factual questions needing citations | `exa_answer` | | Mentions planning or implementation | `plan_tasks` | | Refers to continuing previous work | `memory_query` → `list_tasks` → `next_task` | | Seems to have lost context from earlier | `memory_query` with recent time filter | | Makes significant conceptual progress | `upsert_entities` without being asked | | Connects related concepts | `create_relations` | | Completes major section of work | `think` + `upsert_entities` to summarize | ### When To Use Each Memory Tool - `memory_query`: For time-based searches and recent context recovery - `search_nodes`: For finding specific concepts by keyword - `open_nodes`: For retrieving full details of known entities - `upsert_entities`: For creating new knowledge or updating existing entities - `add_observations`: For adding facts to existing entities - `create_relations`: For connecting related concepts ## Other Tools Reference ### Thinking - `think`: Structured reasoning with optional reflection ### Tasks - `plan_tasks`: Create task list - `list_tasks`: View current tasks - `next_task`: Get priority task - `complete_task`: Mark task done ### Research - `exa_search`: Web search - `exa_answer`: Get cited answers ## AI Behavior Requirements 1. ALWAYS check memory at session start with `memory_query` 2. AUTOMATICALLY store important conclusions with `upsert_entities` 3. CREATE periodic memory checkpoints during long sessions 4. PROACTIVELY check memory when context seems missing 5. CHAIN tools together following the workflows 6. PRIORITIZE memory tools before web research 7. SUMMARIZE progress before ending major work segments

----- 规则结束 -----

⚡ 性能优化

MCP Think Tank 采用内置优化功能,确保高效运行:

内容缓存

  • 基于加密散列自动缓存文件和 URL 内容。
  • 防止冗余文件读取和网络请求。
  • 大大加快了对相同内容的重复操作。
  • 缓存大小和TTL可以通过环境变量( CONTENT_CACHE_SIZECONTENT_CACHE_TTL )配置。

工具调用优化

  • 会话中的相同工具调用会被自动检测并从缓存中提供服务。
  • 防止根据交互限制计算重复调用。
  • 提高对重复工具请求的响应能力。
  • 缓存大小是可配置的( TOOL_CACHE_SIZE )。

最佳实践

为了在大型项目中最佳地使用 MCP Think Tank 和 Cursor/Claude:

  • 利用think工具进行所有非平凡的推理和决策过程。
  • 始终使用记忆工具将重要的想法、结论和架构决策保留到知识图谱中。
  • 将网络研究和任务管理集成到您的工作流程中,以使 AI 保持知情和专注。
  • 定期审查和更新项目的知识图谱,以确保其准确性和相关性。
  • 参考现有知识和过去的决策来保持代码和设计的一致性。
  • 注意工具调用限制,尤其是在复杂的自动化工作流程中。如有必要,请监控使用情况。
  • 根据项目需求和复杂性调整配置变量( TOOL_LIMIT 、缓存设置),以获得更好的性能。

🤝 贡献

欢迎贡献代码!欢迎提交 Pull 请求。

  1. 分叉存储库。
  2. 创建你的功能分支( git checkout -b feature/amazing-feature )。
  3. 提交您的更改( git commit -m 'Add some amazing feature' )。
  4. 推送到分支( git push origin feature/amazing-feature )。
  5. 打开拉取请求。

📄 许可证

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

📚 参考链接


Related MCP Servers

  • A
    security
    F
    license
    A
    quality
    Provides reasoning content to MCP-enabled AI clients by interfacing with Deepseek's API or a local Ollama server, enabling focused reasoning and thought process visualization.
    Last updated -
    1
    54
    24
    JavaScript
  • A
    security
    A
    license
    A
    quality
    A server that enhances Claude's reasoning capabilities by integrating DeepSeek R1's advanced reasoning engine to tackle complex reasoning tasks.
    Last updated -
    1
    Python
    MIT License
    • Apple
  • A
    security
    A
    license
    A
    quality
    Enhances AI model capabilities with structured, retrieval-augmented thinking processes that enable dynamic thought chains, parallel exploration paths, and recursive refinement cycles for improved reasoning.
    Last updated -
    1
    15
    JavaScript
    MIT License
    • Apple
  • A
    security
    A
    license
    A
    quality
    AoT MCP server enables AI models to solve complex reasoning problems by decomposing them into independent, reusable atomic units of thought, featuring a powerful decomposition-contraction mechanism that allows for deep exploration of problem spaces while maintaining high confidence in conclusions.
    Last updated -
    3
    25
    JavaScript
    MIT License
    • Apple
    • Linux

View all related MCP servers

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/flight505/mcp-think-tank'

If you have feedback or need assistance with the MCP directory API, please join our Discord server