顺序思考MCP服务器

一个用于通过结构化思维进行动态和反射性解决问题的远程MCP服务器实现。

  • by sheikhcoders
  • TypeScript
  • 混合部署
  • 更新于
在 GitHub 查看 sheikhcoders/sequential-thinking-mcp

使用说明

🧠 顺序思维MCP服务器

A. 远程MCP服务器 通过结构化思维实现动态和反思性问题解决。与官方合作建造 @vercel/mcp-adapter 用于无缝部署Vercel 流式HTTP 运输。

✨ 特性

  • 🔄 可流式HTTP传输 -现代高效交通(MCP规范2025年3月推荐)
  • 🌐 SSE支持 -与服务器发送事件的向后兼容性
  • 📦 Vercel原住民 -一键部署 @vercel/mcp-adapter
  • 🔀 分支逻辑 -探索另类思维路径
  • 📝 修订跟踪 -完善和改进以前的想法
  • 💾 会话管理 -在互动中持续思考
  • 🏷️ 自动分类 -自动思维类型检测

🚀 快速部署

部署到Vercel(推荐)

部署后,您的MCP服务器将在以下位置可用:

  • 流式HTTP: https://your-app.vercel.app/mcp
  • 上海证券交易所: https://your-app.vercel.app/sse

地方发展

# Clone the repository
git clone https://github.com/sheikhcoders/sequential-thinking-mcp.git
cd sequential-thinking-mcp

# Install dependencies
npm install

# Build
npm run build

# Run stdio mode (for MCP clients)
npm start

# Run HTTP mode (for development)
npm run start:http

📡 运输方式

流式HTTP(推荐)

最新的MCP传输规范。消除了持久连接,以实现更好的可扩展性。

POST https://your-app.vercel.app/mcp

服务器发送事件(SSE)

用于向后兼容性的传统传输。

GET https://your-app.vercel.app/sse

标准IO(标准IO)

适用于Claude Desktop等本地MCP客户端。

node dist/index.js

🔧 配置

克劳德桌面版

添加到 ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "sequential-thinking": {
      "url": "https://your-app.vercel.app/mcp"
    }
  }
}

光标

添加到 .cursor/mcp.json:

{
  "mcpServers": {
    "sequential-thinking": {
      "url": "https://your-app.vercel.app/mcp"
    }
  }
}

Cline(流式HTTP)

添加到 cline_mcp_settings.json:

{
  "mcpServers": {
    "sequential-thinking": {
      "command": "npx",
      "args": ["mcp-remote", "https://your-app.vercel.app/mcp"],
      "transportType": "Streamable HTTP"
    }
  }
}

用于stdio(本地)

{
  "mcpServers": {
    "sequential-thinking": {
      "command": "npx",
      "args": ["sequential-thinking-mcp"]
    }
  }
}

🛠️ 可用工具

sequential_thinking

通过动态思维管理逐步解决问题的主要工具。

参数:

参数 类型 必填 说明
thought string ✅ 您当前的思考步骤
nextThoughtNeeded boolean ✅ 是否需要另一种思考
thoughtNumber 编号 ✅ 当前思想数(1-索引)
totalThoughts 编号 ✅ 估计需要的总想法
isRevision boolean ❌ 这是否改变了之前的想法
revisesThought 编号 ❌ 正在修改哪个思维数字
branchFromThought 编号 ❌ 从这个想法创建分支
branchId string ❌ 分支标识符
sessionId string ❌ 用于持久化的会话ID

get_thinking_summary

获取一次思考会议的全面总结。

list_thinking_sessions

列出所有可用的思考环节。

switch_thinking_branch

在不同的思维分支之间切换。

complete_thinking_session

将会话标记为已完成,并可选择最终结论。

📊 思维类型

思想会自动分类:

类型 检测时间
question 包含 ?,从什么/如何/为什么开始
observation 包含“我注意到”、“我看到”、“观察”
hypothesis 包含“也许”、“也许”和“假设”
verification 包含“验证”、“测试”、“检查”
insight 包含“洞察力”、“实现”、“啊哈”
conclusion 包含“因此”、“结论”
refinement 包含“优化”、“改进”、“更好”
reflection 包含“反思”、“思考”
analysis 分析报表的默认值

🏗️ 项目结构

sequential-thinking-mcp/
├── api/
│   └── [transport]/
│       └── route.ts       # Vercel serverless handler
├── src/
│   ├── index.ts           # CLI entry point (stdio mode)
│   ├── server.ts          # MCP stdio server
│   ├── http-transport.ts  # Express HTTP server
│   ├── thinking-session.ts # Session management
│   └── types.ts           # TypeScript definitions
├── package.json
├── tsconfig.json
├── vercel.json            # Vercel configuration
└── README.md

🔒 生产注意事项

会话保持

对于具有持久会话的生产,请集成 Vercel KV 或 升级Redis:

import { kv } from '@vercel/kv';

// Store session
await kv.set(`session:${sessionId}`, session);

// Retrieve session
const session = await kv.get(`session:${sessionId}`);

认证

为生产添加OAuth或API密钥身份验证:

// In your handler
const authHeader = request.headers.get('Authorization');
if (!validateToken(authHeader)) {
  return new Response('Unauthorized', { status: 401 });
}

📄 api参考

健康检查

curl https://your-app.vercel.app/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "initialize", "id": 1}'

呼叫工具

curl https://your-app.vercel.app/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "sequential_thinking",
      "arguments": {
        "thought": "Let me analyze this problem step by step",
        "nextThoughtNeeded": true,
        "thoughtNumber": 1,
        "totalThoughts": 5
      }
    },
    "id": 1
  }'

📚 资源

📝 许可证

MIT许可证-请参阅 许可证 了解详情。

🤝 贡献

欢迎投稿!请阅读我们的投稿指南并提交PR。


内置于❤️ 使用模型上下文协议