
RelayHistory MCP Server: Setup for Claude Code, Cursor and Codex
Lets Claude, Cursor or Codex search your past coding-agent sessions and hand work to another agent.
RelayHistory's MCP server lets your assistant search the sessions you have run in Claude Code, Codex, Cursor, Grok, Muse Code, OpenCode and Devin CLI. It reads one local index on your computer, so an agent can look up what you asked and which files were changed. It runs on your machine with no account or API key, and it comes from AgentWorkforce, the team behind RelayHistory. Anything you ever typed into those tools becomes searchable, so check what you have pasted into old sessions.
Good for
- People who switch between Claude Code, Codex and Cursor and lose track of old sessions
- Developers who want an agent to look up what it or another agent did earlier
- Teams passing half-finished work from one agent to another
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install relayhistory MCP
Claude Code
- 1
Copy this prompt.
Add the relayhistory MCP server to Claude Code. Run this command: claude mcp add relayhistory -- npx -y ai-hist-mcp Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
Built from the package data we hold. Not yet tested by us.
Tools
Searches every past coding-agent session on your machine by keyword
Looks through your saved prompts and the assistant text, tool calls and results from past sessions, newest first. Plain words must all match. You can narrow by tool, project, tag, role or date.
Try: “Find the session where I rewrote the auth flow, and show the newest matches first.”
Read ·
search_historyLists your most recent prompts across all tools, newest first
Returns the latest prompts already saved in the index. You can filter by tool, project, tag or date range and page backwards.
Try: “Show my last 20 prompts across Claude Code and Codex.”
Read ·
recent_historyLists the sessions in your local index
Shows the catalog of sessions already indexed, filtered by tool. It never scans for new sessions or runs a sync.
Try: “List my ten most recent sessions in Cursor.”
Read ·
list_sessionsGets the prompts of one session
Returns the prompts saved for a single session. Pass a tool name when two tools reuse the same session id.
Try: “Get the prompts from that auth rewrite session.”
Read ·
get_sessionReads one page of a session's step-by-step events
Returns a page of normalized events for a session, such as assistant messages and tool activity. You continue from the last row to get the next page.
Try: “Show the first 50 events of that session.”
Read ·
get_session_eventsLists the tool calls a past session made
Returns one page of the tool calls recorded for a session, so you can see what the agent ran.
Try: “Which tools did my last Codex session call?”
Read ·
get_session_tool_callsLists the files a past session edited
Returns one page of the file edits recorded for a session.
Try: “Which files did yesterday's Claude Code session change?”
Read ·
get_session_file_editsShows the sub-agents a session started, as a tree
Builds the full tree of sessions that grew out of one session, following delegation by default. You can also include resumed, continued and forked sessions.
Try: “Show the sub-agent tree for this session.”
Read ·
get_session_treeShows which sessions a session spawned or came from
Lists direct links for one session: sessions it delegated to, the session that started it, and resume, fork and continuation links.
Try: “Which session was this one forked from?”
Read ·
get_session_relationshipsLists non-chat records such as compaction points
Returns a page of records a tool wrote that are not chat turns, such as compaction and summary boundaries, system rows and agent start and stop events.
Try: “Where did this session get compacted?”
Read ·
get_session_markersLists the model requests of a session with token usage
Returns one row per model request with usage normalized, so the numbers can be summed. Cost is shown only when the source data carried one.
Try: “How many requests did that session make, and how many tokens did each use?”
Read ·
get_session_requestsTotals the tokens one session used
Rolls up token usage for a session across tools. Missing usage is reported as missing, not as zero, and cost appears only if the source recorded it.
Try: “How many tokens did my last Codex session use?”
Read ·
get_session_usageShows how much history is indexed
Returns statistics about the history already in your index, optionally for one tag.
Try: “How much history do you have indexed, by tool?”
Read ·
history_statsSays what one tool's history can and cannot tell you
Reports which kinds of evidence RelayHistory can record for one tool, and what its records show about delegation. It answers before any sync.
Try: “What can you record from Cursor sessions?”
Read ·
get_source_capabilitiesRe-reads all your tools' session files into the index
Runs a full ingestion of session data from every supported tool into the local index. With a remote scope and a configured source plugin it can also reach provider services.
Try: “Sync my agent history so search is up to date.”
Write ·
syncScans for new sessions and adds them to the catalog
Finds sessions quickly and updates only the session catalog, without indexing their full content. A remote scope needs a configured source plugin.
Try: “Check for new sessions from Codex and Cursor.”
Write ·
discover_sessionsIndexes one session in full
Loads a single cataloged session as deeply as its tool allows, without a global sync. Tools that record only prompts come back marked partial.
Try: “Index the full content of that Codex session.”
Write ·
hydrate_sessionMakes a pointer so another agent can pick up this session
Builds a handoff pointer for your current session. Its intent field is a ready-made prompt that tells the receiving agent to resume the session and carry on. It may add the session to the local catalog.
Try: “Create a handoff for this session so a teammate's agent can finish the migration.”
Write ·
create_handoffLoads a handed-off session so you can continue it
Fetches a session from a handoff pointer in your own workspace and returns its prompts, events, tool calls and file edits. Handoffs from other workspaces or organizations are rejected.
Try: “Resume the handoff my teammate sent and continue the work.”
Write ·
resume_handoffLists agents that are live on Agent Relay
Shows live participants on Agent Relay, not session history. It reads only the local Agent Relay desktop app and needs no cloud credential.
Try: “Who is on Agent Relay right now?”
Read ·
list_relay_agentsChecks whether this session is reachable on Agent Relay
Reports whether the session running this server is registered and reachable on Agent Relay.
Try: “Am I reachable on Agent Relay?”
Read ·
relay_statusMakes this session reachable by teammates and agents
Puts the session running this server on Agent Relay. The optional name and description you give are public relay metadata.
Try: “Join Agent Relay as 'billing-refactor'.”
Write ·
join_relayTakes this session off Agent Relay
Removes the session running this server from Agent Relay.
Try: “Leave Agent Relay.”
Write ·
leave_relay
Read from the source code
Permissions
medium risk · 5 things to watch
Medium risk
The server can read the full history of your coding-agent sessions and write to a local index, and a teammate-visible relay session if you use the join tool. Keep secrets out of your prompts, and leave Agent Relay off unless you want teammates or agents to reach your session.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
Everything you typed in past sessions is searchable
The index holds prompts, assistant text, tool calls and tool results from every supported tool. Anything pasted into an old session, such as a key, can come back in a search result and goes to your assistant's model provider. github.com
join_relay shows your session to teammates and agents
It puts your running session on Agent Relay, and the name and description you give are public. Use leave_relay or relay_status to undo and check it; the Agent Relay desktop app is required. github.com
sync and hydrate write to the local index
These tools read the session files of your other tools and store them in a SQLite database on your machine. With a remote scope and a source plugin they can also contact provider services. github.com
Remote connectors reuse existing sign-ins
The optional claude-web connector reads the Claude Code CLI's stored OAuth token. It only runs if you install and configure the provider-sources plugin. github.com
A handoff loads another agent's session into your chat
resume_handoff returns the full prompts and tool output of a session from your workspace. Our advice: treat that content as untrusted text, as you would any pasted document. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | No read-only switch is documented. Most tools are marked read-only in the source, but sync, discover, hydrate, handoff and the join and leave relay tools are not. |
|---|---|
| Talks to | Stays on your machine unless you configure a remote source plugin or use Agent Relay |
| Sign-in and keys | No account or API key. Optional remote history connectors reuse sign-ins you already have, such as the Claude Code CLI's stored token. |
Questions
Is RelayHistory official?
Yes, it is the vendor server: AgentWorkforce makes RelayHistory and publishes the MCP server from the same repository. It is not made by Anthropic, OpenAI or Cursor, and it is not an official server of those assistants.
Which assistants' history can it read?
Claude Code, Codex, Cursor, Grok, Muse Code, OpenCode and Devin CLI. Coverage differs by tool: Cursor sessions, for example, have no tool output or token usage, and the session catalog doc names each gap.
Do I need an account or API key?
No. It reads local files and needs only Node.js 20 or 22. Two optional settings exist: a config file for remote source plugins and a socket path for Agent Relay.
Is my history sent anywhere?
The server reads local history only, plus any source plugins you name in its config. What it returns goes to the assistant you connected, so your model provider sees the search results.
Can it change or delete my sessions?
No tool deletes. The sync, discover and hydrate tools write to RelayHistory's own local index, and the join and leave tools change your presence on Agent Relay.
Can I run it read-only?
No switch is documented. Search and lookup tools are marked read-only in the source, but you cannot turn off the tools that write to the index or join the relay.
What is the difference between ai-hist and ai-hist-mcp?
ai-hist is the command-line tool for search, resume and pack. ai-hist-mcp starts the MCP server and is the package in the install box above.
How do I add it to Claude Code or Cursor?
Use the install box above and pick your app. The command starts the server with npx, so you need Node.js installed.
Information
updated Nov 2, 2026
- Publisher
- Official
- Package
ai-hist-mcp- Registry
- npm
- Transport
- stdio
- Auth
- None
- Version
- 0.55.0
- License
- MIT
- Last commit
- Oct 31, 2026
- Open issues
- 39
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 3Hide
- RelayHistory README · github.com
- ai-hist-mcp on npm · npmjs.com
- RelayHistory MCP server source, release sdk-ts-v0.56.0 · github.com