Skip to main content
Glama
daniellmorris

local-claude-chat-history-mcp

local-claude-chat-history-mcp

An MCP server that searches your local Claude conversation history — the sessions Claude stores as files on your own machine.

Source

Location

What it is

code

~/.claude/projects/**/*.jsonl

Claude Code CLI/desktop sessions

cowork

~/Library/Application Support/Claude/local-agent-mode-sessions (macOS)

Claude Cowork (local agent mode) sessions

Everything runs locally over stdio — it only reads files already on disk, and nothing is uploaded anywhere.

Handy for questions like:

  • "What did I work on today / this week?"

  • "Which session was it where I set up the ADX proxy?"

  • "When did I last touch the leaderboard caching code?"

Scope — local only. This searches the transcripts Claude writes to disk (Claude Code and Claude Cowork). Your regular claude.ai / Claude Desktop chats are stored in Anthropic's cloud, not locally, so there is no local file for this tool to read and they are intentionally out of scope.

Usage

This repo is a Claude Code plugin and its own marketplace. Install it with:

# From GitHub
claude plugin marketplace add daniellmorris/local-claude-chat-history-mcp
claude plugin install local-claude-chat-history@local-claude-chat-history

# Or from a local checkout
claude plugin marketplace add /path/to/local-claude-chat-history-mcp
claude plugin install local-claude-chat-history@local-claude-chat-history

Or interactively inside Claude Code: /plugin marketplace add … then /plugin install local-claude-chat-history.

The plugin runs the bundled server at dist/server.mjs — no npm install needed on the machine that installs it.

For quick testing without installing:

claude --plugin-dir /path/to/local-claude-chat-history-mcp

Claude Code (plain MCP server)

claude mcp add claude-history -- npx -y github:daniellmorris/local-claude-chat-history-mcp

Claude Desktop / other MCP clients

{
  "mcpServers": {
    "claude-history": {
      "command": "npx",
      "args": ["-y", "github:daniellmorris/local-claude-chat-history-mcp"]
    }
  }
}

Related MCP server: mcp-sessions

Tools

search_history

Full-text search across both sources, newest sessions first.

Param

Default

Description

query

Case-insensitive substring (or regex with regex: true)

source

all

all | code | cowork

project

Substring filter on project path or session title

role

any

user | assistant

after / before

ISO date bounds (e.g. 2026-07-09)

limit / maxPerSession

20 / 3

Result caps

Returns matching snippets with sessionIds.

list_sessions

Browse recent sessions (id, title, project, timestamps) with the same source/project filters. Great for "what did I do today".

get_session

Read a full conversation by sessionId, paginated with offset/limit, each message truncated to maxChars.

Configuration

All optional, via environment variables:

Variable

Purpose

CLAUDE_CODE_HISTORY_DIR

Override ~/.claude/projects

CLAUDE_COWORK_SESSIONS_DIR

Override the Cowork sessions directory

Development

npm install
npx @modelcontextprotocol/inspector node index.js

The plugin ships a dependency-free bundle at dist/server.mjs (committed to the repo). After changing index.js or lib/, rebuild it:

npm run build

License

MIT

Available Tools

3 tools
get_sessionRead a Claude history sessionA

Read the messages of a single conversation session by ID (from list_sessions or search_history). Paginate long sessions with offset/limit.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax messages to return
offsetNoSkip this many messages
sourceNoHistory source: "code" = Claude Code (~/.claude/projects), "cowork" = Claude Cowork local desktop sessions, "all" = bothall
maxCharsNoTruncate each message to this many characters
sessionIdYes

TDQS

A4.1/5.0
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses multiple behavioral traits: reads messages (read operation), supports pagination via offset/limit, truncation via maxChars, and source filtering. It does not mention side effects or return format, but for a read-only tool these are acceptable. No contradiction with annotations.

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?

Two sentences, front-loaded with purpose, no wasted words. Efficient and clear.

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 5 parameters, no output schema, and no annotations, the description covers key usage (source of IDs, pagination) but lacks details on return format, error handling, or session not found behavior. Completeness is adequate but not exceptional.

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 already has descriptions for 4 of 5 parameters (80% coverage). Description adds context about pagination but does not detail all parameters beyond schema. Baseline 3 is appropriate; description adds minimal extra meaning.

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?

Description clearly states 'Read the messages of a single conversation session by ID', specifying the verb ('Read'), resource ('messages of a single conversation session'), and source of IDs (list_sessions or search_history). It distinguishes from sibling tools: list_sessions returns sessions, search_history searches, get_session reads a specific session's messages.

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?

