agent-history-mcp

agent-history-mcp

Enables semantic search over local AI-agent session logs (e.g., Claude Code, Hermes) using local embeddings, returning relevant chunks without exposing full transcripts.

Category
Visit Server

README

agent-history-mcp

A tiny, generic MCP server that does semantic search over your local AI-agent session logs and returns the most relevant chunks — never whole transcripts.

Most "search my Claude history" tools are hardcoded to ~/.claude/projects and do keyword matching. This one is multi-agent (Claude Code + Hermes out of the box, plus any extra JSONL log dir you point it at) and semantic (local embeddings + vector similarity), so you can ask what you meant rather than what you typed.

What it searches

Agent Source Notes
Claude Code ~/.claude/projects/*/*.jsonl One session per file.
Hermes ~/.hermes/state.db (SQLite) Opened read-only.
Anything else extraRoots in config Any directory of *.jsonl session files.

Everything runs locally. The embedding model (Xenova/all-MiniLM-L6-v2, ~25 MB) downloads once on first run and is cached; after that it works offline. The index and model cache live in ~/.agent-history-mcp/ — nothing about your conversations ever leaves your machine, and none of it is part of this repo.

Install

# from npm (once published)
claude mcp add agent-history -s user -- npx -y agent-history-mcp

# or from a local checkout
npm install
npm run build
claude mcp add agent-history -s user -- node /absolute/path/to/agent-history-mcp/dist/index.js

Any MCP client works — the config is just a stdio command:

{
  "mcpServers": {
    "agent-history": { "command": "npx", "args": ["-y", "agent-history-mcp"] }
  }
}

Tools

  • search(query, k?=8, agent?, project?) — semantic search; returns ranked chunks, each with a chunkId, agent, session id, cwd, and timestamp.
  • get_context(chunkId, radius?=2) — expand a hit into its neighboring chunks from the same session (bounded — still not the whole transcript).
  • list_agents() — which stores are present locally and how many sessions/chunks are indexed.

Configuration (optional)

Create ~/.agent-history-mcp/config.json:

{
  "claudeRoot": "~/.claude/projects",
  "hermesDb": "~/.hermes/state.db",
  "extraRoots": [{ "agent": "codex", "dir": "/path/to/codex/sessions" }],
  "model": "Xenova/all-MiniLM-L6-v2",
  "maxChunkChars": 1200
}

Set AGENT_HISTORY_HOME to relocate the cache/index directory.

How it works

  1. Discover sessions cheaply (file mtime/size, or SQLite row counts) — no content read.
  2. Chunk each changed session into role-prefixed, size-bounded chunks.
  3. Embed each chunk locally (mean-pooled, L2-normalized → cosine = dot product).
  4. Cache per session as a sidecar JSON under ~/.agent-history-mcp/index/; only new/changed sessions are re-embedded on later runs.
  5. Search by embedding the query and brute-forcing cosine over the in-memory vectors — exact and plenty fast at personal scale.

No server, no external vector DB, no API keys.

Roadmap

Today it's local-only. The plan is to run it as a small daemon on every machine and search your entire cross-device agent memory over your Tailscale tailnet — federated, private, WireGuard-encrypted, no public ports. See ROADMAP.md.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured