Skip to main content
Glama
bwads001

cc-session-search

by bwads001

Claude Code Session Search MCP Server

An MCP (Model Context Protocol) server that provides tools for searching and analyzing Claude Code conversation history.

Features

  • List Projects: View all Claude Code projects with session counts

  • List Sessions: Browse sessions for specific projects

  • List Recent Sessions: Find recent conversations across all projects

  • Analyze Sessions: Extract and analyze messages with role filtering

  • Search Conversations: Search for specific terms with context windows and time ranges

  • Get Message Details: Retrieve full content for specific messages

  • Summarize Conversations: AI-powered summarization of daily conversations

Related MCP server: Claude Code History MCP Server

Installation

  1. Install dependencies:

uv sync
  1. Run the server:

uv run python server.py
  1. Add to Claude Code MCP config (~/.config/claude/mcp.json):

{
  "servers": {
    "cc-session-search": {
      "command": ["uv", "run", "python", "server.py"],
      "cwd": "/path/to/cc-session-search"
    }
  }
}

Requirements

  • Standard Claude Code installation (searches ~/.claude/projects/)

  • Python 3.13+

  • MCP 1.2.0+

Usage

The server provides the following tools:

list_projects()

Lists all Claude Code projects with session counts and recent activity.

list_sessions(project_name, days_back=7)

Lists sessions for a specific project within the specified time range.

list_recent_sessions(days_back=1, project_filter=None)

Lists recent sessions across all projects.

analyze_sessions(days_back=1, role_filter="both", include_tools=False, project_filter=None)

Extracts and analyzes messages from sessions with filtering options.

search_conversations(query, days_back=2, context_window=1, case_sensitive=False, project_filter=None)

Searches conversations for specific terms with context windows.

get_message_details(session_id, message_indices)

Retrieves full content for specific messages by session ID and indices.

Development

The server is built using the official MCP Python SDK with low-level Server class for maximum control.

Key features:

  • Efficient response handling with content truncation

  • Metadata-first approach to minimize token usage

  • Support for date ranges and filtering

  • Cross-project search capabilities

License

MIT

Available Tools

8 tools
analyze_sessionsC

Extract and analyze messages from sessions with filtering

ParametersJSON Schema
NameRequiredDescriptionDefault
days_backNoDays back to analyze (max 7)
role_filterNoFilter messages by role (user, assistant, both, tool)both
project_filterNoOptional filter to specific project
include_toolsNoInclude tool usage messages

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations, the description carries full burden. It does not disclose whether the tool modifies data, required permissions, output behavior, or performance constraints. 'Analyze' is ambiguous.

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

Conciseness3/5

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

Single sentence is concise but lacks structure. Could benefit from listing output or key behaviors. Not wasteful but not optimally informative.

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

Completeness2/5

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

Missing output schema; description doesn't specify what 'analyze' returns (e.g., aggregated stats vs. raw messages). Parameters are well-documented but overall completeness is low given sibling tools and lack of return info.

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 coverage is 100%, so each parameter has a description. The description repeats 'filtering' but adds no new meaning beyond the schema. Baseline score is appropriate.

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

Purpose4/5

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

The description clearly states it extracts and analyzes messages with filtering, distinguishing it from sibling tools like list_recent_sessions which likely list sessions without content analysis. However, 'analyze' is somewhat vague.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like search_conversations or summarize_*. No when-not-to-use or prerequisite information.

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

get_message_detailsA

Get full content for specific messages by session ID and message indices

ParametersJSON Schema
NameRequiredDescriptionDefault
session_idYesSession ID to get messages from
message_indicesYesList of message indices to retrieve (max 10)

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'full content' but does not specify what that includes, nor are there details on rate limits, authentication, or side effects.

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 concise sentence that is front-loaded with the action and resource, containing no superfluous words.

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?

The tool is simple with two parameters, but without an output schema, the description should clarify what 'full content' includes; it does not address edge cases or prerequisites, leaving gaps.

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 100% with clear descriptions for both parameters; the description adds no additional meaning beyond the schema, meeting the baseline.

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 retrieves full content for specific messages, using session ID and message indices, which distinguishes it from sibling tools that list sessions, search, or summarize.

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

Usage Guidelines3/5

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

No explicit when-to-use or when-not-to-use guidance is provided, though the purpose implies it should be used when detailed message content is needed rather than listings or summaries.

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

list_projectsB

List all Claude Code projects with session counts and activity

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations, the description fully bears the burden of disclosing behavioral traits. While it implies a read-only listing, it does not explicitly state this, nor does it mention side effects, performance characteristics, or any limitations.

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

Conciseness4/5

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

