io.github.TonySimonovsky/claude-code-conversation-search-mcp

编码与调试

by tonysimonovsky

可在所有项目中用自然语言搜索 Claude Code 的对话历史,快速定位相关讨论与上下文。

什么是 io.github.TonySimonovsky/claude-code-conversation-search-mcp

可在所有项目中用自然语言搜索 Claude Code 的对话历史,快速定位相关讨论与上下文。

README

Claude Code Conversation Search MCP

Stop losing your Claude Code conversations. Never again ask "where did we discuss that bug fix?" or lose hours of context when your terminal closes.

bash
npm install -g claude-code-conversation-search-mcp

Find any conversation across all projects:

bash
"where did we discuss the database issue?"
"find that authentication conversation"
"docker configuration we talked about yesterday"

Get the exact project, date, and command to resume instantly.

Why You Need This

The Problem: Claude Code has no conversation search. When you close a terminal or switch projects, finding that important discussion becomes impossible. You're left scrolling through cryptic conversation titles hoping to recognize the right one.

The Solution: Search all your Claude Code conversations from any project session. Ask "where did we discuss authentication?" and instantly get the exact conversation with a resume command.

Features

  • Find lost conversations: Never lose track of important discussions again
  • Search across all projects: Working in Project A but need info from Project B? Just search
  • Resume instantly: Get exact claude --resume commands to continue where you left off
  • Natural language: Ask questions like you would a human - "find that Docker conversation"
  • Lightning fast: Search thousands of conversations in milliseconds
  • Zero setup: Install and it works immediately with your existing Claude Code

Quick Start

Install and it auto-configures with Claude Code:

bash
npm install -g claude-code-conversation-search-mcp

Search across all projects while working in any project.

🎯 Recommended: Enhanced Claude Code Integration

For optimal search results and better Claude Code interaction, add these instructions to your global ~/.claude/CLAUDE.md file:

bash
# Add to ~/.claude/CLAUDE.md
echo "- When asked to use conversation-search, you must start searching from very wide queries, narrowing down step by step. When responding based on this mcp results output a human readable text with proper newlines instead of formatting json." >> ~/.claude/CLAUDE.md

Why this helps:

  • Better search strategy: Claude will start with broad queries and progressively narrow down, finding more relevant results
  • Human-readable output: Instead of raw JSON, you'll get properly formatted responses with project paths, dates, and resume commands
  • Improved UX: Makes conversation search feel natural and intuitive within Claude Code workflows

Usage

bash
# Find lost conversations
"where did we discuss the login bug?"
"find that Docker conversation"
"database setup we talked about"

# Search by what you remember
"authentication error we fixed"
"API endpoint discussion yesterday"
"performance issue last week"

# Find solutions from other projects  
"how did we solve CORS issues?"
"Redis configuration that worked"
"deployment script we wrote"

Every search gives you:

  • Which project the conversation was in
  • When it happened (date and time)
  • What you discussed (conversation summary)
  • Smart shortcuts to resume: cd ~/.cs/project-name && claude --resume abc123

Smart Directory Shortcuts

The search automatically creates directory shortcuts for faster navigation:

  • Cross-platform: Works on macOS, Linux, and Windows
  • Short paths: Uses ~/.cs/ instead of long project paths
  • Real directories: Creates actual symlinks/junctions you can cd into
  • Project-based names: Uses meaningful names like poc-fbf-v023-1-cc
  • Automatic creation: Generated on-demand during search

Example:

bash
# Instead of:
cd '/Users/username/very/long/path/to/project'

# You get:
cd ~/.cs/project-name

Technical

Built with TypeScript, uses SQLite FTS5 for search, integrates via Model Context Protocol.

System requirements:

  • Node.js 18+
  • Claude Code with MCP support
  • macOS, Linux, or Windows

Performance:

  • Sub-second search across 10k+ conversations
  • Real-time indexing with file watching
  • Minimal memory footprint (~50MB)

Storage:

  • SQLite database in ~/.claude/conversation-search/
  • Indexes conversation content, not file contents
  • Automatic cleanup of deleted conversations

Installation

From source

bash
# Clone the repository
git clone https://github.com/TonySimonovsky/claude-code-conversation-search-mcp.git
cd claude-code-conversation-search-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Optional: Link globally
npm link

Configuration

Automatic Setup (Recommended)

After installation, the MCP server auto-configures with Claude Code. No manual configuration needed!

Manual Configuration (Optional)

If you need custom configuration, choose one of these approaches:

Option 1: Command Line (Recommended)

bash
# Add globally for all projects
claude mcp add conversation-search claude-code-conversation-search-mcp

# Add for current project only (creates .mcp.json)
claude mcp add --scope project conversation-search claude-code-conversation-search-mcp

Option 2: Edit Configuration Files Directly

Global configuration (all projects):

bash
# Edit the global Claude Code config (run from anywhere)
nano ~/.claude.json
# Or use your preferred editor: code ~/.claude.json
json
{
  "mcpServers": {
    "conversation-search": {
      "command": "claude-code-conversation-search-mcp",
      "args": []
    }
  }
}

Project-specific configuration (team-shared):

bash
# Create project config file (run from project root)
nano .mcp.json
# Or: code .mcp.json
json
{
  "mcpServers": {
    "conversation-search": {
      "command": "claude-code-conversation-search-mcp",
      "args": []
    }
  }
}

Configuration Options

The MCP server supports extensive configuration through environment variables. Here are the most commonly used options:

Environment VariableDescriptionDefault
CONVERSATION_DB_PATHPath to SQLite database~/.claude/conversation-search.db
CLAUDE_PROJECTS_DIRPath to Claude projects directory~/.claude/projects
INDEX_INTERVALAuto-index interval in milliseconds300000 (5 minutes)
MAX_RESULTSMaximum search results to return20
DEFAULT_CONTEXT_SIZEDefault context messages before/after2
AUTO_INDEXINGEnable automatic indexingtrue
DEBUGEnable debug loggingfalse

📖 For complete configuration options and performance tuning, see Configuration Guide

Usage

Once configured, the following tools are available in Claude Code:

Search Conversations

Search through your conversation history with natural language:

code
search_conversations("Where did we create auth.js?")
search_conversations("database optimization last week")
search_conversations("TypeError in index.ts")

Query Examples:

  • File operations: "created auth.js", "edited config.json", "modified database.ts"
  • Topics: "discuss React hooks", "security review", "performance optimization"
  • Errors: "TypeError", "CORS error", "undefined variable"
  • Commands: "npm install lodash", "git commit", "database migration"
  • Time filters: "today", "yesterday", "last week", "this month"
  • Project filters: "in project myapp", "from backend-api"

Parameters:

  • query (required): Natural language search query
  • limit (optional): Maximum results to return (default: 10)
  • includeContext (optional): Include surrounding messages (default: true)

List Projects

Get all indexed projects with statistics:

code
list_projects()

Returns project names, message counts, and last activity dates.

Get Message Context

Retrieve full context around a specific message:

code
get_message_context("msg_abc123", contextSize: 5)

Parameters:

  • messageId (required): The message ID to get context for
  • contextSize (optional): Number of messages before/after (default: 5)

Get Conversation Messages

Retrieve messages from a specific conversation:

code
get_conversation_messages("conv_456", limit: 50, startFrom: 0)
get_conversation_messages("conv_456", limit: 10, startFrom: -1)  # Last 10 messages
get_conversation_messages("conv_456", limit: 20, startFrom: -10) # 20 messages starting from 10th from end

Parameters:

  • conversationId (required): The conversation ID to get messages from
  • limit (optional): Number of messages to return (default: 50)
  • startFrom (optional): Starting position - 0=first, -1=last, -10=10th from end (default: 0)

List Tools

Show all available tools with their signatures:

code
list_tools()

Returns automatically generated tool signatures and descriptions. Updates automatically when new tools are added.

Refresh Index

Manually trigger re-indexing:

code
refresh_index()

Useful after adding new projects or when auto-indexing is disabled.

Get Server Information

Show server version, changelog, and system information:

code
get_server_info()

Displays current version, recent changes, system status, and available tools.

Advanced Usage

Complex Queries

Our built-in query parser supports sophisticated natural language patterns:

code
# Find specific file operations
"Where did we create or modify authentication files?"

# Search by multiple criteria
"database migrations in project backend last week"

# Find specific error patterns
"TypeError or ReferenceError in React components"

# Search tool operations
"bash commands containing npm or yarn"

# Find code discussions
"Where did we discuss implementing caching?"

Search Operators

  • AND: Terms are ANDed by default ("auth login" finds messages with both)
  • OR: Use "or" between terms ("auth or login")
  • NOT: Use "-" prefix ("auth -test" excludes test-related results)
  • Phrase: Use quotes for exact phrases ("user authentication")
  • Wildcard: Use * for prefix matching ("auth*" matches auth, authentication, etc.)

Time Filters

Supported time expressions:

  • today, yesterday
  • last week, this week
  • last month, this month
  • last 7 days, last 30 days
  • Specific dates: "on 2024-01-15", "since January 1"

Development

Setup Development Environment

bash
# Clone and install
git clone <repository>
cd claude-code-conversation-search-mcp
npm install

# Run in development mode with hot reload
npm run dev

# Run tests
npm test

# Build for production
npm run build

Project Structure

code
src/
├── index.ts              # MCP server entry point
├── indexer/
│   ├── parser.ts        # JSONL conversation parser
│   ├── database.ts      # SQLite database operations
│   └── indexer.ts       # Indexing orchestration
├── search/
│   └── query.ts         # Natural language query parser
└── types/
    └── index.ts         # TypeScript type definitions

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Troubleshooting

Database Issues

If the search index becomes corrupted:

bash
# Remove the database file
rm ~/.claude/conversation-search.db

# Restart Claude Code to trigger re-indexing

Performance Optimization

For large conversation histories:

  1. Increase INDEX_INTERVAL to reduce indexing frequency
  2. Set MAX_RESULTS to limit result size
  3. Use specific project filters in queries

Debug Mode

Enable debug logging to troubleshoot issues:

json
{
  "mcpServers": {
    "conversation-search": {
      "command": "npx",
      "args": ["claude-code-conversation-search-mcp"],
      "env": {
        "DEBUG": "true"
      }
    }
  }
}

License

MIT License - see LICENSE file for details

Acknowledgments

Built using the Model Context Protocol SDK by Anthropic.

Credits

Developed by Tony AI Champ & Claude Code, 09-2025

Support

For issues, feature requests, or questions:

  • Open an issue on GitHub
  • Check existing issues for solutions
  • Include debug logs when reporting bugs

常见问题

io.github.TonySimonovsky/claude-code-conversation-search-mcp 是什么?

可在所有项目中用自然语言搜索 Claude Code 的对话历史,快速定位相关讨论与上下文。

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论