Skip to main content
Glama
claude-web-history-mcp

claude-web-history-mcp

by EngDawood

claude-web-history-mcp

Read-only MCP server that lets Claude Code search and read your claude.ai conversations, across several accounts (e.g. one per Chrome profile).

Derived from DestinyJazz/claude-web-history-mcp (MIT, see LICENSE). Added: multiple accounts, cross-account title search, paged reads.

Read this first

  • It uses claude.ai's undocumented web endpoints. They can break any time.

  • Anthropic's consumer terms prohibit automated access. This tool is read-only and uses no inference quota, but that is not an exemption; the risk is on your accounts. The official export (Settings) is the zero-risk alternative.

  • A sessionKey equals your login. Never paste it into a chat. It is only typed into the hidden prompt of setup (or the UI's password field), and only ever sent to claude.ai.

  • Cloudflare in front of claude.ai may reject script requests (HTTP 403). Run npm run setup -- check first to find out.

  • Search covers conversation titles only (no full-text yet).

Related MCP server: Claude Code History MCP

Install

git clone <this repo> && cd claude-web-history-mcp
npm install

Add accounts

Do this once per account. In the Chrome profile logged in to it: DevTools (F12) → Application → Cookies → https://claude.ai → copy the value of sessionKey.

npm run setup -- add work
npm run setup -- add personal
npm run setup -- list
npm run setup -- check

Keys are stored in the OS keychain on macOS/Windows. On Linux the native keyring did not persist across processes in testing, so keys go to ~/.claude-web-history/accounts.json (mode 600). Override with CLAUDE_WEB_STORE=keychain|file, and the folder with CLAUDE_WEB_HISTORY_DIR.

Keys expire (e.g. after you log out of that account). Re-run npm run setup -- add <name>.

Register with Claude Code

npm run setup -- register    # prints the exact `claude mcp add ...` command

Web UI (local)

npm run ui          # or: node src/ui/server.js --port 4777

Prints a local URL like http://127.0.0.1:4777/<random-token>/. Open it in any browser on the same machine. Search titles across all accounts at once, filter by account (a dot shows whether each key still works), open a chat to read it in full, copy it as markdown or download it.

Manage accounts (button, top left): add an account, replace an expired key (re-add the same name), or remove one. The key is typed into a password field and sent once to the local server, which stores it and checks it against claude.ai. It is never sent back to the page. The account is saved even if the check fails, and the result tells you which. The env account (from CLAUDE_SESSION_KEY) is read-only.

It binds to 127.0.0.1 only, the URL contains a per-launch random token, and requests with a non-loopback Host header are rejected. Adding or removing an account also requires a same-origin Origin header and a JSON body of at most 8 KB.

Tools

Tool

What it does

list_web_accounts

Configured account names

list_web_conversations

Recent chats, one account or merged from all

search_web_conversations

Title search across all accounts

read_web_conversation

Full transcript as markdown; finds the owning account itself; offset pages long ones

save_web_conversation

Write a transcript to a file

debug_connection

Per-account key check, optional raw path

One expired account never hides results from the others; the failure is listed alongside.

Layout

src/core/history.js      list · search · read · health · raw   (the one module adapters call)
src/core/claude-web.js   HTTP client for claude.ai's endpoints, markdown rendering
src/core/credentials.js  account names + key storage
src/mcp/server.js        MCP adapter (stdio)
src/ui/server.js, index.html   web adapter + page
src/cli/setup.js         terminal adapter (add / list / check / remove / register)

Test

npm test    # offline, fake claude.ai, no real keys

Available Tools

6 tools
debug_connectionDebug the claude.ai connectionA

Check whether each account's session key works and which org id resolves. Optionally hit a raw API path (needs account) to inspect its shape when an endpoint changes.

Inputs: account, raw_path.

list_web_accountsList configured claude.ai accountsA

List the claude.ai accounts this server can read (names only, never keys). Add accounts with npm run setup -- add <name> or in the web UI (npm run ui).

Inputs: no named parameters.

list_web_conversationsList claude.ai conversationsA

List recent conversations (newest first) from one claude.ai account, or merged from all accounts when account is omitted. Use read_web_conversation to pull one in.

Inputs: limit, offset, account.

read_web_conversationRead a claude.ai conversationA

Fetch the full transcript of one claude.ai conversation as markdown. If account is omitted, every account is tried until one owns the uuid.

Inputs: uuid (required), offset, account, max_chars, +1 more.

save_web_conversationSave a claude.ai conversation to a fileA

Fetch a claude.ai conversation and write it to disk as markdown — useful for parking it in the repo (e.g. docs/context/) so it persists across sessions.

Inputs: path (required), uuid (required), account, include_timestamps.

search_web_conversationsSearch claude.ai conversation titlesA

Case-insensitive search over conversation TITLES across all configured accounts (or one). Titles only — it does not search message text. Scans the most recent max_scan conversations per account.

Inputs: query (required), account, max_scan.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation4/5

    The core verbs (list, search, read, save) map cleanly onto distinct operations, and list_web_accounts vs list_web_conversations are differentiated by object. The only mild overlap is read_web_conversation vs save_web_conversation, since save also fetches the transcript; the description clarifies the difference (disk write/persistence), so misselection risk is low.

    Naming Consistency5/5

    All tools use a predictable snake_case verb_noun pattern (list_/search_/read_/save_ + web_conversation(s), list_web_accounts). The only deviation is debug_connection lacking the 'web_' infix, which is appropriate since it is diagnostics rather than conversation access.

    Tool Count5/5

    Six tools is well-scoped for a read/export service over claude.ai conversations. Each tool corresponds to a distinct step (discover accounts, list, search, read, persist, troubleshoot) with no filler.

    Completeness4/5

    Lifecycle for reading and exporting conversations is covered, including persistence and diagnostics. Minor gaps: search only covers titles (no message-text search), and account management (adding/removing accounts) requires npm setup or the web UI rather than a tool, leaving agents a small dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers