Cursor Chat History MCP is a specialized server that gives AI assistants access to your Cursor chat history, enabling them to provide personalized coding assistance based on your development patterns. This local MCP server allows you to analyze conversations, generate project-specific rules, and extract insights from your coding discussions without sending data to external services.
Add the following configuration to your .cursor/mcp.json
file:
{
"mcpServers": {
"cursor-chat-history": {
"command": "npx",
"args": ["-y", "--package=cursor-chat-history-mcp", "cursor-chat-history-mcp"]
}
}
}
This configuration automatically handles the installation and setup of the MCP server through npx.
Once configured, you can start asking your AI assistant questions about your chat history:
Browsing and Retrieving Conversations
list_conversations
get_conversation
search_conversations
Example usage:
"List my 5 most recent conversations about React hooks"
"Get the full details of my conversation about database migrations"
"Search all conversations mentioning authentication issues"
get_conversation_analytics
find_related_conversations
extract_conversation_elements
export_conversation_data
Example usage:
"Generate analytics on my TypeScript coding patterns over the last month"
"Find conversations related to my current authentication discussion"
"Extract all code blocks from conversations about Redux"
"Export my React discussions to CSV for further analysis"
Ask the AI to analyze your conversations and create custom coding standards:
"Create TypeScript interface naming conventions from my conversations"
"Extract error handling patterns and create guidelines"
"Find all my discussions about testing and create best practices"
Identify patterns in your coding approach:
"Show me how I typically use React hooks in my projects"
"Find patterns in my state management discussions"
"Analyze my class inheritance usage and create guidelines"
Generate documentation based on your development discussions:
"Generate API documentation from my service discussions"
"Create technical docs from my auth module conversations"
Reuse your own problem-solving approaches:
"Find similar debugging sessions and extract solutions"
"Analyze my performance optimization discussions"
All tools support different JSON output formats:
json
(default) - Formatted JSON with proper indentationcompact-json
- Minified JSON without formattinglist_conversations
limit
(default: 10) - Number of conversations to returnincludeAiSummaries
(default: true) - Include AI-generated summariesprojectPath
- Filter by project pathincludeRelevanceScore
(default: false) - Include relevance scoreshasCodeBlocks
- Filter conversations with/without codekeywords
- Search by keywordsfilePattern
- Filter by file patternget_conversation
conversationId
(required) - Conversation to retrievesummaryOnly
(default: false) - Get enhanced summary without full contentincludeMetadata
(default: false) - Include additional metadatasearch_conversations
query
- Basic text searchkeywords
- Array of keywords with keywordOperator
('AND'/'OR')likePattern
- SQL LIKE patterns (% = any chars, _ = single char)searchType
(default: 'all') - 'all', 'project', 'files', 'code'maxResults
(default: 10) - Maximum resultsincludeCode
(default: true) - Include code blocksget_conversation_analytics
scope
(default: 'all') - 'all', 'recent', 'project'projectPath
- Focus on specific projectrecentDays
(default: 30) - Time window for recent scopeincludeBreakdowns
(default: ['files', 'languages']) - Analysis typesfind_related_conversations
referenceConversationId
(required) - Starting conversationrelationshipTypes
(default: ['files']) - Types of relationships to findmaxResults
(default: 10) - Number of resultsminScore
(default: 0.1) - Minimum similarity score (0-1)extract_conversation_elements
conversationIds
- Specific conversations to processelements
(default: ['files', 'codeblocks']) - Elements to extractincludeContext
(default: false) - Include surrounding message textgroupBy
(default: 'conversation') - Grouping methodexport_conversation_data
conversationIds
- Specific conversations to exportformat
(default: 'json') - 'json', 'csv', 'graph'includeContent
(default: false) - Include full message textincludeRelationships
(default: false) - Calculate connectionsflattenStructure
(default: false) - Flatten for CSV compatibilityThe Cursor Chat History MCP server offers strong privacy protections:
The server automatically detects your Cursor chat database at:
~/Library/Application Support/Cursor/User/globalStorage/state.vscdb
%APPDATA%/Cursor/User/globalStorage/state.vscdb
~/.config/Cursor/User/globalStorage/state.vscdb
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "cursor-chat-history" '{"command":"npx","args":["-y","--package=cursor-chat-history-mcp","cursor-chat-history-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-chat-history": {
"command": "npx",
"args": [
"-y",
"--package=cursor-chat-history-mcp",
"cursor-chat-history-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"cursor-chat-history": {
"command": "npx",
"args": [
"-y",
"--package=cursor-chat-history-mcp",
"cursor-chat-history-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect