Atlas / MCP servers / agentworkforce / ai-hist

ai-histBLOCK

mcp/agentworkforce/relayhistory

Sync & search Claude Code + Codex CLI conversation history in SQLite. Zero dependencies.

Verdict
BLOCK
Grade
F
Trust score
55 /100
Exposed tools
37 32r · 4w · 1d
Transport
stdio
License
MIT
Stars
13
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

Search, resume, and hand off every coding-agent session — across every harness on your machine.

Local memory for Claude Code, Codex, Cursor, Grok, Muse Code, OpenCode, and Devin CLI. Your agent sessions are indexed into one local SQLite database. Search them all at once, jump back into a session with its harness's native resume command, and hand a compact context pack to another agent — or to a teammate's agent — to continue the work.

ai-hist search "auth rewrite"
# → matches across every codex/claude/cursor session on this machine

ai-hist resume "auth rewrite"
# → prints `codex resume 29284179-c09f-44f2-b9ec-16f678dc1832`

ai-hist pack "auth rewrite" --tokens 1500
# → a token-budgeted context pack, ready to paste into another agent

Use Cases

  • Never search for an old chat session again. One local index across every harness. ai-hist search "the thing I was working on" finds it, whichever CLI you used.
  • Hand off work between agents without losing context. ai-hist pack "the feature" produces a compact context pack; ai-hist resume "the feature" prints the native resume command. Great for switching from Claude to Codex mid-work, or picking up a teammate's session.
  • Give your agent access to its own memory via MCP. Wire ai-hist-mcp into Claude Code / Cursor / Codex and the agent can query its own past sessions while it's running — search, session events, tool calls, file edits.
  • The sourcing layer for [burn](https://github.com/AgentWorkforce/burn). burn prices and analyzes agent sessions. Today it still ships its own Claude Code, Codex and OpenCode readers; from burn 5.0.0 (burn #562) it drops them and reads usage, tool calls, file edits and session topology from the same ai-history.db through the ai-hist crate, so the two tools share one ingest and agree on what a session is. Pricing and cost stay in burn. See
Read from source at commit 448d02803d82OBSERVED · 2026-10-11
Advertisement
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code
claude mcp add ai-hist --env NODE_AUTH_TOKEN=${NODE_AUTH_TOKEN} -- npx -y [email protected]
claude-desktop
{
  "mcpServers": {
    "ai-hist": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "NODE_AUTH_TOKEN": "${NODE_AUTH_TOKEN}"
      }
    }
  }
}
03

Exposed tools (37)

32 read · 4 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.

ToolRiskDescription
ai-histreadReport local history readiness and list the catalogue.
countreadHow many to show.
create_handoffwriteCreate a Relaycast handoff pointer for the caller\
discover_sessionsreadExplicit shallow provider discovery. Updates only the session catalog.
eventsreadPage through one session\
exportreadExport selected history as NDJSON.
get_sessionreadGet indexed prompts for one session.
get_session_eventsreadGet one bounded page of normalized events.
get_session_file_editsreadGet one bounded page of recorded file edits for one session.
get_session_markersreadGet one bounded page of a session\
get_session_relationshipsreadDirect relationships for one session: delegation in both directions (as parent and as child), plus the continuity edges (resume, fork, continuation) that connect it to the conversation it came from.
get_session_requestsreadGet one bounded page of a session\
get_session_tool_callsreadGet one bounded page of recorded tool calls for one session.
get_session_treereadComplete descendant tree for one session, with cycle protection and deterministic ordering. Follows delegation edges by default; pass relationship_kinds to also include resumed, continued, or forked descendants of the root. Child events are not flattened into the parent.
get_session_usagereadProvider-neutral token usage rollup for one session. Null usage means no usage evidence, never an assumed zero; cost appears only when the source data carried one.
get_source_capabilitiesreadWhat one provider\
history_statsreadStatistics for already-indexed RelayHistory data.
hydrate_sessionwriteIndex one cataloged session as fully as its provider allows, without global sync.
join_relaywritePut the local session hosting this MCP server on Agent Relay so teammates and agents can reach it. Uses only the local Agent Relay desktop socket; optional name and description are public relay metadata.
leave_relaydestructiveRemove the local session hosting this MCP server from Agent Relay. Uses only the local Agent Relay desktop socket.
list_relay_agentsreadList live participants currently on Agent Relay, not session history. Reads only the local Agent Relay desktop socket; it uses no cloud client or credential.
list_sessionsreadCache-only indexed session catalog listing. This never discovers or syncs.
packreadPack matching history into a context block.
queryreadSearch terms.
recentreadShow the most recent prompts.
recent_historyreadList recent already-indexed prompts, newest first by (timestampMs, id).
relay_statusreadReport whether the local session hosting this MCP server is registered and reachable on Agent Relay. Reads only the local Agent Relay desktop socket.
resumereadPrint the command that resumes the best-matching session.
resume_handoffreadAuto-resume a same-workspace handoff in one call: acquire the session and compose prompts, normalized events, tool calls, and file edits. Cross-workspace and cross-organization handoffs are rejected.
review-botreadReviews releases.
searchreadSearch indexed prompts and session events.
search_historyreadFull-text search of already-indexed user prompts and session events (assistant text, tool calls and results),
sessionreadShow one session.
session-idreadSession identifier.
sourcereadCoding-agent source, e.g. claude or codex.
statsreadSummarize what the history store holds.
syncwriteIndex new sessions from every configured source.
04

