The Cursor Chat History MCP is a Model Context Protocol server that allows AI assistants to access and analyze your Cursor chat history. This enables personalized coding assistance based on your actual development patterns, helping you generate project-specific rules and extract insights from past problem-solving sessions.
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 allows Cursor to automatically install and run the MCP server when needed.
You can start using the MCP server by asking your AI assistant questions like:
"Analyze my React conversations and create component guidelines"
"Find debugging patterns in my chat history"
"Generate TypeScript coding standards from my actual usage"
"What are the main themes in my recent coding discussions?"
The MCP server provides several tools for accessing and analyzing your chat history:
"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"
"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"
"Find conversations where I discussed specific functions or patterns"
"Search for file-specific discussions across my projects"
"Compare how I've approached similar problems over time"
"Generate API documentation from my service discussions"
"Create technical docs from my auth module conversations"
All tools support JSON output formats via the outputMode
parameter:
json
(default) - Formatted JSON with proper indentation for readabilitycompact-json
- Minified JSON without formatting for minimal sizelist_conversations
limit
(default: 10) - Number of conversations to returnincludeAiSummaries
(default: true) - Include AI-generated summariesprojectPath
- Filter by project pathincludeRelevanceScore
(default: false) - Include relevance scores when filteringhasCodeBlocks
- 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 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 considermaxResults
(default: 10) - Number of resultsminScore
(default: 0.1) - Minimum similarity score (0-1)extract_conversation_elements
conversationIds
- Specific conversations (optional)elements
(default: ['files', 'codeblocks']) - Elements to extractincludeContext
(default: false) - Include surrounding message textgroupBy
(default: 'conversation') - How to group resultsexport_conversation_data
conversationIds
- Specific conversations (optional)format
(default: 'json') - 'json', 'csv', 'graph'includeContent
(default: false) - Include full message textincludeRelationships
(default: false) - Calculate connectionsflattenStructure
(default: false) - Flatten for CSV compatibilityThe MCP server prioritizes your privacy:
The system uses a summary-first approach for efficiency:
This approach allows you to efficiently browse and analyze your chat history, then dive deeper only into conversations that matter for your current task.
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 > MCP and click "Add new global 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-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.