Sequential Memory MCP Server
An MCP server that combines sequential thinking with persistent memory through a knowledge graph, enabling AI assistants to explore decision trees by recording thinking traces, branching at low-confidence points, and backtracking to explore alternative paths.
README
Sequential Memory MCP Server
A Model Context Protocol (MCP) server that combines sequential thinking with persistent memory through a knowledge graph. This enables AI assistants to explore decision trees by recording thinking traces, branching at low-confidence points, and backtracking to explore alternative paths.
Features
- Linear thinking when confidence is high (≥ 0.6)
- Automatic branching when confidence drops below threshold (< 0.6)
- Path recording in an in-memory graph structure
- Backtracking to explore alternative branches
- Path visualization to see complete thinking traces
- Unexplored branch detection to identify paths not yet taken
Installation
- Clone this repository
- Create a virtual environment:
python -m venv venv venv\Scripts\activate # On Windows # or source venv/bin/activate # On Unix/MacOS - Install dependencies:
pip install mcp
Configuration
Add the following to your Claude Desktop configuration file:
C:\Users\steve\AppData\Roaming\Claude\claude_desktop_config.json
{
"mcpServers": {
"sequential-memory": {
"command": "python",
"args": [
"-m",
"sequential_memory.server"
],
"cwd": "C:\\Users\\steve\\claude\\seq-mem\\src"
}
}
}
Usage
The server provides 5 main tools:
1. think
Process a thought with a confidence level.
- Parameters:
thought(string): The thought contentconfidence(number): Confidence level (0.0-1.0)
- Returns: Status (continue/branch), current node ID, and whether alternatives are needed
2. select_path
Choose from alternative thoughts at a branch point.
- Parameters:
alternatives(array): List of alternative thoughts with confidence levelsselected_index(integer): Which alternative to select (0-based)
- Returns: Selected thought information and new current node ID
3. backtrack
Return to the last high-confidence node in the current path.
- Parameters: None
- Returns: Information about the node backtracked to (or no_target if none found)
4. show_current_path
Display the current thinking path from root to current node.
- Parameters: None
- Returns: Complete path with node details, total nodes, and branch points
5. get_unexplored_branches
Find all branch points with unexplored alternatives.
- Parameters: None
- Returns: List of unexplored branches with their alternatives
Example Usage
User: Let's think through a problem step by step.
Claude: I'll use sequential thinking to explore this systematically.
[thinks: "First, let me understand the problem clearly" (0.8)]
[thinks: "The key aspects seem to be X, Y, and Z" (0.9)]
[thinks: "Now I need to decide on an approach..." (0.3)]
I've reached a point of uncertainty. Let me explore different approaches:
[select_path with alternatives:
- "Focus on aspect X first" (0.7)
- "Start with aspect Y" (0.6)
- "Consider aspect Z" (0.5)]
[Continue thinking on selected path...]
User: Let's backtrack and try a different approach.
Claude: [backtrack]
I've returned to "The key aspects seem to be X, Y, and Z".
Let me explore one of the other approaches...
Testing
Run the test suite:
python -m pytest tests/test_basic.py
# or
python tests/test_basic.py
Architecture
- graph.py: Core graph data structures (Node, Edge, ThoughtGraph)
- tools.py: MCP tool implementations and definitions
- server.py: Main MCP server implementation
- test_basic.py: Comprehensive test suite
Development
The codebase is organized for clarity and extensibility:
- All graph operations are encapsulated in the
ThoughtGraphclass - Tool handlers are separated in the
SequentialMemoryToolsclass - The server handles only MCP protocol communication
- Tests cover both unit and integration scenarios
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。