Conversation Search MCP Server

Conversation Search MCP Server

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.

Category
Visit Server

README

Conversation Search MCP Server

Version: 1.1.0
Status: Production Ready
Last Updated: 2025-01-07

Overview

Advanced MCP server providing semantic and traditional search capabilities across Claude Code conversation history. Features vector embeddings, hybrid search, and comprehensive conversation management tools.

🚀 Key Features

Search Capabilities

  • Traditional Search: Fast FTS-based keyword search with session indexing
  • Vector Search: Semantic similarity using OpenAI embeddings
  • Hybrid Search: Combined semantic + keyword matching for optimal results
  • Context Retrieval: Adjacent chunk expansion for full conversation context

Conversation Management

  • Recent Conversations: Optimized retrieval with project filtering
  • Session Details: Full conversation history with message threading
  • Auto-Naming: AI-powered conversation title generation
  • Batch Operations: Bulk renaming and processing capabilities

Database Operations

  • Incremental Updates: Process only new conversations since last run
  • Full Migration: Complete conversation database rebuild
  • Statistics: Comprehensive indexing and usage metrics
  • Vector Migration: One-time embedding generation for existing conversations

📊 Current Scale

  • Conversations: 664 processed sessions
  • Messages: 118,453+ indexed messages
  • Vector Chunks: 13,847 semantic chunks
  • Database Size: ~420MB optimized storage
  • Embedding Cost: ~$0.57 (one-time migration)

🛠️ Technical Stack

  • Runtime: Node.js with TypeScript
  • Database: SQLite with FTS and vector extensions
  • Embeddings: OpenAI text-embedding-3-small
  • Protocol: Model Context Protocol (MCP)
  • Search: Hybrid semantic + keyword matching

🔒 Security Configuration

Environment Variables Setup

  1. Copy the environment template:

    cp .env.example .env
    
  2. Configure your API key:

    # Edit .env and add your OpenAI API key
    OPENAI_API_KEY=your_actual_api_key_here
    

Security Best Practices

  • ✅ Environment Variables: All sensitive data is configured via environment variables
  • ✅ No Hardcoded Secrets: API keys are never committed to version control
  • ✅ Secure Defaults: Vector search gracefully degrades without API key
  • ✅ Read-Only Access: OpenAI API is used only for text embedding generation
  • ✅ Local Processing: All conversation data remains on your system
  • ✅ Cost Control: Built-in token estimation and cost tracking

API Key Management

  • Required For: Vector search, semantic search, AI-powered naming
  • Not Required For: Traditional keyword search, conversation management
  • Permissions: Read-only access to OpenAI embeddings API
  • Cost: ~$0.0001 per 1,000 tokens (very low cost for typical usage)
  • Rate Limits: Automatic batching and retry logic included

Data Privacy

  • Local Storage: All conversation data stored locally in SQLite
  • No Data Sharing: Conversations never sent to external services except for embedding generation
  • User Control: Vector search entirely optional and user-controlled
  • Audit Trail: All API usage logged with token counts and costs

⚡ Quick Start

Prerequisites

# 1. Copy and configure environment variables
cp .env.example .env
# Edit .env with your OpenAI API key (optional)

# 2. Install dependencies
npm install

Build and Run

# Build the server
npm run build

# Test direct communication
echo '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}' | node dist/src/index.js

MCP Integration

Add to your Claude Code configuration:

{
  "conversation-search": {
    "type": "stdio", 
    "command": "node",
    "args": ["/path/to/conversation-search/dist/src/index.js"],
    "env": {}
  }
}

🔍 Available Tools

Traditional Search

  • search_conversations - Keyword search with role filtering
  • get_recent_conversations - Latest conversations with project filtering
  • get_conversation_details - Full session message history
  • get_session_for_resume - Resume-formatted conversation data

Vector Search (Requires OpenAI API Key)

  • vector_search_conversations - Semantic similarity search
  • hybrid_search_conversations - Combined semantic + keyword search
  • get_chunk_with_context - Expand search results with adjacent chunks

Management Tools

  • rename_conversation - Assign custom conversation names
  • generate_conversation_summary - AI-powered title generation
  • list_conversations_with_names - Named conversation listing
  • batch_rename_recent - Bulk conversation naming

Database Operations

  • update_database - Full conversation database rebuild
  • update_database_incremental - Process only new conversations
  • get_indexing_stats - Database statistics and health metrics
  • migrate_to_vector_database - One-time vector embedding migration

📖 Documentation

🎯 Performance

  • Search Speed: Sub-second response for most queries
  • Memory Efficient: SQLite-based storage with optimized indexes
  • Scalable: Handles 100K+ messages with consistent performance
  • Graceful Degradation: Traditional search works without OpenAI API key

🔧 Monitoring

Check server health:

# Get comprehensive statistics
echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "get_indexing_stats"}, "id": 1}' | node dist/src/index.js

Expected output includes traditional and vector database metrics, processing dates, and configuration status.

📝 License

Private development tool - not for redistribution.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured