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 分