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)

bash
uvx cowork-history

Option 3: Via pip

bash
pip install cowork-history

Option 4: Manual Configuration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

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:

code
"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

ToolDescription
cowork_history_searchSearch conversations using hybrid search (FTS + Spotlight + vector)
cowork_history_listList recent conversations, optionally filtered by project
cowork_history_getGet full content of a specific conversation by session ID
cowork_history_projectsList all projects with conversation history
cowork_history_statsGet statistics and search capability status
cowork_history_reindexRebuild index and optionally generate embeddings

Ollama Setup (for Vector Search)

ToolDescription
history_system_checkCheck system requirements for Ollama
history_setup_ollamaInstall Ollama via Homebrew (macOS)
history_setup_ollama_directInstall Ollama via direct download (no Homebrew)
history_ollama_statusCheck Ollama status and embedding model availability

Search Modes

The cowork_history_search tool supports multiple search modes:

ModeDescription
auto (default)Uses all available methods, best results
ftsFull-text search only (fastest)
spotlightmacOS Spotlight only
vectorSemantic similarity only (requires Ollama)
hybridExplicit combination with ranking

Search Examples

code
"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:

code
"Set up Ollama for vector search"

Or manually:

bash
# 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:

code
"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

VariableDefaultDescription
OLLAMA_URLhttp://localhost:11434Ollama server URL
EMBEDDING_MODELnomic-embed-textOllama embedding model

Troubleshooting

No conversations found

  1. Make sure ~/.claude/ directory exists
  2. Check that you have conversation history (use Claude Code or Cowork first)
  3. Verify the MCP server is properly configured

Vector search not available

  1. Check Ollama is installed: ollama --version
  2. Check Ollama is running: curl http://localhost:11434/api/tags
  3. Check model is available: ollama list
  4. 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_stats to see which search backends are active

Development

Running locally

bash
# 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

bash
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

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

评论