RepoChatMCP
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., "@RepoChatMCPsearch for authentication implementation in recent chats"
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.
RepoChatMCP
Search Claude Code and Codex chat history like source code.
RepoChatMCP is a zero-dependency MCP server and CLI for searching local Claude Code and Codex session files. It normalizes both providers into one message model, exposes search and read tools over MCP, and can optionally build a persisted repository knowledge index from your chat history.
No database. No background service. No telemetry. Just your local JSONL session files.
Why Use It
Search Claude Code and Codex history from one MCP server
Read sessions by message range or lines around a match
Grep chats with AND, OR, and regex patterns
Build repo knowledge summaries from prior chats
Run locally with zero runtime dependencies
Related MCP server: engram-mcp
Package And Commands
Published npm package:
chat-search-mcpInstalled CLI commands:
chat-searchandchat-search-mcpRuntime requirement: Node.js 22+
Install
Use the published npm package
Install it first:
npm install -g chat-search-mcp@latestThen use it:
chat-search status --repo /path/to/repo
chat-search search "authentication" --repo /path/to/repoUse the local repo checkout
git clone https://github.com/gzmagyari/RepoChatMCP.git
cd RepoChatMCP
npm install
node ./bin/chat-search.js status --repo .Claude Code Setup
Project MCP from a local checkout
Use this when you cloned the repo and want Claude Code to run the local source directly:
{
"mcpServers": {
"chat-search": {
"type": "stdio",
"command": "node",
"args": ["./bin/chat-search.js"]
}
}
}Claude Code runs project MCPs from the repo directory, so ./bin/chat-search.js works and the current repo becomes the default target.
Use the published npm package
Install it first:
npm install -g chat-search-mcp@latestmacOS / Linux:
{
"mcpServers": {
"chat-search": {
"type": "stdio",
"command": "chat-search-mcp",
"args": ["mcp"]
}
}
}Windows:
{
"mcpServers": {
"chat-search": {
"type": "stdio",
"command": "cmd",
"args": ["/c", "chat-search-mcp", "mcp"]
}
}
}Codex Setup
Local checkout:
[mcp_servers.chat_search]
command = "node"
args = ["C:/path/to/RepoChatMCP/bin/chat-search.js"]Published npm package on Windows:
[mcp_servers.chat_search]
command = "cmd"
args = ["/c", "chat-search-mcp", "mcp"]CLI Quick Start
# MCP server
chat-search mcp --repo /path/to/repo
# Show discovered session counts
chat-search status --repo /path/to/repo
# Search across chats
chat-search search "jwt token" --repo /path/to/repoIf --repo is omitted, the current working directory is used.
MCP Tools
Tool | What it does |
| Lists discovered Claude Code and Codex sessions for the repo |
| Full-text search with relevance scoring |
| Pattern search with ` |
| Reads messages from a session by index range |
| Reads lines around a keyword or regex match |
| Returns metadata plus an absolute file path for live compaction knowledge |
| Starts async knowledge indexing and returns a job ID immediately |
| Returns progress, counts, and terminal state for a knowledge indexing job |
| Requests cancellation of a running knowledge indexing job |
| Lists persisted knowledge batches with canonical combined artifact paths |
| Reads paginated text from the latest persisted combined artifact |
| Reads paginated text from one persisted batch artifact |
| Lists per-chunk persisted knowledge files for one batch |
| Reads paginated text from one persisted per-chunk knowledge file |
| Searches persisted knowledge artifacts directly |
Example tool inputs
{ "query": "database pooling", "provider": "claude", "limit": 5 }{ "pattern": "authentication&jwt" }{ "sessionId": "8ac646f8-1bec-...", "startIndex": 0, "endIndex": 50 }{ "force": true }{ "provider": "codex", "limit": 10, "query": "database" }{ "jobId": "knowledge-job-20260403-080000000-abc123def0" }{ "batchId": "20260403-080000000-abc123def0", "kind": "knowledge", "offset": 0, "limit": 120 }{ "query": "billing webhook", "kind": "content_summary", "limit": 5 }Optional Knowledge Indexing
Knowledge indexing is disabled by default.
When disabled:
chat.compaction_knowledgereturns a live compaction snapshot file pathchat.start_knowledge_indexreturns a configuration message instead of starting a jobpersisted knowledge can still be read later if
.repochatmcp/knowledge/already exists
When enabled:
chat.start_knowledge_indexcreates an async indexing job instead of blocking the MCP callchat.get_knowledge_index_statusreports discovery counts, chunk progress, files written, and failureschat.read_latest_knowledgeandchat.read_knowledge_batchreturn actual paginated knowledge text, not just file pathschat.list_knowledge_files,chat.read_knowledge_file, andchat.search_knowledgelet agents inspect persisted chunk files directlycombined persisted batch artifacts are written under
.repochatmcp/knowledge/combined/.repochatmcp/is automatically added to the repo root.gitignore
Stored files:
.repochatmcp/knowledge/manifest.json.repochatmcp/knowledge/jobs/*.json.repochatmcp/knowledge/runs/*.md.repochatmcp/knowledge/combined/*.md
Indexing rules:
minimum 100 new or changed messages before indexing runs
split only when transcript size exceeds
CHAT_SEARCH_KNOWLEDGE_MAX_CHARSCodex chunk calls run sequentially
HTTP chunk calls run with limited concurrency
each chunk writes both a structured
knowledgefile and a plaincontent_summaryfilecombined batch artifacts are persisted so agents can read one canonical file per batch
Backends
off: disabledauto: prefer HTTP if API config is present, otherwise use Codex CLIhttp: OpenAI-compatible HTTP requestscodex: Codex CLI over stdin
MCP env config
{
"mcpServers": {
"chat-search": {
"type": "stdio",
"command": "cmd",
"args": ["/c", "chat-search-mcp", "mcp"],
"env": {
"CHAT_SEARCH_KNOWLEDGE_BACKEND": "http",
"CHAT_SEARCH_KNOWLEDGE_BASE_URL": "https://openrouter.ai/api/v1",
"CHAT_SEARCH_KNOWLEDGE_MODEL": "moonshotai/kimi-k2-0905@groq",
"CHAT_SEARCH_KNOWLEDGE_API_KEY": "your-api-key",
"CHAT_SEARCH_KNOWLEDGE_MAX_CHARS": "500000",
"CHAT_SEARCH_KNOWLEDGE_HTTP_CONCURRENCY": "3"
}
}
}
}Supported env vars:
CHAT_SEARCH_KNOWLEDGE_BACKEND=off|auto|http|codexCHAT_SEARCH_KNOWLEDGE_MODELCHAT_SEARCH_KNOWLEDGE_BASE_URLCHAT_SEARCH_KNOWLEDGE_API_KEYCHAT_SEARCH_KNOWLEDGE_MAX_CHARSCHAT_SEARCH_KNOWLEDGE_TIMEOUT_MSCHAT_SEARCH_KNOWLEDGE_CODEX_BINCHAT_SEARCH_KNOWLEDGE_HTTP_CONCURRENCY
OpenRouter provider pinning:
set
CHAT_SEARCH_KNOWLEDGE_BASE_URL=https://openrouter.ai/api/v1use
CHAT_SEARCH_KNOWLEDGE_MODEL=model@provider, for examplemoonshotai/kimi-k2-0905@groq@provideris only valid for the OpenRouter HTTP backend
Unified Message Model
Both Claude Code and Codex are normalized to:
{
provider: "claude" | "codex",
sessionId: "uuid-or-session-id",
index: 42,
timestamp: "2026-03-25T10:11:12.000Z",
type: "user" | "assistant" | "tool_call" | "tool_result" | "system" | "compaction",
role: "user" | "assistant" | "system" | "developer",
text: "message text"
}Where Sessions Are Read From
Claude Code:
~/.claude/projects/<encoded-repo-path>/*.jsonl
Codex:
~/.codex/sessions/<year>/<month>/<day>/*.jsonl~/.codex/archived_sessions/...
Configurable roots:
CHAT_SEARCH_CLAUDE_ROOTCHAT_SEARCH_CODEX_SESSIONSCHAT_SEARCH_CODEX_ARCHIVED
Development
npm testCurrent test suite: 79 tests covering discovery, normalization, search, MCP transport, async knowledge indexing jobs, direct persisted knowledge reads, and persisted knowledge indexing.
License
MIT
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.
Latest Blog Posts
- 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/gzmagyari/RepoChatMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server