Skip to main content
Glama
S2thend

cursor-history-mcp

by S2thend

Cursor History MCP

🇨🇳 中文文档 | 🇫🇷 Français | 🇪🇸 Español

npm version npm downloads License: MIT Node.js TypeScript

Install MCP Server

MCP server for browsing, searching, exporting, and backing up your Cursor AI chat history.

Bring your Cursor AI chat history directly into Claude. Search past conversations, export sessions, create backups, and generate year-in-review reports—all through natural language. Built on the Model Context Protocol for seamless AI assistant integration.

Free, open-source, and MIT licensed. Built by the community, for the community.

Why This Project?

There are other Cursor history tools out there (like the Python-based Cursor-history-MCP). Here's what makes this one different:

Feature

cursor-history-mcp (this project)

Other Solutions

📦 Setup

npx cursor-history-mcp - zero install

❌ Docker, Python, dependencies

Speed

✅ Instant - direct SQLite reads

❌ Slow - requires LLM vectorization

🔍 Search

✅ Grep-style text matching - precise & stable

❌ Vector retrieval - unpredictable results

🤖 LLM Required

✅ No - works offline

❌ Yes - needs Ollama/embeddings

🛠️ Language

✅ TypeScript (type-safe)

⚠️ Python

💾 Backup/Restore

✅ Built-in

❌ Not available

🚚 Migration

✅ Move sessions between workspaces

❌ Not available

📋 Dependencies

✅ Minimal (just Node.js)

❌ Docker, LanceDB, Ollama, FastAPI

Key Advantages

  • Blazing Fast: No embedding or vectorization step. Reads directly from Cursor's native SQLite database, so results are instant.

  • Grep-Style Search: Uses direct text matching instead of vector retrieval. More lightweight, predictable, and stable for most use cases—no hallucinated results, no embedding drift, and exact matches every time.

  • Zero Configuration: Run with npx - no Docker containers, no Python environments, no API keys, no LLM setup.

  • Works Offline: Everything runs locally without any external services or AI models.

  • Data Portability: Full backup, restore, and cross-workspace migration capabilities to keep your chat history safe and portable.

  • Lightweight: ~50KB package vs multi-GB Docker images with vector databases.

Related MCP server: conversation-history-mcp

Installation

No installation required! Run directly via npx:

npx cursor-history-mcp

Configuration

Cursor

cursor-mcp-setup

Claude Code

Add to your Claude Code MCP settings:

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

Claude Desktop

Add to your Claude Desktop configuration (~/.claude/claude_desktop_config.json):

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

Available Tools

Tool

Description

cursor_history_list

List chat sessions with metadata

cursor_history_show

View full conversation content

cursor_history_search

Search across all sessions

cursor_history_export

Export session to Markdown or JSON

cursor_history_backup

Create backup of all history

cursor_history_restore

Restore from backup (destructive)

cursor_history_migrate

Move/copy sessions between workspaces (destructive)

cursor_history_year_pack

Generate year-in-review data package with stats, topics, and prompt template

🎆 Year in Review

Generate a personalized annual report from your Cursor AI chat history — discover your coding patterns, favorite topics, and development journey.

What You Get

📊 Chat Stats

Total questions, active months, monthly activity

🏷️ Topic Discovery

Auto-detected coding topics and interests

📈 Trend Tracking

How your focus shifted throughout the year

🔑 Keywords

Your most-used terms and phrases

🔒 Privacy Safe

Sensitive data automatically masked

📝 LLM Prompt

Ready-to-use prompt for a polished report

Try It

  • "Generate my 2025 Cursor year in review"

  • "Create a year pack for ~/myapp"

  • "Generate my 2025 year in review in English"

Usage Examples

After configuring, ask your AI assistant:

  • "List my Cursor chat sessions"

  • "Show me session #1"

  • "Search my Cursor history for 'authentication'"

  • "Export session #1 as markdown"

  • "Backup my Cursor chat history"

Requirements

  • Node.js 20+

  • Cursor IDE installed with existing chat history

Contributing

Contributions are welcome! Whether it's bug reports, feature requests, documentation improvements, or code contributions—all PRs and issues are appreciated.

License

MIT

Available Tools

8 tools
cursor_history_backupB

Create a backup of all Cursor AI chat history. Saves a portable archive that can be restored later.

