Skip to main content
Glama
ilovecat1005

mcp-server-chat-history

by ilovecat1005

mcp-server-chat-history

把你的 ChatGPT / Claude 匯出檔變成 MCP server。設定好之後,Claude 可以直接用工具呼叫搜尋、翻閱你過去和 AI 的全部對話——「我去年問過怎麼寫 regex」這種問題,讓 AI 自己去翻。

本機執行,只讀取你指定的檔案,没有網路請求。

提供的工具

工具

說明

search_history

全文搜尋所有對話,回傳命中片段(可只搜你送出的訊息)

list_conversations

列出對話標題、時間、訊息數

read_conversation

依標題讀出完整對話內容

支援 ChatGPT 與 Claude 官方匯出的 conversations.json,自動偵測格式。

Related MCP server: recall

安裝與設定

先從官方匯出對話:

  • ChatGPT:設定 → Data controls → Export data

  • Claude:設定 → Privacy → Export data

解壓縮後記下 conversations.json 的路徑,然後擇一設定:

Claude Code

claude mcp add chat-history -- uvx --from "git+https://github.com/ilovecat1005/mcp-server-chat-history" mcp-server-chat-history --file /path/to/conversations.json

Claude Desktop(claude_desktop_config.json)

{
  "mcpServers": {
    "chat-history": {
      "command": "uvx",
      "args": [
        "--from", "git+https://github.com/ilovecat1005/mcp-server-chat-history",
        "mcp-server-chat-history",
        "--file", "/path/to/conversations.json"
      ]
    }
  }
}

需要先裝好 uv。不想用 uv 的話,pipx install "mcp-server-chat-history @ git+https://github.com/ilovecat1005/mcp-server-chat-history" 之後把 command 換成 mcp-server-chat-history 也可以。

已知限制

  • 匯出檔是快照:新對話不會自動出現,重新匯出後重啟 server 即可

  • 大型匯出檔(幾萬則訊息)啟動解析約需數秒

  • 只支援官方匯出格式

開發

python3 -m unittest discover -s tests -v

原始碼結構:history.py 是純邏輯(解析、搜尋),server.py 只是把三個函式接上 MCP 協定。

授權

MIT

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Enables searching and browsing of Claude conversation history with hybrid search combining full-text, Spotlight, and optional vector embeddings.
    10
    24 PyPI
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude to search through its own past sessions using full-text search and resume them. Works offline with zero runtime dependencies.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables Claude to search locally indexed exported chat history and project docs, retrieving full messages and conversation IDs via full-text search.
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI assistants to semantically search your entire local conversation history from Claude Desktop, ChatGPT and Claude Code, and to retrieve, browse, ingest and report on those conversations. All embeddings run locally, so no cloud, API keys, or data leave your machine.
    2
    MIT