Skip to main content
Glama

Conversation Search MCP Server

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

npm install conversation-search-mcp

Quick Start

  1. Environment Setup (Optional for vector search):

    cp .env.example .env # Edit .env and add your OpenAI API key for vector search features
  2. Initialize Database:

    # The server will automatically create the database on first run conversation-search-mcp
  3. Index 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:

{ "mcpServers": { "conversation-search": { "command": "conversation-search-mcp", "env": { "OPENAI_API_KEY": "your-openai-key-here" } } } }

Available Tools

Core Search Tools

  • search_conversations - Full-text search through conversation history

  • get_recent_conversations - Get recent conversations with metadata

  • get_conversation_details - Detailed view of specific conversations

  • get_session_for_resume - Information for resuming conversations

Management Tools

  • rename_conversation - Assign custom names to conversations

  • update_database - Full conversation indexing

  • update_database_incremental - Incremental updates

  • get_indexing_stats - Database statistics

Vector Search Tools (Requires OpenAI API Key)

  • vector_search_conversations - Semantic similarity search

  • hybrid_search_conversations - Combined keyword + semantic search

  • migrate_to_vector_database - Vector database setup and migration

Usage Examples

Basic Text Search

// Search for conversations about "authentication" const results = await mcp.callTool('search_conversations', { query: 'authentication', limit: 10 });

Semantic Search

// Find conversations semantically related to "user login issues" const results = await mcp.callTool('vector_search_conversations', { query: 'user login issues', limit: 5, semantic_weight: 0.8 });

Hybrid Search

// Combine keyword and semantic search const results = await mcp.callTool('hybrid_search_conversations', { query: 'database performance optimization', semantic_weight: 0.7, // 70% semantic, 30% keyword include_context: true });

Project-Specific Search

// Search within a specific project const results = await mcp.callTool('search_conversations', { query: 'API endpoints', project: '~/projects/MyApp' });

Database Schema

The server maintains several SQLite tables:

  • conversations - Main conversation data with FTS indexes

  • conversation_names - Custom conversation names

  • indexing_metadata - Indexing timestamps and metadata

  • conversations_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

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

For issues and feature requests, please use the GitHub issues page.

-
security - not tested
F
license - not found
-
quality - not tested

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.

  1. Features
    1. 🔍 Full-Text Search
    2. 🧠 Vector Similarity Search (Optional)
    3. 📊 Advanced Analytics
    4. 🛠 Management Tools
  2. Installation
    1. Quick Start
      1. Configuration
        1. Environment Variables
        2. MCP Server Configuration
      2. Available Tools
        1. Core Search Tools
        2. Management Tools
        3. Vector Search Tools (Requires OpenAI API Key)
      3. Usage Examples
        1. Basic Text Search
        2. Semantic Search
        3. Hybrid Search
        4. Project-Specific Search
      4. Database Schema
        1. Performance
          1. Vector Search Costs
            1. Contributing
              1. License
                1. Support

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/cordlesssteve/conversation-search-mcp'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server