ParametersJSON Schema
NameRequiredDescriptionDefault
outputPathNoPath where the backup file should be saved. If not specified, saves to ~/cursor-history-backups/ with a timestamp.
forceNoOverwrite existing backup file if it exists (default: false)

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description bears full responsibility for behavioral disclosure. It states the tool creates a portable archive that can be restored later, but does not clarify whether the backup reads or modifies the original history, whether permissions are required, or if there are any side effects. This is insufficient for a safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, clearly front-loading the core purpose and a key trait (portable archive). Every word earns its place with no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with two optional parameters and no output schema, the description covers the core functionality but lacks details on what the backup includes, size limits, or return value. It is adequate but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds marginal value by mentioning 'portable archive' but does not explain parameter semantics beyond what the schema already provides (outputPath and force defaults).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a backup') and the resource ('all Cursor AI chat history'), with the additional context that the output is a portable archive. While it doesn't explicitly differentiate from the sibling 'export' tool, the term 'backup' implies a comprehensive snapshot for restoration, which is distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like cursor_history_export or cursor_history_restore. It does not mention prerequisites, context, or exclusion criteria, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cursor_history_exportC

Export a Cursor AI chat session to Markdown or JSON format. Returns the formatted content.

ParametersJSON Schema
NameRequiredDescriptionDefault
sessionIndexYesThe session index (1-based, as shown in list output)
formatNoExport format: 'markdown' for human-readable, 'json' for structured datamarkdown

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description must disclose behavioral traits. It only states that the tool exports and returns formatted content, but does not mention whether the session is modified, any permissions needed, or the nature of the returned content.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently conveys the tool's purpose. It is front-loaded and avoids waste, though it could be slightly expanded for context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of output schema and annotations, the description covers the essential export functionality but lacks details on the return value structure and behavioral nuances, making it marginally adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds minimal extra meaning beyond the schema, except for mentioning 'as shown in list output' for sessionIndex, which provides context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool exports a Cursor AI chat session to Markdown or JSON format. It uses specific verbs and resources, but does not differentiate from sibling tools like cursor_history_show, which may also display a session.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like cursor_history_backup or cursor_history_show. The agent is left to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cursor_history_listA

List Cursor AI chat sessions. Returns recent sessions with metadata including workspace, message count, and timestamps.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of sessions to return (default: 20, max: 1000)
offsetNoNumber of sessions to skip for pagination (default: 0)
workspaceNoFilter sessions by workspace path (absolute path to project folder)

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It mentions returning recent sessions with metadata but does not specify sorting order, pagination behavior, or any constraints like rate limits. Adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences, front-loaded with action and return info. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters, all documented, and no output schema, description could be more complete by explicitly stating pagination via limit/offset and default sorting. Currently leaves some implicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. Description does not add extra parameter semantics beyond what schema provides; it only hints at workspace in output metadata.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it lists Cursor AI chat sessions with specific metadata. Verb 'list' and resource are explicit. Distinguishes from siblings like cursor_history_search which is for searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implicitly clear: use for listing recent sessions, not for searching or exporting. However, no explicit 'when to use' vs alternatives, nor exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cursor_history_migrateA

⚠️ DESTRUCTIVE: Move or copy chat sessions between workspaces. When moving (not copying), the original session is deleted. Consider creating a backup first using cursor_history_backup.

ParametersJSON Schema
NameRequiredDescriptionDefault
sessionIndexesYesList of session indexes to migrate (1-based, as shown in list output)
destinationYesAbsolute path to the destination workspace folder
modeNoMigration mode: 'move' deletes original, 'copy' keeps originalmove

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description prominently warns about the destructive nature when moving, noting that the original is deleted. It suggests a precautionary backup. However, it omits details like permission requirements or behavior if the destination workspace already contains sessions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and impactful, front-loading the destructive warning. Every sentence adds value, and no space is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the description covers the core function and behavioral highlights, it could further explain prerequisites (e.g., destination workspace must exist) or error handling. Given the tool's complexity and no output schema, it is mostly complete but not exhaustive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All parameters are described in the input schema, and the description adds useful context: session indexes are 1-based as shown in list output, destination is an absolute path, and mode effects are clarified. This adds meaningful beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool's purpose: moving or copying chat sessions between workspaces. It distinguishes itself from sibling tools by mentioning backup as a separate action and by specifying the destructive nature of the 'move' mode.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes a recommendation to create a backup first, but does not explicitly state when to use this tool versus alternatives. It implies copying is safer, but lacks clear conditions for use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cursor_history_restoreA

⚠️ DESTRUCTIVE: Restore Cursor AI chat history from a backup file. This operation OVERWRITES your current chat history. Consider creating a backup of your current data first using cursor_history_backup.

