🧠 Claude Thread Continuity MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Never lose context again!** This MCP server automatically saves and restores project state when Claude threads hit token limits, ensuring seamless conversation continuity.
🚀 Features
- **🔄 Automatic State Persistence** - Auto-saves project context during conversations
- **⚡ Seamless Restoration** - Instantly restore full context when starting new threads
- **🛡️ Smart Validation** - Prevents project fragmentation with intelligent name checking
- **🔒 Privacy First** - All data stored locally on your machine
- **🎯 Zero Configuration** - Works invisibly once set up
- **📊 Smart Triggers** - Auto-saves on file changes, decisions, milestones
- **🗂️ Multi-Project Support** - Manage multiple concurrent projects
✨ NEW: Anti-Fragmentation System
Version 1.1 introduces intelligent project validation to prevent the common issue of accidentally creating multiple similar projects:
- **🔍 Fuzzy Name Matching** - Detects similar project names (70% similarity threshold)
- **⚠️ Validation Warnings** - Suggests consolidation when similar projects exist
- **💪 Force Override** - Bypass validation when genuinely different projects needed
- **🎯 Configurable Thresholds** - Adjust sensitivity for your workflow
Example Validation in Action
⚡ Quick Start
🛠️ Installation
1. Install the MCP Server
2. Configure Claude Desktop
Edit your Claude Desktop configuration file:
- **macOS:** ~/Library/Application Support/Claude/claude_desktop_config.json
- **Windows:** %APPDATA%\\Claude\\claude_desktop_config.json
- **Linux:** ~/.config/Claude/claude_desktop_config.json
Add this configuration:
3. Restart Claude Desktop
Close and reopen Claude Desktop. The continuity tools will now be available automatically.
🎯 How It Works
Automatic Context Saving
The server automatically saves project state when:
- ✅ Files are created or modified
- ✅ Technical decisions are made
- ✅ Project milestones are reached
- ✅ Every 10 messages (fallback)
Smart Validation Process
Before saving, the system:
1. **Checks for Similar Names** - Uses fuzzy matching to find existing projects
2. **Calculates Similarity** - Compares project names with 70% threshold
3. **Provides Recommendations** - Suggests consolidation or renaming
4. **Allows Override** - Use force: true for edge cases
Context Restoration
When starting a new thread:
1. **Load Project:** load_project_state: project_name="your-project"
2. **Full Context Restored:** All technical decisions, files, and progress restored
3. **Continue Seamlessly:** Pick up exactly where you left off
🔧 Available Commands
| Command | Description | NEW in v1.1 |
|---------|-------------|-------------|
| save_project_state | Save current project state | ✨ Now with validation |
| load_project_state | Restore full project context | |
| list_active_projects | View all tracked projects | |
| get_project_summary | Get quick project overview | |
| validate_project_name | Check for similar project names | ✨ NEW |
| auto_save_checkpoint | Triggered automatically | |
💡 Usage Examples
Starting a New Project (with Validation)
Checking Name Before Creating
Force Override When Needed
Continuing After Token Limit
Viewing All Projects
🗂️ Data Storage
Project states are stored locally at:
- **Privacy:** Everything stays on your machine
- **Backups:** Automatic backup rotation (keeps last 5)