book-notes-mcp
MCP server for processing raw book notes into structured, searchable knowledge using embeddings and semantic search.
README
book-notes-mcp
book-notes-mcp is a personal reading system for turning messy capture into usable notes.
The input can be rough: something typed quickly on your phone, an OCR scrape from a page, a voice transcript, or a note pulled in from Google Keep. The app processes that raw text once, stores the result in Supabase, generates embeddings, and makes it available through semantic search, RAG-style Q&A, and a small web interface.
It is built for one practical problem: reading produces a lot of fragments, but the value only shows up later when those fragments are easy to retrieve and connect.
What the project does
- Processes raw notes into a structured shape:
book_title,summary,ideas,tags,actions - Stores both the raw capture and the processed note
- Builds embeddings for retrieval across your reading history
- Exposes the knowledge base through MCP tools, a web API, and a browser UI
- Syncs notes from Google Keep using
gkeepapi
Core tools
| Tool | Purpose |
|---|---|
process_note |
Turn one raw note into a stored note with metadata and embeddings |
search_notes |
Semantic search across the library |
ask_knowledge_base |
Answer a question using retrieved notes as context |
get_note |
Fetch one note by id |
list_notes |
Browse recent notes, optionally by tag |
link_notes |
Find related notes based on shared concepts |
sync_from_keep |
Poll the configured Google Keep label and import or update notes |
How it is meant to be used
- Capture notes wherever it is easiest. Google Keep is the intended inbox for phone capture because it handles typing, OCR, and voice well.
- Let this project do the organizing. Raw text is processed into something cleaner and easier to search.
- Retrieve later by concept, not by memory of exact wording. That is what the embeddings and Q&A layer are for.
Stack
- FastAPI web app for the browser UI and HTTP endpoints
- Supabase for note storage and vector search
- LiteLLM for model routing
- MCP server for Claude Desktop / Cursor workflows
gkeepapifor scheduled Google Keep sync
Setup
1. Clone and install
git clone <your-repo>
cd book-notes-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
2. Create .env
At minimum:
GEMINI_API_KEY=<your key>
SUPABASE_URL=<your project url>
SUPABASE_SERVICE_KEY=<your service role key>
Optional model configuration:
LLM_MODEL=gemini/gemini-2.5-flash
EMBEDDING_MODEL=gemini/text-embedding-004
VECTOR_DIM=768
Optional Keep sync configuration:
GOOGLE_EMAIL=<your google account email>
GOOGLE_APP_PASSWORD=<16-character app password>
KEEP_LABEL=book-note
KEEP_TOKEN_FILE=.keep_token
KEEP_SYNC_INTERVAL_MINUTES=5
3. Set up Supabase
Run schema.sql in the Supabase SQL editor.
Note on vector size:
- Gemini
text-embedding-004: usevector(768) - OpenAI
text-embedding-3-small: usevector(1536) - If you change embedding dimensions, update both the schema and
VECTOR_DIM
4. Connect the MCP server
Add this to Claude Desktop:
{
"mcpServers": {
"book-notes": {
"command": "/path/to/book-notes-mcp/.venv/bin/python",
"args": ["/path/to/book-notes-mcp/book_server/server.py"],
"env": {
"PYTHONPATH": "/path/to/book-notes-mcp"
}
}
}
}
Running the app
Start the web app locally:
python web/app.py
Open:
http://localhost:8080on the same machinehttp://<your-local-ip>:8080from your phone on the same network
Google Keep sync
The intended setup is a dedicated Google account used only for capture. The server polls that account through gkeepapi and imports notes matching the configured Keep label.
Authentication
- Turn on 2-step verification for the Google account
- Create a Google App Password
- Put
GOOGLE_EMAILandGOOGLE_APP_PASSWORDin.env - Optionally set
KEEP_LABELif you do not want to use the defaultbook-note
The first successful sync caches a Keep token in KEEP_TOKEN_FILE.
Run one sync pass
book-notes-keep-sync
The sync behavior is:
- new Keep note with the configured label -> create a new note in the library
- changed Keep note -> update the existing mapped note and refresh its embedding
- unchanged Keep note -> skip
- deleted or missing Keep note -> no automatic deletion in the app
Schedule it
Run the sync command every 5 minutes on the deployed server.
Example cron entry:
*/5 * * * * cd /path/to/book-notes-mcp && /path/to/.venv/bin/book-notes-keep-sync >> keep-sync.log 2>&1
API surface
Web endpoints in web/app.py:
POST /api/processPOST /api/askPOST /api/searchGET /api/notesGET /api/notes/{id}GET /api/notes/{id}/linkPOST /api/webhook/keep
Development
Run tests:
pytest tests/ -v
The current test suite focuses on processing logic and Keep sync behavior with mocked external services.
Project layout
book-notes-mcp/
├── agent/ RAG query logic
├── book_server/ MCP server, Keep sync, ingestion services
├── embeddings/ embedding generation and storage helpers
├── processing/ note extraction and summarization
├── storage/ Supabase and filesystem persistence
├── tests/ unit tests
├── web/ FastAPI app and frontend
├── config.py environment-driven config
├── pyproject.toml package metadata and scripts
└── schema.sql database schema
What is intentionally not here yet
- Delete propagation from Keep into the library
- Book-level rollups
- Graph-style visualization
- A polished mobile capture app of its own
That is deliberate. The project is currently optimized around capture, storage, and retrieval rather than around building a full reading platform.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。