Cursor Chat History Vectorizer & Dockerized Search MCP

MCP开发工具

提供方 markelaugust74

开发工具 stdio · 本地进程 会话登录 社区 / 第三方 ClaudeCursorVS CodeCodex
查看接入方式

API service to search vectorized Cursor IDE chat history using LanceDB and Ollama

一句话选型结论

按资料字段整理

Cursor Chat History Vectorizer & Dockerized Search MCP 属于开发工具类 MCP 服务器,stdio · 本地进程,会话登录,可直接接入 Claude、Cursor、VS Code 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类开发工具 传输方式stdio · 本地进程 鉴权会话登录 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

开发工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

api docker self hosted embeddings chat history rag fastapi vector database

支持客户端

适用场景

apidockerself hosted

安装与配置

stdio · 本地进程 会话登录
客户端在本机拉起子进程,数据不出本机
pip install ollama lancedb pyarrow pandas python-dotenv\r

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 python,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
代码与仓库操作

在对话里直接查代码、提 issue、走 PR,省掉来回切工具。

本地命令与脚本

把构建、测试、格式化这类重复命令交给模型执行。

接口联调与测试

让模型调你的接口、跑一遍用例,快速定位问题。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude、Cursor、VS Code,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好会话登录对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude、Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Cursor Chat History Vectorizer & Dockerized Search MCP当前 未标注 stdio · 本地进程 本地部署 有 未标注
Git 838e2ec1 12 stdio · 本地进程 本地部署 有 2026-05-17
Markitdown MCP 2c653a5f 1 stdio · 本地进程 本地部署 有 2026-05-17
JavaGuide 未标注 stdio · 本地进程 本地部署 有 2026-04-11
awesome-claude-skills 未标注 stdio · 本地进程 本地部署 有 2026-04-26
Context7 831acf40 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

开发工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方markelaugust74上游标注的维护方 markelaugust74
分类开发工具本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式会话登录远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · python本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

10.3 KB
来自项目仓库与上游目录的原文,未做删改

Cursor Chat History Vectorizer & Dockerized Search MCP

Vectorize your Cursor chat history and serve it via a simple search API.

This project provides tools to:
1. Extract chat history from local Cursor IDE data (state.vscdb files within workspace storage).
2. Generate text embeddings for user prompts using a local Ollama instance (nomic-embed-text).
3. Store the extracted prompts and their embeddings in a LanceDB vector database.
4. Include a Dockerized FastAPI application (referred to as an "MCP server" in this context) to search this LanceDB database via a simple API endpoint.

✨ Project Goal

The primary goal is to make your Cursor chat history searchable and usable for Retrieval Augmented Generation (RAG) or other LLM-based analysis by:

  • Converting user prompts into vector embeddings stored efficiently in LanceDB.
  • Providing a simple and accessible API server to perform vector similarity searches against your vectorized history.

🚀 Features

  • Data Extraction: Scans specified Cursor workspace storage paths for state.vscdb SQLite files.
  • Prompt Extraction: Extracts user prompts from the aiService.prompts key within the database files.
  • Embedding Generation: Uses a locally running Ollama instance to generate embeddings for extracted prompts.
    • Embedding Model: nomic-embed-embed-text:latest (default dimension 768).
  • Vector Database Storage: Stores original text, source file, role, and vector embeddings in a LanceDB database.
    • LanceDB URI: ./cursor_chat_history.lancedb (for the extractor) / /data/cursor_chat_history.lancedb (inside Docker container)
    • Table Name: chat_history
  • Dockerized Search : Includes a Dockerfile to build a container for the Fast search server.
  • Fast Server (main.py): Acts as the "MCP server" for handling search requests.
  • ** Endpoints:**
    • /search_chat_history (POST): Performs vector similarity search.
    • /health (GET): Checks server status and connections (Ollama, LanceDB).

📋 Requirements

