Skip to main content
Glama
DestinyJazz

claude-web-history-mcp

by DestinyJazz

claude-web-history-mcp

I have ideas on my phone. I write code in VS Code. Those two things don't talk to each other, so every time I sat down to actually build something, the conversation where I worked it out was stuck on the other side of a wall.

This is an MCP server that tears down that wall — it lets Claude Code browse and pull in conversations from your claude.ai account, so a chat you had on your phone this morning is available in your editor this afternoon.

You choose which conversation to import. Nothing syncs automatically, nothing is written back to claude.ai, and no credential ever lands in a config file.

Before you use this: terms of service

Anthropic's Consumer Terms of Service prohibit what this tool does. Section 3 prohibits accessing the service "through automated or non-human means, whether through a bot, script, or otherwise," with the only carve-out being an official API key or Anthropic's explicit permission. That clause has been in place since February 2024 and has been enforced — in early 2026, accounts using third-party harnesses were terminated under it.

I'm not going to tell you this is fine. Read the terms yourself: https://www.anthropic.com/legal/consumer-terms. Decide for yourself.

What I can offer is the distinction I found relevant when deciding to use it myself. The enforcement action in 2026 targeted tools that routed inference traffic through consumer subscriptions — using a flat-rate plan to avoid API costs. This tool consumes no inference quota. It makes a few read-only requests for conversations you already created, data Anthropic also hands you via the official export feature under Settings.

That is a difference in kind, not a legal exemption. The clause doesn't have a "but it's read-only" exception. I judge the practical risk to be low. That is a judgment, not a promise, and I have no standing to make promises about how Anthropic enforces its terms. If you get your account suspended, that's your account, not mine.

If any of that gives you pause, stop here. The official export under Settings gets you the same data, slower and manually, with zero risk. It's a real option and for many people it's the right one.

Related MCP server: ccfolio

