
Cursor Chat History
Analyzes your local Cursor chat history to find development patterns, search past conversations, and link coding discussions to git commits for better context.
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.
What it does
- Search through Cursor chat conversations
- Generate analytics on coding patterns and language usage
- Link conversations to git commits automatically
- Export chat data in JSON, CSV, and graph formats
- Extract code blocks and file references from conversations
- Find related conversations by shared files or timeframe
Best for
About Cursor Chat History
Cursor Chat History is a community-built MCP server published by vltansky that provides AI assistants with tools and capabilities via the Model Context Protocol. Analyze your Cursor Chat History for coding insights, development patterns, and best practices with powerful search and It is categorized under analytics data, developer tools. This server exposes 8 tools that AI clients can invoke during conversations and coding sessions.
How to install
You can install Cursor Chat History in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
License
Cursor Chat History is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Tools (8)
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).
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.
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.
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.
Find conversations related to a reference conversation based on shared files, folders, programming languages, similar size, or temporal proximity. Use this to discover related discussions, find conversations about the same codebase/project, identify similar problem-solving sessions, or trace the evolution of ideas across multiple conversations.
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.
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:
- Use
get_file_contextwithkeywordsto find relevant conversations - Call
get_conversation- writes to~/.cursor-chat-history/context/conversations/<id>.md - 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
Core Tools Parameters
list_conversations
limit(default: 10) - Number of resultsprojectPath- Filter by projectkeywords- Search keywordshasCodeBlocks- Filter by code presence
get_conversation
conversationId(required) - Conversation IDsummaryOnly- Return summary only (saves context)
search_conversations
query- Text searchkeywords+keywordOperator('AND'/'OR') - Multi-keywordlikePattern- SQL LIKE patterns
get_conversation_analytics
scope- 'all', 'recent', 'project'projectPath- Filter by projectincludeBreakdowns- ['files', 'languages', 'temporal', 'size']
Git Linker Tools Parameters
get_file_context
filePath(required) - File to get context forkeywords- Filter by keywords (e.g.,["JWT", "auth"]) - returns matching excerptslimit- Max results (default: 5)
list_conversation_commits
conversationId- Filter by conversationprojectPath- Filter by projectfilePath- 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
Alternatives
Related Skills
Browse all skillsAnalyzes your recent Claude Code chat history to identify coding patterns, development gaps, and areas for improvement, curates relevant learning resources from HackerNews, and automatically sends a personalized growth report to your Slack DMs.
Automatic conversation backup system for Obsidian with incremental snapshots, hourly breakdowns, and formatted chat-style markdown. Use when setting up conversation archival, preventing data loss from /new resets, or organizing chat history in Obsidian vault with proper formatting (colored callouts, timestamps, multi-paragraph support).
Use when building MCP servers or clients that connect AI systems with external tools and data sources. Invoke for MCP protocol compliance, TypeScript/Python SDKs, resource providers, tool functions.
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
CCXT cryptocurrency exchange library for TypeScript and JavaScript developers (Node.js and browser). Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors. Use when working with crypto exchanges in TypeScript/JavaScript projects, trading bots, arbitrage systems, or portfolio management tools. Includes both REST and WebSocket examples.
.NET/C# backend developer for ASP.NET Core APIs with Entity Framework Core. Builds REST APIs, minimal APIs, gRPC services, authentication with Identity/JWT, authorization, database operations, background services, SignalR real-time features. Activates for: .NET, C#, ASP.NET Core, Entity Framework Core, EF Core, .NET Core, minimal API, Web API, gRPC, authentication .NET, Identity, JWT .NET, authorization, LINQ, async/await C#, background service, IHostedService, SignalR, SQL Server, PostgreSQL .NET, dependency injection, middleware .NET.