ParametersJSON Schema
NameRequiredDescriptionDefault
backupPathYesPath to the backup file to restore from
forceNoSkip confirmation and force overwrite of existing data (default: false)

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully discloses the destructive behavior: it uses '⚠️ DESTRUCTIVE', states 'OVERWRITES your current chat history', and recommends creating a backup. This is transparent and goes beyond minimal expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one short, highly efficient sentence with a warning symbol front-loaded. Every word serves a purpose, and the structure is clear with no wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description does not explain return values, but the restore operation's outcome is typically success/failure. It covers the key behavioral aspects (destructiveness, parameter usage, backup recommendation). Minor gaps exist, like what happens on invalid backup file, but overall it is adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and describes both parameters (backupPath and force) adequately. The description adds no extra semantic meaning beyond what the schema provides, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it restores Cursor AI chat history from a backup file, with a specific verb (restore) and resource (chat history). It distinguishes from sibling tools like cursor_history_backup (which creates backups) and cursor_history_export (exports to other formats).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly warns about the destructive nature and recommends creating a backup first, providing clear guidance on when to use this tool. However, it does not explicitly mention when not to use or suggest alternatives beyond the implicit sibling context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cursor_history_showA

Show the full content of a specific Cursor AI chat session including all messages, tool calls, and AI responses.

ParametersJSON Schema
NameRequiredDescriptionDefault
sessionIndexYesThe session index (1-based, as shown in list output)

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations; description implies read-only but doesn't confirm. Includes content scope (messages, tool calls, responses) but omits auth requirements, data source, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no redundancy, front-loaded with action and target.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Simple tool; schema covers only param. Description explains output includes messages/tool calls/responses. Lacks return structure or format, but adequate for typical show tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema already describes sessionIndex with meaning (1-based, from list). Description adds no extra parameter info beyond schema, achieving baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool retrieves full session content, distinguishing it from siblings like list (indexed listing) and search (querying). Verb 'show' matches resource 'history'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use vs. siblings. Doesn't mention prerequisite of list to obtain sessionIndex or alternatives like search.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

cursor_history_year_packA

Generate a year-in-review data package from Cursor AI chat history. Produces a sanitized JSON summary with statistics, topics, and keywords, plus a prompt template for LLM-based report generation. Read-only operation.

ParametersJSON Schema
NameRequiredDescriptionDefault
yearNoCalendar year to analyze (default: current year)
languageNoReport language preference (default: en)
workspaceNoOptional workspace path to filter sessions
maxSamplesNoMaximum sample questions to include (default: 30)
maxSampleLengthNoMaximum characters per sample (default: 120)
topicsCountNoNumber of topics to extract (default: 7)

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It explicitly calls out 'Read-only operation' and 'sanitized JSON', which are key behavioral traits. However, it does not mention performance implications or potential side effects like long processing time.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, extremely concise, and front-loaded with the core purpose. Every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 optional parameters and no output schema, the description adequately covers the core functionality and safety. It mentions the output format (JSON summary + prompt template). Could be improved by explaining 'sanitized' or typical processing time.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description does not add any additional meaning beyond what the schema already provides for each parameter. It only gives high-level output summary.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'generate', the resource 'year-in-review data package from Cursor AI chat history', and the output (sanitized JSON summary plus prompt template). It distinguishes from sibling tools like 'search' or 'list' by being specifically for annual analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions it's read-only, implying safety, but does not explicitly state when to use this tool versus siblings like cursor_history_search or cursor_history_show. No alternatives or exclusions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 8 tool updatesv0.2.4
    • First observedcursor_history_backup
    • First observedcursor_history_export
    • First observedcursor_history_list
    • First observedcursor_history_migrate
    • First observedcursor_history_restore
    • First observedcursor_history_search
    • First observedcursor_history_show
    • First observedcursor_history_year_pack

TDQS

A3.8/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: backup creates archives, restore overwrites from archives, migrate moves/copies sessions, export formats output, list shows metadata, search finds by keyword, show displays full content, and year_pack generates analytics. No two tools overlap in functionality.

Naming Consistency5/5

All tools follow the consistent pattern 'cursor_history_[verb]', using snake_case and a clear verb (backup, export, list, migrate, restore, search, show, year_pack). This allows an agent to predict tool names easily.

Tool Count5/5

With 8 tools, the server is well-scoped for managing Cursor chat history. Each tool serves a necessary function without redundancy or bloat. The count fits the domain perfectly.

Completeness4/5

The tool set covers core operations: list, show, search (read), export (output), backup/restore (persistence), migrate (move/copy), and year_pack (analytics). A minor gap is the lack of a dedicated delete tool, though migrate can achieve deletion indirectly. Overall, it's comprehensive for the domain.

Maintenance

ActivityInactive
ResponsivenessSlow

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Capture, index, and search your Claude Code conversation history. Provides an MCP server for Claude Code to query its own past conversations.
    3
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/S2thend/cursor-history-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server