history-search
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@history-searchfind where we decided the cache layout, show the context, and cite the source"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
history-search
English | 繁體中文
A local, read-only MCP server that lets Claude Code, Codex and other MCP clients search your past conversations: Claude Code and Codex sessions, Gemini CLI sessions, a ChatGPT data export and your own markdown notes, all in one SQLite database. Every result points back to the exact source: file and line for JSONL, JSON pointer and conversation URL for ChatGPT.
No model, no embeddings, no API key, no network port. Original files are never modified.
Install
Requires Python 3.11+ and uv.
git clone https://github.com/tenplus1000/history-search.git
cd history-search
uv sync
cp sources.example.json sources.json # then edit the paths
.venv/bin/python import_history.py # first import can take a whileRelated MCP server: agent-history-mcp
Connect it
Claude Code:
claude mcp add --scope user history-search -- /path/to/history-search/.venv/bin/python /path/to/history-search/server.pyCodex (~/.codex/config.toml):
[mcp_servers.history-search]
command = "/path/to/history-search/.venv/bin/python"
args = ["/path/to/history-search/server.py"]Then ask in a conversation, for example: "Use history-search to find where we decided the cache layout, read the context around it and cite the source."
Tools
Tool | What it does |
| Literal keyword search. Space-separated terms must all appear in one ~6000-character passage; quote phrases. Filters: |
| Messages around a hit. ChatGPT follows the branch the hit is on and stops at forks. |
| Full text of one message, paged. |
| Platform, title, date, original id, file and line / JSON pointer, URL when known. |
| What is imported and when. |
| Imports changed source files. Only the database is written. |
Tool calls and reasoning are excluded from search unless include_tools is set.
Sources
sources.json lists where to read from. Each entry has a provider, a path and a glob:
Provider | Reads |
| Claude Code |
| Codex |
| Gemini CLI |
|
|
any other name | Markdown files, split at |
Optional keys for markdown sources: exclude (folder names to skip), project, timezone (used for
dates taken from file names such as 20260413_101500.md, default UTC), speakers (extra **Name**
labels and their role) and provider_from_subfolder (treat <path>/claude/... as provider claude).
See sources.example.json.
Imports are incremental per file. When a source file is deleted, what was imported from it stays in the database. The database can always be rebuilt from the sources.
Search notes
Terms of three or more characters use an FTS5 trigram index.
Two-character Chinese, Japanese or Korean terms use a separate bigram index, so
記憶is as fast as記憶整理. Other one- and two-character terms fall back to a scan.Search is literal, not semantic: if nothing comes back, try other words.
Tests
.venv/bin/python -m unittest -v test_history
.venv/bin/python smoke_mcp.py --query <a word in your archive>License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Read-only search of your Sortio knowledge graph (files and entities) for Claude and ChatGPT.
Personal context for every AI: search, read, and write back to your private Markdown library.
Related MCP Servers
- AlicenseAqualityDmaintenanceSemantic search across Claude Code conversations. Hybrid vector + keyword search, fully local, background indexing.625 npm11MIT
- AlicenseNot gradedqualityDmaintenanceLocal memory search for Codex and Claude Code conversations. It keeps history on your machine, builds a local graph index, and returns compact evidence from past sessions.6MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to search and retrieve from a local knowledge base of markdown notes using hybrid semantic+keyword search, keeping data entirely offline.10 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to search and retrieve past coding-tool conversations across Claude Code, Claude Desktop, Codex, and Cursor through a local, read-only index.2MIT