RAG Notes Search MCP Server
Enables semantic search over personal study notes by exposing a vector search tool that Claude Desktop can call to retrieve relevant note content and synthesize grounded answers.
README
RAG Notes Search — MCP Server
A semantic search system over personal study notes, exposed as an MCP (Model Context Protocol) tool that Claude Desktop can call mid-conversation.
What it does
Ask Claude Desktop anything about your notes and it automatically:
- Decides whether to search your notes based on the question
- Calls the
search_notestool with a semantic query - Retrieves the most relevant note content with similarity scores
- Synthesizes an answer grounded in your actual notes
Example queries that work:
- "What have I written about machine learning pipelines?"
- "Search my notes for how vector databases work"
- "What do my notes say about GCP Cloud Run?"
Architecture
Claude Desktop (MCP Client) ↓ stdio MCP Server (mcp_server.py) ↓ search_notes() tool ↓ Chroma Vector DB (local) ↓ fastembed (all-MiniLM-L6-v2, ONNX)
Tech stack
- MCP — Anthropic's Model Context Protocol (v1.28.1) for tool exposure
- Chroma — local vector database storing note embeddings
- fastembed — lightweight ONNX-based embedding model (no PyTorch dependency)
- sentence-transformers/all-MiniLM-L6-v2 — embedding model, 384 dimensions
- Docker — containerized for reproducibility, built for linux/amd64
- GCP — Container Registry hosts the image, Cloud Run deployment planned
Key technical decisions
Why fastembed over sentence-transformers? sentence-transformers pulls in PyTorch (~2GB). fastembed uses ONNX runtime (~200MB), making Docker builds 10x faster and the image significantly smaller.
Why a similarity threshold? Without a threshold, vector search always returns something even when nothing is relevant — this is how RAG systems silently hallucinate. A threshold of 0.25 means the system returns "no relevant notes found" rather than a low-confidence garbage result.
Why absolute paths in the MCP server?
Claude Desktop spawns the MCP server as a subprocess with an unpredictable
working directory. Relative paths like ./chroma_db break silently. Absolute
paths are required for reliable subprocess execution.
Why stderr for all logging? MCP uses stdout as a JSON wire protocol. Any print() to stdout corrupts the MCP message stream. All logging goes to stderr which Claude Desktop reads separately via the log file.
Setup
Prerequisites
- Python 3.11
- Claude Desktop
- conda or venv
Install
conda create -n rag_demo python=3.11
conda activate rag_demo
pip install chromadb==1.5.9 sentence-transformers mcp fastembed numpy==1.26.4
Index your notes
Add .txt files to the notes/ folder, then run the indexing notebook:
jupyter notebook demo.ipynb
Run all cells — this embeds your notes into Chroma.
Connect to Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"notes-search": {
"command": "/opt/anaconda3/envs/rag_demo/bin/python",
"args": ["/absolute/path/to/rag_demo/mcp_server.py"],
"cwd": "/absolute/path/to/rag_demo"
}
}
}
Restart Claude Desktop. Look for the tools icon in the chat input.
Docker
# Build for linux/amd64
docker buildx build --platform linux/amd64 -t rag-demo .
# Run with local chroma_db mounted
docker run --rm \
-v /absolute/path/to/chroma_db:/app/chroma_db \
rag-demo
Bugs fixed during development
| Bug | Cause | Fix |
|---|---|---|
Read-only file system |
Relative ./chroma_db path breaks in subprocess |
Use absolute path |
Unexpected token 'L' is not valid JSON |
print() polluting MCP stdout wire |
Route all logs to stderr |
cached_download ImportError |
sentence-transformers version conflict | Switched to fastembed |
np.float_ AttributeError |
NumPy 2.0 removed deprecated types | Pinned numpy==1.26.4 |
no such column: collections.topic |
Chroma version mismatch between dev and Docker | Matched versions exactly |
Planned improvements
- SSE/HTTP transport for Cloud Run deployment
- Second MCP tool:
search_web()using a free news API - Daily ingestion job via Cloud Scheduler
- Confidence score displayed in Claude's response
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。