io.github.egoughnour/cowork-history
编码与调试by egoughnour
为 Cowork 历史记录提供混合搜索,结合 FTS、Spotlight 与 semantic vectors,提升检索准确性。
什么是 io.github.egoughnour/cowork-history?
为 Cowork 历史记录提供混合搜索,结合 FTS、Spotlight 与 semantic vectors,提升检索准确性。
README
Cowork History MCP
<!-- mcp-name: io.github.egoughnour/cowork-history -->An MCP (Model Context Protocol) server for searching and browsing your Claude conversation history stored in ~/.claude/. Works with both Claude Code and Cowork conversations.
Features
- Hybrid Search - Combines multiple search methods for best results:
- SQLite FTS5 - Fast full-text search with BM25 ranking
- macOS Spotlight - Leverages system content indexing via
mdfind - Vector Embeddings - Semantic similarity search (optional, requires Ollama)
- Smart Path Reconstruction - Recovers actual filesystem paths via probing (not heuristic guessing)
- Persistent Index - SQLite database with incremental updates for fast queries
- Ollama Setup Tools - Automated installation and configuration for embeddings
Installation
Option 1: Claude Desktop (One-Click Install)
Download cowork-history.mcpb from the latest release and double-click to install.
Option 2: Via uvx (Recommended for CLI)
uvx cowork-history
Option 3: Via pip
pip install cowork-history
Option 4: Manual Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"cowork-history": {
"command": "uvx",
"args": ["cowork-history"],
"env": {
"OLLAMA_URL": "http://localhost:11434",
"EMBEDDING_MODEL": "nomic-embed-text"
}
}
}
}
Quick Start
Once installed, Claude can search your conversation history:
"What did we discuss about authentication last week?"
"Find the conversation where we debugged the payment webhook"
"Show me my conversations in the my-project folder"
Available Tools
Search & Browse
| Tool | Description |
|---|---|
cowork_history_search | Search conversations using hybrid search (FTS + Spotlight + vector) |
cowork_history_list | List recent conversations, optionally filtered by project |
cowork_history_get | Get full content of a specific conversation by session ID |
cowork_history_projects | List all projects with conversation history |
cowork_history_stats | Get statistics and search capability status |
cowork_history_reindex | Rebuild index and optionally generate embeddings |
Ollama Setup (for Vector Search)
| Tool | Description |
|---|---|
history_system_check | Check system requirements for Ollama |
history_setup_ollama | Install Ollama via Homebrew (macOS) |
history_setup_ollama_direct | Install Ollama via direct download (no Homebrew) |
history_ollama_status | Check Ollama status and embedding model availability |
Search Modes
The cowork_history_search tool supports multiple search modes:
| Mode | Description |
|---|---|
auto (default) | Uses all available methods, best results |
fts | Full-text search only (fastest) |
spotlight | macOS Spotlight only |
vector | Semantic similarity only (requires Ollama) |
hybrid | Explicit combination with ranking |
Search Examples
"authentication bug" → finds conversations with both words
"how to deploy" → semantic search finds related discussions
"\"exact phrase\"" → exact phrase matching
project:"my-app" "database" → filter by project
Enabling Vector Search
Vector search provides semantic similarity matching (finding related concepts even without exact keywords). It requires Ollama with an embedding model.
Quick Setup
Ask Claude to set it up for you:
"Set up Ollama for vector search"
Or manually:
# Install Ollama (macOS)
brew install ollama
# Start Ollama service
brew services start ollama
# Pull the embedding model
ollama pull nomic-embed-text
Then generate embeddings:
"Rebuild the history index with embeddings"
How It Works
Indexing
The server maintains a SQLite database at ~/.claude/.history-index/conversations.db with:
- FTS5 virtual table for fast full-text search
- Conversation metadata (session ID, project, timestamps, topic)
- Full content for comprehensive search
- Path cache for reconstructed paths
- Embeddings table for vector search (optional)
The index updates automatically when you search (if >5 minutes old) or you can force a rebuild with cowork_history_reindex.
Environment Variables
| Variable | Default | Description |
|---|---|---|
OLLAMA_URL | http://localhost:11434 | Ollama server URL |
EMBEDDING_MODEL | nomic-embed-text | Ollama embedding model |
Troubleshooting
No conversations found
- Make sure
~/.claude/directory exists - Check that you have conversation history (use Claude Code or Cowork first)
- Verify the MCP server is properly configured
Vector search not available
- Check Ollama is installed:
ollama --version - Check Ollama is running:
curl http://localhost:11434/api/tags - Check model is available:
ollama list - Pull embedding model:
ollama pull nomic-embed-text
Search not finding expected results
- Try natural language queries (semantic search is more flexible)
- Use
mode: "fts"for exact phrase matching - Check
cowork_history_statsto see which search backends are active
Development
Running locally
# Clone the repository
git clone https://github.com/egoughnour/cowork-history
cd cowork-history
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest tests/
# Run the server directly
python -m src.cowork_history_server
Testing with MCP Inspector
npx @modelcontextprotocol/inspector uvx cowork-history
License
MIT License - see LICENSE file for details.
常见问题
io.github.egoughnour/cowork-history 是什么?
为 Cowork 历史记录提供混合搜索,结合 FTS、Spotlight 与 semantic vectors,提升检索准确性。
相关 Skills
网页构建器
by anthropics
面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。
✎ 在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。
前端设计
by anthropics
面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。
✎ 想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。
网页应用测试
by anthropics
用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。
✎ 借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。
相关 MCP Server
GitHub
编辑精选by GitHub
GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。
✎ 这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。
Context7 文档查询
编辑精选by Context7
Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。
✎ 它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。
by tldraw
tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。
✎ 这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。