For Running the Extraction Script (cursor_history_extractor.py):

  • Python 3.7+
  • Ollama: Ensure Ollama is installed and running on your local machine. Pull the nomic-embed-text model:bash ollama pull nomic-embed-text:latest
  • Python Packages: Install required packages:bash pip install ollama lancedb pyarrow pandas python-dotenv
  • File Access: Read access to your Cursor workspace storage directory (default: C:\Users\\AppData\Roaming\Cursor\User\workspaceStorage).

For Running the Search API (main.py) via Docker:

  • Docker Desktop (Windows/Mac) or Docker Engine (Linux).
  • An accessible Ollama instance from the Docker container's network.
  • The LanceDB database directory (./cursor_chat_history.lancedb) already created by the extraction script.

⚙️ Setup & Configuration

The process involves two main steps:

  1. Run the extraction script to create or update the LanceDB database on your host machine.
  2. Build and run the Docker container for the search API, mounting the database created in Step 1.

Step 1: Extract & Create Database (Host Machine)

  1. Clone/Download the Project:bash git clone https://github.com/markelaugust74/Cursor-history-MCP.git cd Cursor-history-API
  2. Install Python dependencies for the extractor:bash pip install -r requirements.txt
  3. Verify Paths (if necessary):
    • Update the WORKSPACE_STORAGE_PATH variable in cursor_history_extractor.py if your Cursor data is not in the default location.
    • Ensure you have write permissions in the directory where you run the script, as ./cursor_chat_history.lancedb will be created here.
  4. Ensure Ollama is Running: Start your Ollama server and confirm nomic-embed-text:latest is available (ollama list).
  5. Execute the extraction script:bash python cursor_history_extractor.py
    This script will print progress and, if successful, create the ./cursor_chat_history.lancedb directory containing your vectorized history.

Step 2: Build & Run API Docker Container

  1. Navigate to the project directory containing the Dockerfile, main.py, and the ./cursor_chat_history.lancedb directory created in Step 1.
  2. Build the Docker image:bash docker build -t cursor-chat-search-api .
  3. Run the Docker container:bash docker run -p 8001:8001 \ -v /path/to/your/cursor_chat_history.lancedb:/data/cursor_chat_history.lancedb \ -e OLLAMA_HOST="http://host.docker.internal:11434" \ cursor-chat-search-api
    • -p 8001:8001: Maps port 8001 on your host machine to port 8001 inside the container (where the FastAPI app runs).
    • -v /path/to/your/cursor_chat_history.lancedb:/data/cursor_chat_history.lancedb: This is CRUCIAL. Replace /path/to/your/cursor_chat_history.lancedb with the absolute path on your host machine to the cursor_chat_history.lancedb directory created by the extraction script. This mounts your host database into the container at /data/cursor_chat_history.lancedb, the location expected by main.py. (Use forward slashes for paths even on Windows in Docker commands, or ensure proper escaping/configuration).
    • -e OLLAMA_HOST="...": Sets the OLLAMA_HOST environment variable inside the container. http://host.docker.internal:11434 is common for Docker Desktop to reach the host. For Linux, you might need a different approach (e.g., host network mode, or using the host's IP accessible from the container).
  4. The FastAPI application (your "MCP server") should now be running and accessible via http://localhost:8001.

▶️ How to Run

The overall workflow is:

  1. Execute python cursor_history_extractor.py periodically on your host machine to create/update ./cursor_chat_history.lancedb.
  2. Run the docker run command from the project root (where the .lancedb directory exists) to start the API server. This server will access the LanceDB database via the volume mount.

📁 Output

  • ./cursor_chat_history.lancedb: A directory created by the extraction script containing the LanceDB vector database. Its schema includes vector (float list), text (string), source_db (string), and role (string).
  • A running API server inside the Docker container, accessible externally via the mapped port (default 8001), providing the defined API endpoints.

🔌 API Usage

