coding-session-history-mcp
Provides tools to search and retrieve local OpenAI Codex conversation history, including finding messages by keyword, project directory, date, and role, listing sessions, and expanding exact message references with nearby context.
Click on "Install 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., "@coding-session-history-mcpSearch my coding history for when I chose SQLite and show the supporting messages."
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.
Coding Session History MCP
Search your local OpenAI Codex conversation history from an MCP client. Find a past decision, locate the session where it happened, and retrieve the exact supporting messages.
The server indexes selected user and assistant messages into a local SQLite database. Your original Codex files remain untouched. Indexing and search use no embedding service or external API; connecting a client lets that client retrieve the history you selected.
What it does
Search messages by keywords, recorded project directory, date and role.
List sessions and expand exact search hits, including nearby messages.
Refresh the index independently of the MCP server.
Restrict exposure to selected projects, sessions or physical rollout files.
Replace configured sensitive text before it enters the index.
Connect local MCP clients over stdio, or ChatGPT through an authenticated tunnel.
Related MCP server: Codex Native Memory
Install
Install with Homebrew on macOS:
brew install lstpsche/tap/coding-session-history-mcp
coding-session-history --helpThe tap manages Node and the native SQLite dependency. Run coding-session-history setup --repo /absolute/path/to/your/project after installation. Installation does not index history or start a service.
For a manual tarball installation:
Requires Node.js 24 or later and npm. Check with node --version and npm --version. macOS is tested, including automatic startup through launchd. Linux and Windows have not been qualified for this release; the commands below use a POSIX shell.
Download coding-session-history-mcp-1.1.0.tgz from GitHub Releases, then run these commands from the folder containing the download. No repository checkout or global npm permissions are needed:
csh_install="$HOME/.local/share/coding-session-history-runtime"
npm install --prefix "$csh_install" \
./coding-session-history-mcp-1.1.0.tgz
csh_cli="$csh_install/node_modules/coding-session-history-mcp/dist/cli.js"
node "$csh_cli" --helpFor command-line downloads, use gh release download v1.1.0 --repo lstpsche/coding-session-history-mcp --pattern coding-session-history-mcp-1.1.0.tgz with the GitHub CLI.
The package includes compiled JavaScript; npm installs its dependencies. It is distributed through GitHub, not the npm registry. If the native better-sqlite3 dependency cannot install, use a supported Node LTS release and check npm's build diagnostic. A native build may require a C/C++ compiler and Python; macOS users can install Apple's Command Line Tools with xcode-select --install.
First run
The setup command creates a project policy, builds the initial index and prints ready-to-paste MCP configuration. With Homebrew, run:
coding-session-history setup --repo /absolute/path/to/your/projectFor a tarball installation, use node "$csh_cli" setup --repo /absolute/path/to/your/project. From a source checkout, use node dist/cli.js setup --repo /absolute/path/to/your/project.
Use the exact project working directory recorded by Codex. Setup reads CODEX_HOME or ~/.codex, creates an owner-readable policy beside the default index, and reports the session/message counts. It prints the MCP configuration to stdout and a ready-to-run background refresh command to stderr. Copy the configuration into your MCP client, then run the refresh command in another terminal.
Setup can be rerun for the same project and preserves existing literal redaction settings. It refuses to replace a policy selecting another scope. Use a separate --db /absolute/private/directory/index.sqlite for a separate project, or manage a custom policy with index. Failed indexing produces an error without printing successful client configuration. Zero matching sessions are reported explicitly; check the recorded working directory.
Connect an MCP client
Merge the JSON printed by setup with your client's existing MCP configuration, then restart or reconnect that client. The configuration includes absolute Node, CLI and database paths. serve waits for MCP requests over stdio; it is not an interactive terminal application.
Clients must support structured results in structuredContent. Confirm all four tools below are available, then try: “Search my coding history for the SQLite decision, then expand the exact message that supports it.”
For ChatGPT, follow the tunnel setup guide. Account and tunnel authorization remain separate from local setup. For custom policy files, redaction and physical rollout selection, see the reference.
Keep history up to date
serve reads the index; it does not refresh it. Use the exact refresh command printed by setup. For a manual packaged installation with the variables from that guide, run:
node "$csh_cli" watch --source "$csh_source" \
--policy "$csh_data/policy.json" --db "$csh_data/index.sqlite"The writer waits 15 seconds between refreshes. Stop it with Ctrl-C. Check status and its indexed_at timestamp to confirm freshness. A failed or interrupted refresh blocks retrieval until a successful refresh; the next writer attempt retries. Policy edits also block retrieval until reindexing succeeds.
For automatic startup, upgrades and removal, see the macOS service guide.
Tools
Tool | Purpose |
| Find messages with lexical AND search; filter by project, dates or role |
| Browse session metadata with pagination |
| Get a session overview and its starting message cursor |
| Expand exact references, nearby messages and long-message continuations |
Start searches with one to three distinctive terms. Every term must occur in the same message; a full question often produces no matches. Empty results do not establish absence. Search results contain revision-bound references for exact expansion. Complete tool results are capped at 64 KiB, with continuation for longer content.
Privacy and limits
Only canonical user/assistant text is indexed. Tool outputs, system/developer messages, reasoning and images are excluded. The source is read-only, and the derived database is created with owner-only permissions. Remote tools cannot widen the local policy.
Returned history is untrusted data, not instructions. Redaction applies only to exact configured text literals; it does not redact session metadata or erase copies already returned to clients. Removing content from the index is not secure deletion of old SQLite pages or backups.
The Codex rollout format can change. Unsupported legacy records, conflicting session metadata and duplicate physical owners fail explicitly. Rewrites invalidate old message references. Schema/parser incompatibility requires rebuilding into a new database path, preserving the original database. See the complete retrieval and storage contract.
Development
git clone https://github.com/lstpsche/coding-session-history-mcp.git
cd coding-session-history-mcp
npm ci
npm run check
npm run benchmark -- --source test/fixtures --cases test/fixtures/retrieval-cases.json
npm packTests use synthetic history and cover ingestion, crash recovery, policy boundaries, Unicode continuation and real MCP transports. Keep private rollouts, policies and databases out of Git. Please include a synthetic reproduction when reporting a bug through GitHub Issues. Pull requests are welcome; run npm run check before submitting.
License
MIT © 2026 Nikita Shkoda.
This project is independent and is not affiliated with or endorsed by OpenAI.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Persistent memory for AI agents — log and recall conversation context over MCP.
Hosted MCP memory: save sessions/decisions once, search from Claude, Cursor, ChatGPT. EU-hosted FTS.
Read-only MCP access to authorized Vocci sessions, notes, files, and memory search.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables searching and analyzing GitHub Copilot's conversation history stored locally, providing tools for full-text search, session listing, statistics, and file-based retrieval.64MIT
- AlicenseBqualityAmaintenanceProvides local cross-session memory for Codex by importing transcripts, indexing in SQLite, and exposing search, context, and memory management through MCP tools.13MIT
- AlicenseNot gradedqualityBmaintenanceEnables searching and retrieving local chat history from Codex and Claude CLI sessions via BM25 full-text search and MCP tools.2MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for unified full-text search across chat histories from Claude Code, Codex, Cursor CLI, and Antigravity CLI, using SQLite FTS5. Provides read-only tools to search sessions, list conversations, and retrieve session details.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lstpsche/coding-session-history-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server