edwin-anderson/claude-knowledge-mcp
If you are the rightful owner of claude-knowledge-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Claude Knowledge MCP is a Model Context Protocol server designed to manage and restore conversation contexts for Claude Desktop.
Claude Knowledge MCP
A Model Context Protocol (MCP) server that enables Claude Desktop to save and restore conversation contexts across chat sessions. Built with FastMCP.
Features
- Save Conversations: Save current conversations with custom titles and tags
- Load Previous Contexts: Resume conversations from where you left off
- Smart Search: Find conversations by keywords, titles, or tags
- Session Management: List and browse all saved sessions
- Auto-Summarization: Generate summaries of conversations
Tools Available
1. save_conversation
Save the current conversation to your knowledge bank.
Parameters:
title
(optional): Custom title for the sessiontags
(optional): Array of tags for categorization
Usage:
- "Save this conversation"
- "Save this as React Tutorial"
- "Save this with tags react, hooks, frontend"
2. load_conversation
Load a previous conversation context.
Parameters:
query
(optional): Search query. If omitted, loads most recent session
Usage:
- "Load previous context" (loads most recent)
- "Load my React hooks discussion"
- "Load the API design conversation"
3. list_sessions
Show available saved conversation sessions.
Parameters:
limit
(optional): Number of sessions to show (default: 10)
Usage:
- "Show my recent conversations"
- "List my saved sessions"
4. search_sessions
Search through all saved conversation sessions.
Parameters:
query
(required): Search terms
Usage:
- "Find conversations about authentication"
- "Search for React discussions"
- "Find sessions tagged with database"
5. get_summary
Generate a summary of the current conversation.
Parameters: None
Usage:
- "Get summary of this conversation"
- "Summarize our discussion"
Development
Installation
npm install
Build
npm run build
Testing
Test the MCP server interactively:
npm run dev
Or inspect with the MCP Inspector web UI:
npm run inspect
Claude Desktop Integration
Add this configuration to your Claude Desktop MCP settings:
{
"mcpServers": {
"claude-knowledge-mcp": {
"command": "npx",
"args": ["tsx", "/path/to/claude-knowledge-mcp/src/index.ts"],
"env": {
"NODE_ENV": "production"
}
}
}
}
Replace /path/to/claude-knowledge-mcp
with the actual path to this project.
Architecture
Data Storage
All conversations are stored locally in ~/claude-knowledge-bank/
:
~/claude-knowledge-bank/
āāā sessions/
ā āāā [session-id]/
ā ā āāā context.md # Full conversation history
ā ā āāā summary.md # Brief summary
ā ā āāā metadata.json # Session metadata
āāā index.json # Master index of all sessions
āāā config.json # User preferences
Key Components
- SessionManager: Handles session creation, ID generation, and search logic
- PromptBuilder: Formats responses for different tool operations
- Tools: Individual MCP tools for each operation (save, load, list, search, summary)
Design Philosophy
This MCP follows the planned architecture where:
- The MCP server handles logic and generates instructions
- Returns user-friendly prompts with file operation details
- Keeps all data local for privacy and security
- Uses natural language commands for ease of use
Implementation Notes
This implementation uses simulated data for demonstration. In a production environment:
- File Operations: Would integrate with Claude Code MCP for actual file system operations
- Context Injection: Would receive actual conversation content from Claude Desktop
- Real Storage: Would perform actual reads/writes to the file system
- Enhanced Search: Could include full-text search through conversation content
Security & Privacy
- Local Only: All data stored locally in user's home directory
- No Network: No external API calls or cloud sync
- File Permissions: Respects file system permissions
- Data Sanitization: Sanitizes file paths and user input
License
MIT