内容
# sequential-thinking-slim
> **Sequential Thinking MCP server optimized for AI assistants** — 通过减少 55.0% 的上下文窗口 tokens,同时保持全部功能,优化了AI助手。兼容 Claude, ChatGPT, Gemini, Cursor, 和所有 MCP 客户端。
[](https://www.npmjs.com/package/sequential-thinking-slim)
[](https://github.com/mcpslim/mcpslim)
[](https://modelcontextprotocol.io)
## sequential-thinking-slim 是什么?
Sequential Thinking [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server 的 **token 优化**版本。
### 问题
MCP 工具模式会消耗大量的 **context window tokens**。当像 Claude 或 ChatGPT 这样的 AI 助手加载 MCP 工具时,每个工具定义都会占用宝贵的上下文空间。
最初的 `@modelcontextprotocol/server-sequential-thinking` 加载 **1 个工具**,大约消耗 **~1,529 个 tokens** —— 这些空间本可以用于实际对话。
### 解决方案
`sequential-thinking-slim` 智能地将 **1 个工具分组为 1 个语义操作**,从而将 token 使用量减少 **55.0%** —— 并且 **零功能损失**。
你的 AI 助手会看到更少、更智能的工具。每个原始功能仍然可用。
## 性能
| Metric | Original | Slim | Reduction |
|--------|----------|------|-----------|
| Tools | 1 | 1 | **-0%** |
| Schema Tokens | 959 | 118 | **87.7%** |
| Claude Code (est.) | ~1,529 | ~688 | **~55.0%** |
> **Benchmark Info**
> - Original: `@modelcontextprotocol/server-sequential-thinking@2025.12.18`
> - Schema tokens measured with [tiktoken](https://github.com/openai/tiktoken) (cl100k_base)
> - Claude Code estimate includes ~570 tokens/tool overhead
## 快速开始
### 一键设置(推荐)
```bash
# Claude Desktop - 自动配置
npx sequential-thinking-slim --setup claude
# Cursor - 自动配置
npx sequential-thinking-slim --setup cursor
# 交互模式(选择你的客户端)
npx sequential-thinking-slim --setup
```
完成!重启你的应用以使用 sequential-thinking。
### CLI 工具(已经有 CLI?)
```bash
# Claude Code (在项目根目录创建 .mcp.json)
claude mcp add sequential-thinking -s project -- npx -y sequential-thinking-slim@latest
# Windows: 使用 cmd /c 包装器
claude mcp add sequential-thinking -s project -- cmd /c npx -y sequential-thinking-slim@latest
# VS Code (Copilot, Cline, Roo Code)
code --add-mcp '{"name":"sequential-thinking","command":"npx","args":["-y","sequential-thinking-slim@latest"]}'
```
## 手动设置
<details>
<summary>点击展开手动配置选项</summary>
### Claude Desktop
添加到你的 `claude_desktop_config.json`:
| OS | Path |
|----|------|
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
```json
{
"mcpServers": {
"sequential-thinking": {
"command": "npx",
"args": ["-y", "sequential-thinking-slim@latest"]
}
}
}
```
### Cursor
添加到 `.cursor/mcp.json` (全局) 或 `<project>/.cursor/mcp.json` (项目):
```json
{
"mcpServers": {
"sequential-thinking": {
"command": "npx",
"args": ["-y", "sequential-thinking-slim@latest"]
}
}
}
```
</details>
## 工作原理
MCPSlim 充当 AI 模型和原始 MCP server 之间的 **透明桥梁**:
```
┌─────────────────────────────────────────────────────────────────┐
│ Without MCPSlim │
│ │
│ [AI Model] ──── reads 1 tool schemas ────→ [Original MCP] │
│ (~1,529 tokens loaded into context) │
├─────────────────────────────────────────────────────────────────┤
│ With MCPSlim │
│ │
│ [AI Model] ───→ [MCPSlim Bridge] ───→ [Original MCP] │
│ │ │ │ │
│ Sees 1 grouped Translates to Executes actual │
│ tools only original call tool & returns │
│ (~688 tokens) │
└─────────────────────────────────────────────────────────────────┘
```
### 翻译工作原理
1. **AI 读取 slim schema** —— 只有 1 个分组工具,而不是 1 个
2. **AI 调用分组工具** —— 例如,`interaction({ action: "click", ... })`
3. **MCPSlim 翻译** —— 转换为原始调用:`browser_click({ ... })`
4. **原始 MCP 执行** —— 真实 server 处理请求
5. **返回响应** —— 结果不变地传回
**零功能损失。节省 55.0% 的 token。**
## 可用工具组
| Group | Actions |
|-------|---------|
此外,还有 **1 个直通工具** —— 不易分组的工具会保持原样,但会优化描述。
## 兼容性
- ✅ **完整功能** —— 保留所有原始 `@modelcontextprotocol/server-sequential-thinking` 功能
- ✅ **所有 AI 助手** —— 适用于 Claude, ChatGPT, Gemini, Copilot 和任何 MCP 客户端
- ✅ **即插即用** —— 相同的功能,只需使用分组的操作名称
- ✅ **已测试** —— 通过自动化测试验证了模式兼容性
## FAQ
### 这会减少功能吗?
**不会。** 每个原始工具都可以访问。工具按语义分组(例如,`click`、`hover`、`drag` → `interaction`),但所有操作仍然可以通过 `action` 参数使用。
### 为什么 AI 助手需要 token 优化?
AI 模型具有有限的上下文窗口。MCP 工具模式会消耗 tokens,而这些 tokens 可以用于对话、代码或文档。减少工具模式大小意味着有更多空间用于实际工作。
### 这是否是官方支持的?
MCPSlim 是一个社区项目。它透明地包装了官方 MCP server —— 原始 server 完成所有实际工作。
## 许可证
MIT
---
<p align="center">
Powered by <a href="https://github.com/mcpslim/mcpslim"><b>MCPSlim</b></a> — MCP Token Optimizer
<br>
<sub>Reduce AI context usage. Keep full functionality.</sub>
</p>
MCP 配置
以下是此 MCP Server 的配置信息,可直接复制到 Cursor 或其他 MCP 客户端中使用。
mcp.json