Explicitly says to use after obtaining session ID from list_sessions or search_history, and mentions pagination for long sessions. Sibling tools are listed, providing context for when not to use this tool. Could be improved by explicitly stating when not to use, but adequate.

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

list_sessionsList Claude history sessionsA

List recent local Claude sessions (Claude Code + Claude Cowork), newest first. Useful for reviewing what you worked on today/this week, or to find a session ID to pass to get_session.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
sourceNoHistory source: "code" = Claude Code (~/.claude/projects), "cowork" = Claude Cowork local desktop sessions, "all" = bothall
projectNoCase-insensitive substring filter on project path/name or session title

TDQS

A4.2/5.0
Behavior4/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. It discloses the tool lists recent sessions, orders them newest first, and covers multiple sources. It does not mention rate limits or output format, but for a list tool the behavioral disclosure is adequate.

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?

Two sentences, front-loaded with purpose, no wasted words. Every sentence provides value (purpose, usage example, link to get_session).

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?

With 3 optional parameters and no output schema, the description covers the tool's purpose, usage context, and ordering. It lacks a hint about the return format (e.g., session IDs, timestamps), but the context is largely complete for an agent to decide to use it.

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% (source and project described, limit missing description). The tool description does not add further semantic meaning beyond the schema; it relies on schema for limit constraints and source/project descriptions, so baseline 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 uses a specific verb ('list') and resource ('local Claude sessions'), specifies ordering ('newest first'), and distinguishes from siblings by mentioning its use for finding a session ID to pass to get_session.

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 explicitly states when to use it ('reviewing what you worked on today/this week' or 'find a session ID to pass to get_session'), providing clear context. It does not explicitly state when not to use it or directly compare to search_history, but the sibling tool names imply differentiation.

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

search_historySearch Claude historyA

Full-text search across local Claude Code and Claude Cowork conversation history stored on this machine. Returns matching message snippets with session IDs (use get_session to read the full conversation). Searches newest sessions first — good for questions like "what did I work on today" or "when did I last touch X".

ParametersJSON Schema
NameRequiredDescriptionDefault
roleNoOnly match messages from this roleany
afterNoOnly sessions active after this ISO date (e.g. "2026-06-01")
limitNoMax total matches to return
queryYesText to search for (case-insensitive substring, or a regex when regex=true)
regexNoTreat query as a JavaScript regular expression
beforeNoOnly messages before this ISO date
sourceNoHistory source: "code" = Claude Code (~/.claude/projects), "cowork" = Claude Cowork local desktop sessions, "all" = bothall
projectNoCase-insensitive substring filter on project path/name or session title
maxPerSessionNoMax matches returned per session

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses the tool is read-only (search), returns snippets and session IDs, searches newest first, works on local storage, and supports sources (code, cowork). It doesn't mention regex or maxPerSession directly, but those are in the schema.

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?

Three sentences with no wasted words. First sentence states the core function, second explains output and links to sibling tool, third gives examples and ordering. Front-loaded and efficient.

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 no output schema, the description adequately explains return values (snippets, session IDs) and ordering. It covers main behavioral aspects for a 9-parameter search tool, though it doesn't elaborate on all parameters (schema covers them).

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?

Schema coverage is 100%, so baseline is 3. The description adds value beyond schema by explaining the search order, multiple sources, and the relationship to get_session, aiding the agent in understanding how parameters like source and ordering affect results.

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 it performs full-text search across local conversation history from two sources (Claude Code and Claude Cowork), returns message snippets with session IDs, and differentiates from sibling tool get_session by directing users to read full conversations there. It also provides concrete example queries.

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 explicit usage context ('good for questions like...'), states the ordering ('searches newest sessions first'), and references get_session as the tool for full conversations. However, it does not explicitly specify when not to use this tool or mention alternatives like list_sessions.

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. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedget_session
    • First observedlist_sessions
    • First observedsearch_history

TDQS

A4.4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: list_sessions for overview, search_history for finding specific content, and get_session for reading a full conversation. No overlap.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (get_session, list_sessions, search_history) with snake_case, making the tool surface predictable.

Tool Count5/5

With 3 tools, the server is tightly scoped to its purpose—listing, searching, and reading chat history. No waste or missing core functionality.

Completeness5/5

The tool set covers the full lifecycle for a read-only history server: list to browse, search to find, and get to retrieve full content. No obvious gaps.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/daniellmorris/local-claude-chat-history-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server