The description is a single sentence that is concise and to the point. It could benefit from slightly more structure but is efficient with no wasted words.

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?

For a parameterless tool with no output schema and no annotations, the description provides the basic purpose. However, it lacks information about return format, pagination, ordering, or any constraints. Given the simplicity, it is minimally adequate but not fully complete.

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?

There are zero parameters, so the baseline is 4. The description adds meaning by indicating the output includes session counts and activity, which goes beyond the empty input schema.

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 all Claude Code projects and specifies what information is included (session counts and activity). The verb 'list' and resource 'Claude Code projects' are specific, and the additional detail distinguishes it from sibling tools that list sessions.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like list_sessions or search_conversations. The description lacks context on prerequisites, typical use cases, or exclusions.

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

list_recent_sessionsC

List recent sessions across all projects by date range

ParametersJSON Schema
NameRequiredDescriptionDefault
days_backNoHow many days back to search (max 7)
project_filterNoOptional filter to specific project name

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description should disclose behavioral traits such as idempotency or pagination, but it only says 'list' without confirming read-only behavior or any side effects.

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

Conciseness4/5

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

The description is a single concise sentence, but it is somewhat vague and could benefit from additional detail without becoming verbose.

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

Completeness2/5

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

Given the absence of an output schema and complex context, the description does not hint at return values or how results are structured, leaving the agent underinformed.

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?

The schema covers 100% of parameters with descriptions, so the description adds minimal value beyond restating the date range concept, meeting the baseline.

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

Purpose4/5

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

The description clearly states the tool lists recent sessions across projects by date range, but it does not distinguish from the similar sibling tool 'list_sessions'.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool over alternatives like list_sessions or analyze_sessions, and no exclusions or prerequisites are mentioned.

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

list_sessionsC

List sessions for a specific project

ParametersJSON Schema
NameRequiredDescriptionDefault
project_nameYesEncoded project directory name from .claude/projects/ (uses dashes instead of slashes)
days_backNoHow many days back to search (max 7)

TDQS

C2.9/5.0
Behavior2/5

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

No annotations exist, so the description must bear the full burden of behavioral disclosure. It does not mention read-only nature, pagination, ordering, or rate limits. The schema reveals a days_back max of 7, but the description adds no behavioral context beyond that.

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

Conciseness4/5

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

The description is very short and to the point, containing no extraneous words. However, its brevity borders on insufficient for a tool with multiple siblings.

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

Completeness2/5

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

Given no output schema and the presence of siblings with richer descriptions, the description lacks details about the return format, session attributes, or any additional behavior. It is minimally complete for a simple list operation but fails to align with the tool's context.

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 coverage is 100%, with both parameters documented. The description adds no extra meaning beyond the schema, 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.

Purpose4/5

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

Description states 'List sessions for a specific project', which includes a specific verb and resource and hints at a scope qualifier. It distinguishes from siblings like 'list_recent_sessions' by implying project-specificity, but does not explicitly differentiate.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives such as 'list_recent_sessions' or 'analyze_sessions'. The description lacks context about prerequisites or typical use cases.

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

search_conversationsB

Search conversations for specific terms with context windows, role filtering, and time ranges

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term or phrase
context_windowNoNumber of messages before/after match to include (max 5)
days_backNoDays back to search (max 7)
project_filterNoOptional filter to specific project
case_sensitiveNoCase sensitive search
role_filterNoFilter messages by role (user, assistant, both, tool)both
start_timeNoStart time in ISO format (e.g., '2025-09-13T08:00:00'). If specified, will search from this time forward
end_timeNoEnd time in ISO format (e.g., '2025-09-13T12:00:00'). If specified, will search up to this time

TDQS

B3.4/5.0
Behavior3/5

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

The description mentions core capabilities but lacks detail on read-only nature, pagination, or error handling. Without annotations, it partially covers behavioral aspects but misses important transparency on side effects or limitations.

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?

A single, front-loaded sentence that is concise and information-dense, with no wasted words.

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

Completeness2/5

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

Despite high schema coverage, the description is too brief for a tool with 8 parameters and no output schema. It fails to explain return format, how context windows behave, or how time ranges interact, leaving gaps for the agent.

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 coverage is 100%, so baseline is 3. The description adds minimal semantic value beyond listing features already detailed in parameter descriptions, not significantly enhancing understanding.

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 explicitly states the verb 'Search', the resource 'conversations', and highlights key features (context windows, role filtering, time ranges), clearly distinguishing from sibling tools like 'analyze_sessions' and 'summarize_daily_conversations'.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives among the listed siblings. It does not specify which scenarios are appropriate for search vs. analysis or summary tools.

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

summarize_daily_conversationsB