Once the Docker container is running and the API is accessible (e.g., at http://localhost:8001), you can interact with it.

Health Check (GET /health)

Checks the server's status and its connections to Ollama and LanceDB.bash curl http://localhost:8001/health

Example Response:

{
"status": "healthy",
"ollama_connection": "Connected",
"lancedb_connection": "Connected and table open"
}

Search History (POST /search_chat_history)

Performs a vector similarity search against the LanceDB chat history.
curl -X POST http://localhost:8001/search_chat_history \
-H "Content-Type: application/json" \
-d '{"query_text": "How do I use Python with data analysis?", "top_k": 5}'

🔍 Direct Database Inspection

After running the cursor_history_extractor.py script, you can inspect the LanceDB database file directly using Python (outside the Docker container).
import lancedb
import ollama # Required if you want to perform searches

Connect to the DB where the extractor created it

db = lancedb.connect("./cursor_chat_history.lancedb")

try:
# Open the table
table = db.open_table("chat_history")

# Inspect the table schema and content
print("Table Schema:")
print(table.schema)
print(f"\nTotal rows: {len(table)}")
print("\nFirst 3 rows:")
print(table.limit(3).to_pandas())

# --- Example: Perform a search using this direct connection ---
# Requires Ollama running on the host where this script is executed
# try:
#     query_text = "How do I use Python with data analysis?"
#     ollama_model_name = "nomic-embed-text:latest"
#     response = ollama.embeddings(model=ollama_model_name, prompt=query_text)
#     query_vector = response["embedding"]
#     search_results = table.search(query_vector).limit(5).to_pandas()
#     print("\nSearch Results (Direct Access):")
#     print(search_results)
# except Exception as e:
#     print(f"Error during direct query or search (Is Ollama running?): {e}")

except Exception as e:
print(f"Error opening or inspecting LanceDB table: {e}")

This direct access method is useful for debugging, verifying the database content, or performing operations separate from the API.

⚠️ Troubleshooting & Notes

Ollama Connectivity: Both the extraction script and the API server depend on a running and accessible Ollama instance with the nomic-embed-text:latest model pulled. Ensure OLLAMA_HOST is correctly configured for your Docker environment.
LanceDB Mounting: The Docker container must have the LanceDB database directory mounted correctly using the -v flag in docker run. Ensure the host path is correct and that the container user has read/write permissions if needed (write permission is mainly for the extractor, read is sufficient for the API search).
Database Path: The extractor creates the DB at ./cursor_chat_history.lancedb relative to where you run the script. The Docker container expects it mounted at /data/cursor_chat_history.lancedb. These paths are important.
Empty Prompts: The extraction script adds placeholder zero vectors for empty or whitespace-only prompts to maintain vector column size consistency.
AI Model Responses: This project currently only extracts user prompts from aiService.prompts. AI model responses and other conversation details are not currently extracted or stored.
Windows Paths: Be mindful of path formats when specifying the host path for the -v flag in docker run on Windows. Use absolute paths.
✨ Future Enhancements (Potential)
Extract and store AI model responses, associating them with user prompts.
Extract and store timestamps for ordering conversations.
Add more metadata to stored documents (workspace ID, conversation ID, etc.).
Implement configuration via a .env file for both the extractor and the API server.
Add filtering options to the search API (e.g., filter by source database, date range).

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Cursor Chat History Vectorizer & Dockerized Search MCP 怎么安装?

在客户端按下面的安装命令接入:pip install ollama lancedb pyarrow pandas python-dotenv\r。装完在客户端配置里引用同一个包或端点。

Cursor Chat History Vectorizer & Dockerized Search MCP 怎么在 Claude、Cursor、VS Code 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Cursor Chat History Vectorizer & Dockerized Search MCP 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Cursor Chat History Vectorizer & Dockerized Search MCP 需要 API Key 吗?

资料标注需要会话登录认证,使用前准备好对应凭据,并按最小权限配置。

Cursor Chat History Vectorizer & Dockerized Search MCP 支持哪些客户端?

资料标注支持 Claude、Cursor、VS Code、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Cursor Chat History Vectorizer & Dockerized Search MCP 能提供哪些能力?

资料显示能力标签包括 api、docker、self hosted、embeddings、chat history、rag。具体工具清单以官方文档为准。

Cursor Chat History Vectorizer & Dockerized Search MCP 需要什么运行环境?

运行时为 python;属于本地进程,需要在本机装好运行环境。

Cursor Chat History Vectorizer & Dockerized Search MCP 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。