Conversation Search MCP Server
A Model Context Protocol (MCP) server that provides comprehensive search and analysis capabilities for Claude Code conversation history.
Features
🔍 Full-Text Search
Fast SQLite FTS (Full-Text Search) with optimized indexes
Role-based filtering (user, assistant, system)
Session and project-based organization
Conversation naming and management
🧠 Vector Similarity Search (Optional)
Semantic search using OpenAI embeddings
Find conceptually related conversations
Hybrid search combining keyword and semantic matching
Configurable semantic vs keyword weighting
📊 Advanced Analytics
Conversation indexing with metadata
Usage statistics and database insights
Incremental updates for new conversations
Migration tools for vector database setup
🛠 Management Tools
Automatic conversation discovery and indexing
Custom conversation naming
Session resume information
Database health monitoring
Installation
Quick Start
Environment Setup (Optional for vector search):
cp .env.example .env # Edit .env and add your OpenAI API key for vector search featuresInitialize Database:
# The server will automatically create the database on first run conversation-search-mcpIndex Conversations: Use the
update_database
tool to scan and index your Claude Code conversations.
Configuration
Environment Variables
OPENAI_API_KEY
- OpenAI API key for vector embeddings (optional)CONVERSATION_DB_PATH
- Custom database path (defaults to~/Sync/conversations.db
)CLAUDE_DIR
- Claude projects directory (defaults to~/.claude/projects
)
MCP Server Configuration
Add to your MCP settings:
Available Tools
Core Search Tools
search_conversations
- Full-text search through conversation historyget_recent_conversations
- Get recent conversations with metadataget_conversation_details
- Detailed view of specific conversationsget_session_for_resume
- Information for resuming conversations
Management Tools
rename_conversation
- Assign custom names to conversationsupdate_database
- Full conversation indexingupdate_database_incremental
- Incremental updatesget_indexing_stats
- Database statistics
Vector Search Tools (Requires OpenAI API Key)
vector_search_conversations
- Semantic similarity searchhybrid_search_conversations
- Combined keyword + semantic searchmigrate_to_vector_database
- Vector database setup and migration
Usage Examples
Basic Text Search
Semantic Search
Hybrid Search
Project-Specific Search
Database Schema
The server maintains several SQLite tables:
conversations
- Main conversation data with FTS indexesconversation_names
- Custom conversation namesindexing_metadata
- Indexing timestamps and metadataconversations_fts
- Full-text search virtual table
Performance
Fast Indexing: Optimized SQLite indexes for quick searches
Incremental Updates: Only process new conversations
Memory Efficient: Streaming processing for large datasets
Batch Operations: Efficient bulk operations for initial indexing
Vector Search Costs
When using OpenAI embeddings:
Text embedding model:
text-embedding-ada-002
Cost: ~$0.0001 per 1K tokens
Use
estimate_cost_only: true
in migration tools to preview costs
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and feature requests, please use the GitHub issues page.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables comprehensive search and analysis of Claude Code conversation history using full-text search, optional semantic vector search, and conversation management tools. Provides fast SQLite-based indexing with role-based filtering, project organization, and hybrid search capabilities combining keyword and semantic matching.