Cowork History

io.github.egoughnour由 GitHub 账号 egoughnour 发布v4.0.3更新于 Oct 27, 2026

Hybrid search for Cowork history: FTS, Spotlight, and semantic vectors

已验证STDIO仅桌面文件与存储知识与记忆

概览

AI 生成的概览

通过全文、Spotlight 和可选的语义向量检索,搜索和浏览本机的 Claude Code 与 Cowork 对话历史。

可以做什么
  • 以混合、全文、Spotlight 或向量模式搜索对话,支持按项目过滤和精确短语匹配
  • 列出最近的对话(可按项目筛选),并列出所有有历史记录的项目
  • 按会话 ID 读取某个对话的完整内容
  • 查看索引统计信息和当前可用的搜索后端
  • 重建索引,并可选生成向量嵌入
  • 检查、安装并配置用于向量搜索的 Ollama
适用场景
适合让助手回忆此前 Claude Code 或 Cowork 会话中讨论过的内容、找回某次调试过程,或按项目回顾历史对话,而无需手动逐个打开。
运行要求
以 stdio 本地进程运行,可通过 uvx、pip 或 Claude Desktop 安装包安装;偏向 macOS(使用 mdfind 的 Spotlight、可选 Homebrew 安装)。需要已存在含对话历史的 ~/.claude/ 目录。向量搜索还需运行中的 Ollama 服务,通过 OLLAMA_URL 和 EMBEDDING_MODEL 配置。
安装前请注意
它会读取 ~/.claude/ 下保存的对话历史并在该目录建立 SQLite 索引,助手可能因此显示含密钥或私有代码的旧对话。安装工具可通过 Homebrew 或直接下载安装 Ollama 并将其作为服务启动。向量搜索会把对话文本发送到所配置的 Ollama 端点,默认是本机地址。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Cowork History,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Cowork History MCP

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:

"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

"authentication bug"           → finds conversations with both words"how to deploy"                → semantic search finds related discussions"\"exact phrase\""             → exact phrase matchingproject:"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:

bash
# Install Ollama (macOS)brew install ollama
# Start Ollama servicebrew services start ollama
# Pull the embedding modelollama 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

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 repositorygit clone https://github.com/egoughnour/cowork-historycd cowork-history
# Install in development modepip install -e ".[dev]"
# Run testspytest tests/
# Run the server directlypython -m src.cowork_history_server

Testing with MCP Inspector

bash
npx @modelcontextprotocol/inspector uvx cowork-history

License

MIT License - see LICENSE file for details.

来源:README.md,提交 270013b

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v4.0.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分