Trust audit

BLOCKgrade F · trust 55/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeFAIL
L2Instruction surface (what it tells the agent)FAIL
L3Class-specific surfaceWARN
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (7 observation(s))
Network
declared (3 observation(s))
Shell
declared (5 observation(s))
Dependencies
not all pinned
Secrets in source
none-found

Findings (25)

CRITICALPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
<tool:relay_status>:1
Report whether the local session hosting this MCP server is registered and reachable on Agent Relay. Reads only the local Agent Relay desktop socket.
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
HIGHCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
scripts/verify-e2e.sh:26
process.stdout.write(String(eval(process.argv[1])));
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
HIGHCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
scripts/verify-e2e.sh:36
process.stdout.write(String(eval(process.argv[1])));
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
MEDIUMNetwork egress · net.raw_ip · CWE-200, CWE-319
plugins/provider-sources/rust/src/remote/tests.rs:318
assert!(require_https_or_loopback("http://127.0.0.1:8787").is_ok());
MEDIUMNetwork egress · net.raw_ip · CWE-200, CWE-319
plugins/provider-sources/rust/src/remote/tests.rs:324
assert!(require_https_or_loopback("http://[email protected]").is_err());
MEDIUMFilesystem / path · mcp.destructive_tools · CWE-22, CWE-59
leave_relay
Why it matters. 1 tool(s) can delete or overwrite
Fix. prefer a read-only mode or scoped tokens; the page states the blast radius
LOWInventory / provenance · inv.binary · CWE-1104
sdk-ts/fixtures/offline-history.db.gz
offline-history.db.gz
Why it matters. a compiled or binary member cannot be reviewed from source
Fix. ship source, or explain the binary in the README
LOWCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
sdk-ts/src/delivery.test.ts:352
exec(sql: string): void; prepare(sql: string): { get(): unknown }; close(): void } }
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
LOWCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
sdk-ts/src/delivery.test.ts:402
exec(sql: string): void; prepare(sql: string): { get(): unknown }; close(): void } }
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
.github/workflows/ci.yml:83
node ../../scripts/verify-native-contract.mjs ./index.js
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
.github/workflows/ci.yml:327
(cd helper-stage/provider-sources && npm pack --ignore-scripts --pack-destination ../../helper-packs)
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
.github/workflows/publish.yml:278
run: node ../../scripts/verify-native-contract.mjs ./index.js
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
.github/workflows/publish.yml:283
run: docker run --rm -v "$GITHUB_WORKSPACE:/work" -w /work/crates/ai-hist-napi node:22-alpine node ../../scripts/verify-native-contract.mjs ./index.js
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
.github/workflows/publish.yml:512
cd ../../sdk-ts
LOWObfuscation / stealth · obf.base64_blob · CWE-506, CWE-94
crates/ai-hist/tests/fixtures/claude/oversized-bash-output.jsonl:3
{"parentUuid": "u-asst-1", "isSidechain": false, "type": "user", "message": {"role": "user", "content": [{"type": "tool_result", "tool_use_id": "tu_bash_big", "content": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LOWObfuscation / stealth · obf.base64_blob · CWE-506, CWE-94
crates/ai-hist/tests/fixtures/codex/oversized-shell-output.jsonl:6
{"timestamp": "2026-04-20T01:00:02.000Z", "type": "response_item", "payload": {"type": "function_call_output", "call_id": "call_shell_1", "output": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LOWObfuscation / stealth · obf.base64_blob · CWE-506, CWE-94
crates/ai-hist/tests/snapshots/claude/oversized-bash-output.json:115
"text": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LOWObfuscation / stealth · obf.base64_blob · CWE-506, CWE-94
crates/ai-hist/tests/snapshots/codex/oversized-shell-output.json:77
"text": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
crates/ai-hist-napi/package.json
@napi-rs/cli
Why it matters. 1 dependency range(s) float
Fix. pin exact versions or ship a lockfile
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
plugins/provider-sources/sdk/package.json
@types/node, typescript
Why it matters. 2 dependency range(s) float
Fix. pin exact versions or ship a lockfile
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
sdk-ts/package.json
@modelcontextprotocol/sdk, zod, @agent-relay/cli-surface, @relayhistory/cloud-client, @types/node, typescript
Why it matters. 6 dependency range(s) float
Fix. pin exact versions or ship a lockfile
LOWPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
README.md:23
- **The sourcing layer for [burn](https://github.com/AgentWorkforce/burn).** burn prices and analyzes agent sessions. Today it still ships its own Claude Code, Codex and OpenCode readers; from burn 5.
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
LOWPrompt injection · prompt.transfer_instruction · CWE-94, CWE-1427
README.md:86
The MCP server reads local history only, plus any source plugins named by `AI_HIST_PLUGIN_CONFIG`. The relay roster, status, join, and leave tools are also local: they use `AGENT_RELAY_SOCKET`, then `
Why it matters. an instruction to move sensitive data to an outside destination
Fix. remove; a skill never needs the user's secrets off the machine
INFOInventory / provenance · inv.oversize · CWE-1104
crates/ai-hist/src/ingest.rs
crates/ai-hist/src/ingest.rs
Why it matters. 1688436 bytes not read
INFOPrompt injection · prompt.credential_read · CWE-94, CWE-1427
README.md:86
The MCP server reads local history only, plus any source plugins named by `AI_HIST_PLUGIN_CONFIG`. The relay roster, status, join, and leave tools are also local: they use `AGENT_RELAY_SOCKET`, then `
Why it matters. asks the agent to read credentials

Gates applied: critical_finding, no_behavioural_pass, undeclared_transfer.

Audited 2026-10-11 · audit v0.4.1 · source sha 448d02803d82full audit observations/trust-audit/mcp-server/agentworkforce__relayhistory.json · Report an issue / request a re-scan
05

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-11448d02803d82BLOCKF55first audit
06

Questions

What is the ai-hist MCP server?

Sync & search Claude Code + Codex CLI conversation history in SQLite. Zero dependencies.

What tools does ai-hist expose?

37 in total: 32 read-only, 4 that write, and 1 that can delete or overwrite (leave_relay). Every one is listed on this page with its risk.

Is ai-hist safe to connect to an agent?

No — not without reading the findings first. The audit graded it F (55/100) and found 3 critical or high issues in the source. Each one is listed on this page with the file and line it is on. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.

What credentials does ai-hist need?

It reads NODE_AUTH_TOKEN from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How does ai-hist run?

It speaks stdio, so it runs as a local process your client starts. It is published on npm as ai-hist at 0.40.1.

How current is this page?

The grade is for one exact copy of the source (448d02803d82), read on 2026-10-11. The repository is watched and re-audited when it changes.

Advertisement