Skip to main content
Glama
Cursor Conversations MCP Server

Cursor Conversations MCP Server

by vltansky

Cursor Chat History MCP

Connect your Cursor conversations to your git history.

Why?

You make a commit. Weeks later you wonder: "Why did I write it this way?"

The git message says fix auth bug but the real context - the debugging session, the alternatives considered, the AI suggestions - lives in a Cursor conversation you'll never find again.

This MCP server automatically links your Cursor conversations to git commits. When you revisit code, the AI assistant can pull up the original discussion.

Related MCP server: AI Conversation Logger

Quick Start

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "cursor-chat-history": {
      "command": "npx",
      "args": ["-y", "--package=cursor-chat-history-mcp", "cursor-chat-history-mcp"]
    }
  }
}

That's it. Hooks install automatically on first use.

What You Can Do

Find Context for Code

"What was the context behind commit abc123?"
"Find the conversation that led to this fix"
"Show discussions about auth.ts from the last month"

Search Your Chat History

"Find all debugging sessions about performance"
"Search conversations mentioning useState"
"List recent conversations in this project"

Extract Patterns

"Create TypeScript guidelines from my actual usage"
"Extract error handling patterns from my conversations"
"Summarize my React patterns from chat history"

Available Tools

Git Linker

Tool

Purpose

get_file_context

Get conversations and commits related to a file

get_commit_conversations

Find conversations linked to a commit

list_conversation_commits

Find commits linked to a conversation

link_conversation_commit

Manually link conversation ↔ commit

Chat History

Tool

Purpose

list_conversations

Browse with filters (project, keywords, files)

get_conversation

Get full conversation content

search_conversations

Multi-keyword and pattern search

get_conversation_analytics

Usage patterns, file activity, language stats

Privacy

  • 100% local - No external services, no API keys

  • Your data stays on disk - SQLite databases only

  • Open source - Audit the code yourself


How It Works

Hooks are installed automatically when the MCP server starts:

  • Cursor hooks (~/.cursor/hooks.json) - capture file edits and session ends

  • Git post-commit hook (current repo) - link commits to conversations

When you commit, the system finds related conversations using:

  • File overlap (70%): Commits touching files discussed in conversations

  • Recency (30%): Conversations from the last 14 days

Efficient Context Retrieval

Large conversations aren't loaded directly into context. Instead:

  1. Use get_file_context with keywords to find relevant conversations

  2. Call get_conversation - writes to ~/.cursor-chat-history/context/conversations/<id>.md

  3. Use Read/Grep tools to navigate the markdown file efficiently

CLI Commands

# Query links
npx cursor-chat-history-mcp link list-conversation-links --conversation <id>
npx cursor-chat-history-mcp link get-commit-links --hash <commit-hash>

# Manual linking
npx cursor-chat-history-mcp link manual --conversation <id> --commit <hash>

Database Locations

Database

macOS

Windows

Linux

Cursor chats

~/Library/Application Support/Cursor/User/globalStorage/state.vscdb

%APPDATA%/Cursor/...

~/.config/Cursor/...

Git links

~/Library/Application Support/CursorChatHistory/links.sqlite

%APPDATA%/CursorChatHistory/...

~/.local/share/CursorChatHistory/...

Context files

~/.cursor-chat-history/context/conversations/

same

same

Override with CURSOR_DB_PATH or CURSOR_LINKS_DB_PATH.

Tool Reference

list_conversations

  • limit (default: 10) - Number of results

  • projectPath - Filter by project

  • keywords - Search keywords

  • hasCodeBlocks - Filter by code presence

get_conversation

  • conversationId (required) - Conversation ID

  • summaryOnly - Return summary only (saves context)

search_conversations

  • query - Text search

  • keywords + keywordOperator ('AND'/'OR') - Multi-keyword

  • likePattern - SQL LIKE patterns

get_conversation_analytics

  • scope - 'all', 'recent', 'project'

  • projectPath - Filter by project

  • includeBreakdowns - ['files', 'languages', 'temporal', 'size']

get_file_context

  • filePath (required) - File to get context for

  • keywords - Filter by keywords (e.g., ["JWT", "auth"]) - returns matching excerpts

  • limit - Max results (default: 5)

list_conversation_commits

  • conversationId - Filter by conversation

  • projectPath - Filter by project

  • filePath - Filter by file

get_commit_conversations

  • commitHash (required) - Git commit hash

link_conversation_commit

  • conversationId (required)

  • commitHash (required)

  • confidence - Link confidence (0-1)

Development

git clone https://github.com/vltansky/cursor-chat-history-mcp
cd cursor-chat-history-mcp
yarn install
yarn build

Supported AI Assistants

Assistant

Status

Notes

Cursor

✅ Full

Chat, Composer, Agent modes

Claude Code

✅ Full

VS Code extension

Cline/Roo/Kilo

✅ Full

JSON task-based storage

Windsurf

✅ Full

SQLite (same pattern as Cursor)

GitHub Copilot Chat

✅ Full

VS Code native

Roadmap

  • Knowledge graph extraction - Extract entities and relationships from conversations (learn more)

  • Multi-agent support - Cline, Windsurf, Copilot Chat

  • Quality scoring - Prioritize conversations with solutions

  • Natural time filters - "last week", "yesterday"

  • Topic clustering - Group by detected themes

  • Semantic search - Find similar conversations via embeddings

