Claude Code History MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Claude Code History MCP Serversearch my recent sessions for 'OAuth implementation'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Claude Code History MCP Server
An MCP server for retrieving and analyzing Claude Code conversation history with smart filtering and pagination.
Features
This MCP server provides 4 powerful tools for exploring your Claude Code conversation history:
1. list_projects 👀 Start Here
Discover all projects with Claude Code conversation history.
Why use this first: Get an overview of all available data before diving deeper.
Returns: Project paths, session counts, message counts, and last activity time.
2. list_sessions 📁 Explore Sessions
List conversation sessions for exploration and filtering.
Parameters:
projectPath(optional): Filter by specific projectstartDate(optional): Start date (e.g., "2025-06-30")endDate(optional): End date (e.g., "2025-06-30")timezone(optional): Timezone for date filtering (e.g., "Asia/Tokyo", "UTC")
Returns: Session IDs, timestamps, message counts, and project paths.
3. get_conversation_history 💬 Get Detailed Data
Retrieve paginated conversation history with smart filtering.
Key Features:
Pagination:
limit(default: 20) andoffsetfor efficient data handlingMessage Filtering:
messageTypesdefaults to["user"]to reduce data volumeTimezone Support: Automatic timezone detection or specify (e.g., "Asia/Tokyo")
Date Filtering: Smart date normalization with timezone awareness
Parameters:
sessionId(optional): Specific session IDstartDate(optional): Start date (e.g., "2025-06-30")endDate(optional): End date (e.g., "2025-06-30")limit(optional): Max entries per page (default: 20)offset(optional): Skip entries for pagination (default: 0)messageTypes(optional):["user"](default),["user", "assistant"], etc.timezone(optional): e.g., "Asia/Tokyo", "UTC" (auto-detected)
Example:
{
"startDate": "2025-06-30",
"limit": 50,
"messageTypes": ["user"],
"timezone": "Asia/Tokyo"
}Response includes pagination info:
{
"entries": [...],
"pagination": {
"total_count": 150,
"limit": 20,
"offset": 0,
"has_more": true
}
}4. search_conversations 🔍 Find Specific Content
Search across all conversation content by keywords with advanced filtering.
Parameters:
query(required): Search termslimit(optional): Max results (default: 30)projectPath(optional): Filter by specific project pathstartDate(optional): Start date (e.g., "2025-06-30")endDate(optional): End date (e.g., "2025-06-30")timezone(optional): Timezone for date filtering (e.g., "Asia/Tokyo", "UTC")
Related MCP server: ClaudeHistoryMCP
Quick Start
# Install directly via npx (no local installation needed)
npx claude-code-history-mcp
# Or install globally
npm install -g claude-code-history-mcpUsage with MCP Clients
Add the following configuration to your MCP client (e.g., Claude Desktop):
{
"mcpServers": {
"claude-code-history": {
"command": "npx",
"args": ["claude-code-history-mcp"]
}
}
}Alternatively, if you have installed the package globally:
{
"mcpServers": {
"claude-code-history": {
"command": "claude-code-history-mcp"
}
}
}Recommended Workflow 🚀
1. Explore Available Data
// Start with list_projects to see what's available
{"tool": "list_projects"}2. Find Relevant Sessions
// List sessions for a specific project or date range with timezone
{
"tool": "list_sessions",
"projectPath": "/Users/yourname/code/my-project",
"startDate": "2025-06-30",
"timezone": "Asia/Tokyo"
}3. Get Targeted Data
// Get conversation history with optimal settings
{
"tool": "get_conversation_history",
"sessionId": "specific-session-id",
"messageTypes": ["user"], // Only your inputs (default)
"limit": 50
}Data Source
This server reads Claude Code history files (.jsonl format) stored in ~/.claude/projects/.
Smart Features 💡
Message Type Filtering
Default: Only
["user"]messages to reduce data volumeFull conversation: Use
["user", "assistant"]Everything: Use
["user", "assistant", "system", "result"]
Timezone Intelligence
Automatically detects your system timezone
Supports explicit timezone specification (e.g., "Asia/Tokyo")
Smart date normalization (e.g., "2025-06-30" → proper timezone bounds)
Pagination Support
Efficient handling of large datasets
total_counthelps you understand data volumehas_moreindicates if there's additional data
Use Cases
Daily Work Review
What did I work on today?list_projects→ See active projectsget_conversation_historywith today's date andmessageTypes: ["user"]
Project Deep Dive
Analyze my recent work on Project Xlist_sessionswith specific project pathget_conversation_historyfor relevant sessionsUse pagination to browse through all data
Topic Research
Find all conversations about "API integration" in a specific projectsearch_conversationswith query "API integration", projectPath, and date rangeUse results to identify relevant sessions
get_conversation_historyfor detailed context
Example with advanced filtering:
{
"tool": "search_conversations",
"query": "API integration",
"projectPath": "/Users/yourname/code/my-project",
"startDate": "2025-06-01",
"endDate": "2025-06-30",
"timezone": "Asia/Tokyo",
"limit": 50
}License
MIT
Available Tools
4 toolsget_conversation_historyA
Get paginated conversation history (use after exploring with list_projects/list_sessions for targeted data)
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of conversations to return (default: 20) | |
| offset | No | Number of conversations to skip for pagination (default: 0) | |
| endDate | No | End date in ISO format (optional) | |
| timezone | No | Timezone for date filtering (e.g., "Asia/Tokyo", "UTC"). Defaults to system timezone. | |
| sessionId | No | Specific session ID to get history for (optional) | |
| startDate | No | Start date in ISO format (optional) | |
| messageTypes | No | Filter by specific message types. Defaults to ["user"] to reduce data volume. Use ["user", "assistant"] to include Claude responses. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of disclosing behavioral traits. It mentions 'paginated' and 'targeted data,' but it does not reveal key behaviors like the default messageTypes filter (['user']) to reduce data volume, or whether the operation is read-only. It also fails to mention pagination limits or response format, which are important for an API with no output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that immediately states the action and then provides usage context in parentheses. Every word earns its place, with no redundant or filler content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 7 parameters, no output schema, and no annotations, the description should provide more context about expected return values and important behaviors. It omits any mention of response structure, default message filtering, or how to use parameters together. The description is too brief to be considered complete for a tool of this complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds minimal parameter meaning beyond the schema, only hinting at 'targeted data' which suggests filtering capabilities. It does not elaborate on how parameters interact (e.g., startDate/endDate requiring timezone), but the schema definitions already provide clear descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb and resource: 'Get paginated conversation history.' It also distinguishes itself from sibling tools by positioning it as a follow-up to list_projects/list_sessions for targeted data retrieval, making it unique.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly guides when to use this tool: 'use after exploring with list_projects/list_sessions for targeted data.' This provides clear context and implies that list_projects/list_sessions are for broader exploration. However, it does not explicitly mention when not to use it or compare with search_conversations, so it lacks full exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_projectsA
List all projects with Claude Code conversation history (start here to explore available data)
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
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 reveals that the tool filters to only projects with conversation history, which is useful. However, it does not describe output format, ordering, pagination, or potential limitations, leaving some gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the core action and resource. It includes a helpful usage hint without unnecessary detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's minimal complexity (no parameters, no annotations, no output schema), the description sufficiently conveys its purpose and basic return scope. It lacks explicit return-field details but remains adequate for a simple list tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the schema provides complete coverage of an empty set. The description does not need to explain parameters, but the baseline of 4 for no-parameter tools is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool 'List all projects with Claude Code conversation history', using a specific verb and resource. It distinguishes itself from siblings like list_sessions (lists sessions) and search_conversations (searches conversations) by focusing on projects.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'start here to explore available data' provides clear guidance on when to use this tool as an entry point. It suggests usage context but does not explicitly mention alternatives or exclusions, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_sessionsA
List conversation sessions for a project or date range (use after list_projects to find specific sessions)
| Name | Required | Description | Default |
|---|---|---|---|
| endDate | No | End date in ISO format (optional) | |
| timezone | No | Timezone for date filtering (e.g., "Asia/Tokyo", "UTC"). Defaults to system timezone. | |
| startDate | No | Start date in ISO format (optional) | |
| projectPath | No | Filter by specific project path (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It offers no extra behavioral details such as default behavior when no filters are supplied, result ordering, pagination, or access limits. It essentially restates the tool's basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence of 12 words, efficiently combining purpose and a usage hint. Every word contributes value, with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 4 optional parameters and no output schema, the description covers purpose and workflow but omits default behavior and return format. It is serviceable but leaves some gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description's 'project or date range' phrasing loosely maps to the parameters but adds no additional meaning beyond the schema definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear action ('List') and resource ('conversation sessions') with scope ('for a project or date range'). It is unambiguous, though it does not explicitly distinguish from sibling tools like search_conversations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit workflow guidance ('use after list_projects to find specific sessions'), which is helpful context. However, it does not mention alternatives or when not to use this tool, so it lacks exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_conversationsA
Search through conversation history by content (useful for finding specific topics across all conversations)
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (default: 30) | |
| query | Yes | Search query to find in conversation content | |
| endDate | No | End date in ISO format (optional) | |
| timezone | No | Timezone for date filtering (e.g., "Asia/Tokyo", "UTC"). Defaults to system timezone. | |
| startDate | No | Start date in ISO format (optional) | |
| projectPath | No | Filter by specific project path (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description bears full responsibility for disclosing behavioral traits. It merely restates the action without mentioning read-only nature, return format, sorting, or potential side effects. This offers essentially no guidance beyond the tool's purpose.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler words. It efficiently communicates the core purpose and a usage context, earning a perfect score for conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a search tool with six parameters and no output schema, the description omits crucial details such as result format, query matching behavior, date range semantics, and potential limitations. Without annotations, this minimal description is incomplete for a complex tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so parameters are well-documented in the input schema. The description adds no additional parameter-specific context, leaving it at the baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function with a specific verb ('Search') and resource ('conversation history'), and the parenthetical ('useful for finding specific topics across all conversations') clarifies its scope and differentiates it from sibling tools like get_conversation_history.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool ('useful for finding specific topics across all conversations') but does not explicitly mention alternatives or exclusions. Since siblings exist, an explicit when-not-to-use would elevate it to a 5.
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.
4 tool updates
v1.1.1- First observed
get_conversation_history - First observed
list_projects - First observed
list_sessions - First observed
search_conversations
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: listing projects, listing sessions, retrieving conversation history, and searching across history. The descriptions even guide the agent on the proper exploration flow, eliminating any ambiguity.
All tool names follow the same verb_noun pattern (list_projects, list_sessions, get_conversation_history, search_conversations), making the API predictable and easy to navigate.
The server is scoped to browsing and searching Claude Code history, and four tools cover this purpose without being excessive or sparse. Each tool is essential and earns its place.
The tool surface provides a complete workflow for exploring conversation history: discover projects, list sessions, retrieve detailed history, and search for specific content. No obvious gaps for a read-only history viewer.
Maintenance
Related MCP Connectors
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
An MCP server that provides congressional transcripts
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server that lets you search your Claude Code conversation history to find past solutions, track file changes, and learn from previous work.8157 npm178MIT
- AlicenseAqualityDmaintenanceAn MCP server that makes Claude Code conversation history searchable and proactively useful by indexing past sessions with hybrid BM25+TF-IDF search, extracting decisions and solutions, and auto-injecting relevant project context at session start.96 npm66MIT
- FlicenseBqualityDmaintenanceAn MCP server that provides tools for searching and analyzing Claude Code conversation history.84-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables semantic and keyword search over Claude Code conversation history stored locally, using hybrid search, local embeddings, and time-decay scoring.10 npmMIT