Cursor Chat History MCP server

Analyzes local Cursor chat history to extract development patterns, usage insights, and coding best practices with tools for searching conversations, generating analytics, and exporting data in multiple formats for personalized development assistance.
Back to servers
Setup instructions
Provider
vltansky
Release date
Jun 08, 2025
Language
TypeScript
Stats
12 stars

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.

Installation

Setting Up the MCP Server

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.

Usage

Basic Prompts

Once configured, you can start asking your AI assistant questions about your chat history:

  • "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?"

Available Tools

Core Tools

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"

Analytics & Data Extraction

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"

Common Use Cases

Generate Coding Rules

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"

Extract 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"

Create Project Documentation

Generate documentation based on your development discussions:

"Generate API documentation from my service discussions"
"Create technical docs from my auth module conversations"

Learn From Past Solutions

Reuse your own problem-solving approaches:

"Find similar debugging sessions and extract solutions"
"Analyze my performance optimization discussions"

Tool Reference

Output Format Options

All tools support different JSON output formats:

  • json (default) - Formatted JSON with proper indentation
  • compact-json - Minified JSON without formatting

Core Tool Parameters

list_conversations

  • limit (default: 10) - Number of conversations to return
  • includeAiSummaries (default: true) - Include AI-generated summaries
  • projectPath - Filter by project path
  • includeRelevanceScore (default: false) - Include relevance scores
  • hasCodeBlocks - Filter conversations with/without code
  • keywords - Search by keywords
  • filePattern - Filter by file pattern

get_conversation

  • conversationId (required) - Conversation to retrieve
  • summaryOnly (default: false) - Get enhanced summary without full content
  • includeMetadata (default: false) - Include additional metadata

search_conversations

  • query - Basic text search
  • keywords - 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 results
  • includeCode (default: true) - Include code blocks

Analytics Tool Parameters

get_conversation_analytics

  • scope (default: 'all') - 'all', 'recent', 'project'
  • projectPath - Focus on specific project
  • recentDays (default: 30) - Time window for recent scope
  • includeBreakdowns (default: ['files', 'languages']) - Analysis types

find_related_conversations

  • referenceConversationId (required) - Starting conversation
  • relationshipTypes (default: ['files']) - Types of relationships to find
  • maxResults (default: 10) - Number of results
  • minScore (default: 0.1) - Minimum similarity score (0-1)

extract_conversation_elements

  • conversationIds - Specific conversations to process
  • elements (default: ['files', 'codeblocks']) - Elements to extract
  • includeContext (default: false) - Include surrounding message text
  • groupBy (default: 'conversation') - Grouping method

export_conversation_data

  • conversationIds - Specific conversations to export
  • format (default: 'json') - 'json', 'csv', 'graph'
  • includeContent (default: false) - Include full message text
  • includeRelationships (default: false) - Calculate connections
  • flattenStructure (default: false) - Flatten for CSV compatibility

Privacy & Security

The Cursor Chat History MCP server offers strong privacy protections:

  • Runs completely locally - your chat data never leaves your machine
  • No external services are used to process your data
  • No API keys required
  • You have full control over what data is accessed and when

Technical Details

Database Locations

The server automatically detects your Cursor chat database at:

  • macOS: ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb
  • Windows: %APPDATA%/Cursor/User/globalStorage/state.vscdb
  • Linux: ~/.config/Cursor/User/globalStorage/state.vscdb

Important Notes

  • Close Cursor before running intensive operations to avoid database lock issues
  • The server filters out conversations smaller than 1000 bytes to exclude empty ones
  • The system uses ROWID for chronological ordering

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later