Technical Notes

  • Supports legacy and modern Cursor conversation formats

  • Uses ROWID for chronological ordering (UUIDs aren't chronological)

  • Close Cursor to avoid database lock issues

  • See docs/SPEC.md for git linker specification

License

MIT

Available Tools

8 tools
export_conversation_dataA

Export chat data in various formats (JSON, CSV, Graph) for external analysis, visualization, or integration with other tools. TIP: Use filters.projectPath to export only project-specific conversations for focused analysis of a particular codebase. Use this to create datasets for machine learning, generate reports for stakeholders, prepare data for visualization tools like Gephi or Tableau, or backup chat data in structured formats.

Inputs: conversationIds, format, includeContent, includeRelationships, +3 more.

extract_conversation_elementsA

Extract specific elements from conversations such as file references, code blocks, programming languages, folder paths, metadata, or conversation structure. Use this to build knowledge bases, analyze code patterns, extract reusable snippets, understand project file usage, or prepare data for further analysis and documentation.

Inputs: conversationIds, elements, includeContext, groupBy, +2 more.

get_conversationA

Retrieves the complete content of a specific Cursor conversation including all messages, code blocks, file references, title, and AI summary. WORKFLOW TIP: Use conversation IDs from list_conversations, search_conversations, or analytics breakdowns (files/languages arrays contain conversation IDs). Use summaryOnly=true to get enhanced summary data without full message content when you need to conserve context.

Inputs: conversationId (required), summaryOnly, outputMode.

get_conversation_analyticsA

Get comprehensive analytics and statistics about Cursor chats including usage patterns, file activity, programming language distribution, and temporal trends. BEST PRACTICE: Use projectPath parameter for project-specific analytics - this analyzes only conversations that worked on files in that project, providing much more relevant insights for understanding coding patterns, file usage, and development activity within a specific codebase. WORKFLOW TIP: Always include "files" and "languages" in breakdowns - these contain conversation IDs in their arrays that you can immediately use with get_conversation tool. Use includeConversationDetails=true when you need the full conversation ID list and basic metadata for follow-up analysis.

Inputs: scope, projectPath, recentDays, includeBreakdowns, +2 more.

get_system_infoA

Get system information and utilities for AI assistants. Provides current date, timezone, and other helpful context that AI assistants may not have access to. Use this when you need reference information for date filtering, time-based queries, or other system context.

Inputs: info.

list_conversationsA

Lists Cursor chats with summaries, titles, and metadata ordered by recency. HIGHLY RECOMMENDED: Use projectPath parameter to filter conversations by specific project/codebase - this dramatically improves relevance by finding conversations that actually worked on files in that project. Returns conversation IDs for use with get_conversation tool. WORKFLOW TIP: Start with projectPath filtering for project-specific analysis, then call get_conversation with specific IDs from results. Includes AI-generated summaries by default. Supports date range filtering (YYYY-MM-DD format).

Inputs: limit, minLength, hasCodeBlocks, keywords, +9 more.

search_conversationsA

Searches through Cursor chat content using exact text matching (NOT semantic search) to find relevant discussions. WARNING: For project-specific searches, use list_conversations with projectPath instead of this tool! This tool is for searching message content, not project filtering.

WHEN TO USE THIS TOOL:

  • Searching for specific technical terms in message content (e.g., "useState", "async/await")

  • Finding conversations mentioning specific error messages

  • Searching for code patterns or function names

WHEN NOT TO USE THIS TOOL:

  • ❌ DON'T use query="project-name" - use list_conversations with projectPath instead

  • ❌ DON'T search for project names in message content

  • ❌ DON'T use this for project-specific filtering

Search methods (all use exact/literal text matching):

  1. Simple text matching: Use query parameter for literal string matching (e.g., "react hooks")

  2. Multi-keyword: Use keywords array with keywordOperator for exact matching

  3. LIKE patterns: Advanced pattern matching with SQL wildcards (% = any chars, _ = single char)

  4. Date range: Filter by message timestamps (YYYY-MM-DD format)

IMPORTANT: When using date filters, call get_system_info first to know today's date.

Examples: likePattern="%useState(%" for function calls, keywords=["typescript","interface"] with AND operator.

Inputs: query, keywords, keywordOperator, likePattern, +6 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between list_conversations and search_conversations, as both can be used to find conversations, which might cause confusion despite the detailed warnings. The other tools like export, extract, find_related, get, and analytics are clearly differentiated in their functions.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with clear verb_noun structures (e.g., export_conversation_data, list_conversations, get_system_info). This uniformity makes the tool set predictable and easy to navigate for an agent.

    Tool Count5/5

    With 8 tools, the count is well-suited for the server's purpose of managing and analyzing Cursor conversations. It covers core operations like listing, searching, retrieving, analyzing, exporting, and extracting, without being overwhelming or insufficient for the domain.

    Completeness4/5

    The tool set provides comprehensive coverage for conversation analysis, including CRUD-like operations (list, get, search) and advanced features (analytics, export, extraction, finding related). A minor gap is the lack of tools for modifying or deleting conversations, but this is likely intentional for a read-only analysis server.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Provides AI assistants with persistent memory of your project architecture, development history, and technical decisions, allowing them to give context-aware coding help without needing repeated explanations.
      16
      61 npm
      2
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI to automatically search, retrieve, and organize your Cursor chat history across sessions. Supports tagging, nicknames, project-scoped search, and full-text search to maintain context between conversations.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude Code to search and retrieve past chat history from Claude.ai exports and Claude Code sessions, allowing the AI to reference previous conversations and decisions.
      MIT