Other things you should know

  • Your session key is equivalent to your claude.ai login. Anyone who obtains it can act as you. This code stores it in your OS keychain and only ever sends it to claude.ai — but you should verify that claim rather than take my word for it.

  • Don't paste your session key into any tool you haven't read the source of. Including this one. It's ~850 lines across four files, deliberately, so that reading it is realistic. Please do. Start with claude-web.js.

  • Be careful with forks. This code is short and simple enough that adding three lines to exfiltrate your key would be easy and easy to miss. Read the diff of whatever you actually run.

  • This uses undocumented endpoints and will break when Anthropic changes the web app. Treat it as disposable.

  • Anthropic has an open feature request for an official version (anthropics/claude-code #15542). That's the real fix. If it ships, delete this. Adding your use case to that thread is more useful than starring this repo.

Requirements

  • Node.js 18+

  • Claude Code (CLI, VS Code, JetBrains, or desktop — they share one config)

  • Works on macOS, Windows, and Linux

Install

Read the source first. Seriously — see the section above.

git clone https://github.com/DestinyJazz/claude-web-history-mcp.git
cd claude-web-history-mcp
npm install
npm run auth

npm run auth walks you through finding your session key, stores it in your OS keychain (macOS Keychain / Windows Credential Manager / Linux Secret Service), verifies it against claude.ai, and prints the exact command to register the server. Input is hidden while you type.

Then run the command it gives you — roughly:

claude mcp add claude-web-history --transport stdio -s user -- node /abs/path/to/index.js

There's deliberately no --env flag: the key lives in the keychain, not in ~/.claude.json.

Open the Claude Code panel, type /mcp, confirm it connected. Done.

You don't need to keep anything running

This is a stdio server. Claude Code spawns it on demand and it exits when the call finishes. Nothing to start, nothing to leave open, survives reboots.

Using it

Just talk to Claude Code:

List my recent claude.ai conversations about the auth redesign

Read conversation abc-123 and use it as context for what we're building here

Save conversation abc-123 to docs/context/auth-design.md

That last one is worth a habit: parking an important conversation as a file in the repo means it survives even if this server stops working.

Tools

Tool

What it does

list_web_conversations

Lists your claude.ai chats. Supports limit, offset, and a contains title filter.

read_web_conversation

Pulls one conversation into the session as markdown. Truncates at max_chars (default 60k).

save_web_conversation

Writes a conversation to a file in your repo.

debug_connection

Verifies the session and shows the resolved org id. Pass raw_path to inspect a raw endpoint when something breaks.

Credentials

Command

Effect

npm run auth

Store or replace the session key.

npm run check

Verify the stored key still works.

npm run auth -- --remove

Delete the key from the keychain.

Resolution order: CLAUDE_SESSION_KEY env var (escape hatch, CI, headless Linux) → OS keychain (the default).

Session keys expire every few weeks, or immediately if you log out in the browser. When they do, tools return a message telling you to run npm run auth.

Safeguards in the code, so you can verify them:

  • The key is stored via @napi-rs/keyring — never written to a config file.

  • A hardcoded host allowlist means the server refuses to send the cookie anywhere but claude.ai. See ALLOWED_HOSTS in claude-web.js.

  • All output and error text passes through redact() before leaving the server, so a key can't leak into the model's context or a transcript.

  • Setup input is read with terminal echo off.

  • No logging to disk. Ever.

Other env vars

Var

Purpose

CLAUDE_ORG_ID

Skip org lookup by pinning your org uuid.

CLAUDE_WEB_BASE

Override the base URL. Must still resolve to claude.ai.

CLAUDE_WEB_UA

Override the User-Agent string.

When it breaks

Run debug_connection, or npm run check from a terminal.

  • "Session expired or missing" → run npm run auth with a fresh key.

  • HTTP 404 → the endpoint moved. Open claude.ai with DevTools → Network, click through your chat list, and compare against the EP block at the top of claude-web.js. That's the only place paths are defined — one edit fixes it.

  • List works but message text is empty → the message payload shape changed. See the content[] handling in getConversation().

  • Keychain unavailable (headless Linux, no Secret Service) → set CLAUDE_SESSION_KEY as an env var instead.

Layout

index.js        MCP server — tool definitions
claude-web.js   claude.ai client — all endpoints live at the top
credentials.js  keychain storage, key normalization, redaction
setup.js        interactive `npm run auth`

Dependency direction is one-way: index.js and setup.js both depend on claude-web.js, which depends only on credentials.js. Reading those last two is enough to confirm where the key can and can't go.

License

MIT. Not affiliated with, endorsed by, or supported by Anthropic.

Available Tools

4 tools
debug_connectionDebug the claude.ai connectionA

Check whether the session key works and which org id is resolved. Optionally hit a raw API path to inspect its shape when an endpoint changes.

ParametersJSON Schema
NameRequiredDescriptionDefault
raw_pathNoOptional raw path, e.g. /api/organizations

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. The verbs 'check' and 'inspect' suggest read-only diagnostics, but the 'raw API path' option could be interpreted as an arbitrary request without explicitly noting that it is non-mutating. This leaves some ambiguity about whether any side effects could occur.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only two sentences, begins with the primary purpose, and then appends the optional behavior. Every sentence serves a clear function, and there is no redundant wording or unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the single optional parameter, no output schema, and no annotations, the description covers the main behavior and the optional parameter's use case well. It implies the expected outputs (whether the key works, the resolved org id, and the raw response shape) without explicit formatting, which is acceptable for a debugging tool of this simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already covers raw_path with 100% description coverage, so the baseline is 3. The description adds meaning by explaining the purpose of the parameter: 'to inspect its shape when an endpoint changes,' which goes beyond the schema's simple example and helps the agent understand when to populate it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Check whether the session key works and which org id is resolved,' which is a specific verb and resource. This clearly distinguishes it from the sibling conversation tools, which focus on managing conversations rather than debugging the underlying connection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool: when you need to verify the session key or resolved org id, and optionally to inspect raw API responses when an endpoint changes. However, it does not explicitly name alternatives or state when not to use it, so it lacks the full exclusion guidance needed for a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_web_conversationsList claude.ai conversationsA

List conversations from the claude.ai web account (newest first). Returns uuid, title and timestamps. Use read_web_conversation to pull one in.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoHow many conversations to return
offsetNoPagination offset
containsNoOptional case-insensitive filter on the conversation title

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavioral disclosure. It states the ordering ('newest first') and return fields (uuid, title, timestamps), which is useful, but it does not explicitly state that this is a read-only operation, nor does it mention any access requirements or potential side effects. The listing nature implies safety, but it is not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary purpose, followed by return type and an alternative tool pointer. Every sentence contributes value without unnecessary verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with pagination, the description covers the essential purpose, ordering, return fields, and a related alternative. Since the schema already documents parameter syntax and there is no output schema, the description's explicit mention of returned fields fills the gap. Minor omission: it does not describe pagination behavior itself, but schema handles that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All three parameters (limit, offset, contains) already have clear descriptions in the schema, totaling 100% coverage. The description adds no additional parameter-specific meaning beyond what the schema provides, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists conversations from claude.ai web account, with the specific verb 'list' and resource. It also distinguishes itself from the sibling read_web_conversation by noting it returns multiple conversations and pointing to that tool for pulling one in.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides an explicit alternative: 'Use read_web_conversation to pull one in,' which conveys when to use a different tool for single-conversation retrieval. However, it does not elaborate on exclusions for the other sibling tools (debug_connection, save_web_conversation), though their purposes are inferable from their names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_web_conversationRead a claude.ai conversationA

Fetch the full transcript of one claude.ai conversation as markdown, so it can be used as context in this Claude Code session.

ParametersJSON Schema
NameRequiredDescriptionDefault
uuidYesConversation uuid from list_web_conversations
max_charsNoTruncate very long transcripts to keep context manageable
include_timestampsNo

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It states 'fetch' (a read verb) and 'as markdown' which discloses return format. However, it does not explicitly disclose that this is read-only, nor does it mention truncation behavior or any potential side effects, though the schema covers max_chars. It's adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, 20 words, front-loaded with verb and resource. No fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with three params and no output schema, the description plus schema cover the core need: what it does, output format, and use case. However, it doesn't mention error conditions, authentication, or relationship to debug_connection, but these are not critical for successful invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 67% (uuid and max_chars described). Description adds no parameter-specific info, but the schema's uuid description links to list_web_conversations, and max_chars explains truncation. The include_timestamps parameter lacks description in both schema and tool description, leaving a gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verb 'fetch' and resource 'full transcript of one claude.ai conversation', with output format 'markdown'. It clearly distinguishes from siblings like list_web_conversations (which lists conversations) and save_web_conversation (which likely saves/shares).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear context: 'so it can be used as context in this Claude Code session' indicates when to use. However, it does not explicitly mention alternatives or when not to use, though the sibling list tool is implied through the schema's uuid reference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesDestination file path, e.g. ./docs/context/design-chat.md
uuidYesConversation uuid
include_timestampsNo

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It clearly states the write-to-disk action and markdown format, but does not disclose whether existing files are overwritten, whether directories are created, or any error handling. This leaves some behavioral ambiguity for a file-writing tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loaded with the action verb and resource, then a practical use case. There is no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (file write with a timestamp option) and lack of annotations/output schema, the description covers the primary purpose and use case but omits edge behaviors like overwriting, file path handling, and return value. This is adequate but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67% (path and uuid are described, include_timestamps is not). The tool description adds no parameter context; it does not explain what include_timestamps does or how the parameters interact. The description does not compensate for the partially missing schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: 'Fetch a claude.ai conversation and write it to disk as markdown.' It specifies the resource (claude.ai conversation) and output (markdown file), and distinguishes itself from siblings by emphasizing persistence to disk rather than just reading or listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear use case: 'useful for parking it in the repo (e.g. docs/context/) so it persists across sessions.' This implies when to use it, though it does not explicitly name alternatives or state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 4 tool updatesv0.2.0
    • First observeddebug_connection
    • First observedlist_web_conversations
    • First observedread_web_conversation
    • First observedsave_web_conversation

TDQS

A4.1/5.0

Scored across 4 tools

Disambiguation4/5

The tools are mostly distinct: debug_connection checks credentials, list_web_conversations lists metadata, read_web_conversation fetches content, and save_web_conversation persists to disk. The only potential overlap is read vs save, but the descriptions clarify the output destination (context vs file).

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case: debug_connection, list_web_conversations, read_web_conversation, save_web_conversation. The singular/plural variation is natural and doesn't create confusion.

Tool Count5/5

With only 4 tools, the set is tightly scoped to the server's purpose of accessing and persisting claude.ai web conversations. Each tool serves a clear, non-redundant function, and the small count is appropriate for the niche domain.

Completeness4/5

The core lifecycle is covered: list conversations, read a conversation, and save a conversation. Debugging is supported via debug_connection. The only potential gaps are search or deletion, but those are arguably outside the intended scope of a history-retrieval tool.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables searching and browsing past Claude Code conversations directly from within an active Claude session, with full-text search and cost tracking.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables Claude Code to search and retrieve past chat history from Claude.ai exports and Claude Code sessions, allowing the AI to reference previous conversations and decisions.
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables listing and continuing conversations from Claude Code, Codex, Cursor, and GLM, allowing context handoff between tools by providing historical transcripts as context.
    5
    MIT