PlugWiki
relayhistory logo

RelayHistory MCP Server: Setup for Claude Code, Cursor and Codex

OfficialLocal

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.

Install relayhistory MCP

Claude Code

  1. 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. 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_history

  • Lists 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_history

  • Lists 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_sessions

  • Gets 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_session

  • Reads 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_events

  • Lists 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_calls

  • Lists 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_edits

  • Shows 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_tree

  • Shows 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_relationships

  • Lists 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_markers

  • Lists 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_requests

  • Totals 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_usage

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-onlyNo 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 toStays on your machine unless you configure a remote source plugin or use Agent Relay
Sign-in and keysNo 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

GitHubnpmChangelogIssues

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 3
  1. RelayHistory README · github.com
  2. ai-hist-mcp on npm · npmjs.com
  3. RelayHistory MCP server source, release sdk-ts-v0.56.0 · github.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.