claude-knowledge-mcp

edwin-anderson/claude-knowledge-mcp

3.2

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.

Tools
5
Resources
0
Prompts
0

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 session
  • tags (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:

  1. The MCP server handles logic and generates instructions
  2. Returns user-friendly prompts with file operation details
  3. Keeps all data local for privacy and security
  4. Uses natural language commands for ease of use

Implementation Notes

This implementation uses simulated data for demonstration. In a production environment:

  1. File Operations: Would integrate with Claude Code MCP for actual file system operations
  2. Context Injection: Would receive actual conversation content from Claude Desktop
  3. Real Storage: Would perform actual reads/writes to the file system
  4. 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