Generate intelligent summary of conversations for a specific date using headless Claude analysis

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYesTarget date in YYYY-MM-DD format
styleNoSummary style: 'journal' (daily recap), 'insights' (learning focus), 'stories' (narrative focus)journal
project_filterNoOptional filter to specific project

TDQS

B3.1/5.0
Behavior2/5

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

No annotations provided, so description must disclose behavior. Mentions 'headless Claude analysis' but fails to explain side effects, authentication needs, or what happens if no conversations exist for the date. Lacks details on scope (user-specific or all conversations).

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

Conciseness4/5

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

Single concise sentence front-loading the core action. Could be slightly more verbose to improve completeness without becoming too long.

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

Completeness2/5

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

Missing expected output format, scope of conversations, and error handling. For a tool with 3 parameters and no output schema, the description is too sparse.

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?

Input schema covers all parameters (100% coverage). Description does not add meaning beyond schema for date, style, or project_filter. 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?

Description clearly states the tool generates a summary of conversations for a specific date using headless Claude analysis. It distinguishes from sibling tools like summarize_time_range (range) and analyze_sessions (different analysis).

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

Usage Guidelines2/5

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

No guidance on when to use this versus alternatives like summarize_time_range or search_conversations. Does not specify prerequisites or exclusions.

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

summarize_time_rangeB

Generate intelligent summary of conversations for a specific time range using headless Claude analysis

ParametersJSON Schema
NameRequiredDescriptionDefault
start_timeYesStart time in ISO format (e.g., '2025-09-13T12:00:00')
end_timeYesEnd time in ISO format (e.g., '2025-09-13T16:00:00')
styleNoSummary style: 'journal' (daily recap), 'insights' (learning focus), 'stories' (narrative focus)journal
project_filterNoOptional filter to specific project

TDQS

B3.4/5.0
Behavior2/5

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

No annotations provided, so the description must disclose behavioral traits. It mentions 'headless Claude analysis' but fails to indicate if the tool is read-only, modifies data, requires special permissions, or has side effects. The output format and any limitations are not described.

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?

A single, front-loaded sentence that clearly states purpose and method. Every word adds value; no fluff. Appropriate for a straightforward tool.

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

Completeness2/5

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

With no output schema, the description should explain return values. It does not mention what the summary contains, its length, format, or how to interpret the result. Given 4 parameters and no output schema, the description is too brief to be fully actionable.

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?

The input schema covers 100% of parameters with descriptions, so baseline is 3. The description does not add significant meaning beyond the schema; it references 'headless Claude analysis' but that doesn't clarify parameter usage. The style parameter is well-documented in the schema.

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 uses a specific verb 'Generate intelligent summary' and clearly identifies the resource 'conversations for a specific time range'. It distinguishes from sibling tools like summarize_daily_conversations by specifying it covers any time range, not just daily. The method 'headless Claude analysis' adds context.

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

Usage Guidelines3/5

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

The description implies the tool is for generating summaries of conversation over a period, but it does not explicitly state when to use this tool versus alternatives like list_sessions, search_conversations, or analyze_sessions. No when-not-to-use or prerequisite conditions are provided.

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. 8 tool updatesv0.1.0
    • First observedanalyze_sessions
    • First observedget_message_details
    • First observedlist_projects
    • First observedlist_recent_sessions
    • First observedlist_sessions
    • First observedsearch_conversations
    • First observedsummarize_daily_conversations
    • First observedsummarize_time_range

TDQS

B3.4/5.0
Disambiguation4/5

Most tools have distinct purposes, but 'summarize_daily_conversations' and 'summarize_time_range' are very similar, differing only in time scope. There is also potential overlap between 'analyze_sessions' and 'search_conversations', though descriptions help differentiate.

Naming Consistency5/5

All tools use a consistent verb_noun pattern in snake_case, such as 'list_projects', 'search_conversations', and 'summarize_time_range'. No mixing of conventions or vague verbs.

Tool Count5/5

With 8 tools, the server is well-scoped for searching and analyzing Claude Code sessions. Each tool serves a clear purpose without unnecessary redundancy.

Completeness4/5

The tool set covers listing, searching, analyzing, and summarizing sessions fairly well. However, it lacks tools for retrieving session metadata or project details beyond listing, which are minor gaps.

Maintenance

ActivityInactive
ResponsivenessSyncing

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

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that enables users to retrieve, filter, and search through Claude Code conversation history stored in local projects. It provides tools for listing projects and sessions, paginating through message history, and searching across conversations with keyword filtering.
    4
    28
    11
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables semantic and keyword search over Claude Code conversation history stored locally, using hybrid search, local embeddings, and time-decay scoring.
    26
    MIT

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/bwads001/cc-session-search'

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