OpenNotebook MCP Proxy Server
A secure multi-tenant MCP proxy that exposes 81 tools for full CRUD, search, chat, podcast, and command management on the OpenNotebook API, enabling natural language interaction with notebooks, notes, sources, and more.
README
OpenNotebook MCP Multitenant Proxy Server
This repository contains a Model Context Protocol (MCP) server that acts as a secure, multi-tenant proxy between an AI Assistant and the OpenNotebook backend API. It exposes 81 MCP tools covering 14 resource domains with full CRUD, search, chat, podcast, and command management.
✨ Features
- 🔑 Identity Passthrough — Extracts the
Authorization: Bearer <token>header from incoming HTTP requests and forwards it to the OpenNotebook API without server-side authentication. - 👥 Multi-Tenancy — Uses Python
contextvarsto maintain thread-safe user identity isolation, ensuring all AI-driven actions are scoped to the authenticated user's permissions. - 📊 Full OpenNotebook Coverage — 81 tools mapped to OpenNotebook API endpoints across 14 resource domains.
- ⚡ TOON Optimization — Bulk list responses are automatically compressed using TOON (Token-Optimized Object Notation) to reduce token consumption and maximize context window efficiency.
- 🚀 Efficient Gets — GET responses return only commonly used fields by
default. Full objects are available via an
include_all_fieldsflag. - 🧪 Comprehensive Testing — 109 automated tests covering all tool domains, run via the test runner pipeline.
- 🏷️ Tool Annotations — All tools expose standard MCP ToolAnnotations hints (readOnlyHint, destructiveHint, idempotentHint, openWorldHint). The tags field carries grouping metadata (basic/primary/advanced + opennotebook).
🔧 Environment Variables
| Variable | Required | Description |
|---|---|---|
OPENNOTEBOOK_BASE_URL |
Yes | Docker-internal URL of the OpenNotebook API |
MCP_SERVER_PORT |
Yes | Port number the MCP server listens on |
ALLOW_ALL_AGGREGATE |
No | When true, aggregate listing tools honor the include_all_fields parameter. When false (default), the parameter is silently forced to False for aggregate list operations. |
IS_STATEFUL |
No | When true, uses stateful Streamable HTTP with session tracking. When false (default), uses stateless mode. |
📦 Installation & Local Development
- Ensure you have Python 3.12+ installed.
- Install dependencies:
pip install fastmcp httpx pydantic uvicorn toon-mcp-server - Run the server:
export OPENNOTEBOOK_BASE_URL=http://localhost:5055 export MCP_SERVER_PORT=80 python -m src.main
🐳 Docker Deployment
Build and run the server using Docker:
docker build -t opennotebook-mcp:latest .
docker run -d --name opennotebook-mcp \
-e OPENNOTEBOOK_BASE_URL="http://opennotebook-app:5055" \
-e MCP_SERVER_PORT=80 \
opennotebook-mcp:latest
The MCP server serves at http://opennotebook-mcp:80/mcp
(Streamable HTTP).
⚠️ Important Notes
- 📋
include_all_fields— Theinclude_all_fieldsparameter (available on allget_*andlist_*tools) controls whether all available fields are included in responses. Defaults toFalsefor performance; set toTrueonly when additional fields are needed. - ⚡ TOON Compression — All bulk list responses are automatically compressed using TOON to reduce token consumption by 30–60%.
- 📝 Required Fields & Defaults — Each
create_*tool requires specific key fields. All other fields default to empty strings or reasonable values. The owner field is automatically set to the authenticated user for most resources.
🛠️ API Tool Mapping
The server implements 81 MCP tools organized into the following categories:
📓 Notebooks (9 tools)
check_server_status— Check the health and status of the OpenNotebook backend APIlist_all_notebooks— List all notebook recordsget_notebook_by_id— Get a single notebook by IDcreate_notebook— Create a new notebookupdate_notebook— Update an existing notebookdelete_notebook_by_id— Delete a notebook by IDget_notebook_delete_preview— Get a preview of what will be deletedadd_source_to_notebook— Add an existing source to a notebookremove_source_from_notebook— Remove a source from a notebooklist_recently_viewed— List recently viewed items
📝 Notes (5 tools)
list_all_notes— List all note recordsget_note_by_id— Get a single note by IDcreate_note— Create a new noteupdate_note— Update an existing notedelete_note_by_id— Delete a note by ID
🔗 Sources (8 tools)
list_all_sources— List all source recordsget_source_by_id— Get a single source by IDcreate_source— Create a new source (link or text type)update_source— Update an existing sourcedelete_source_by_id— Delete a source by IDget_source_status— Get processing status for a sourceretry_source_processing— Retry processing for a failed sourcelist_source_insights— List all insights for a sourcecreate_source_insight— Start insight generation for a source
💡 Insights (4 tools)
get_insight_by_id— Get a single insight by IDdelete_insight_by_id— Delete an insight by IDsave_insight_as_note— Convert an insight to a notelist_source_insights— List insights for a source
🔍 Search & Settings (4 tools)
search_knowledge_base— Search the knowledge baseask_knowledge_base_simple— Ask the knowledge base a questionget_settings— Get all application settingsupdate_settings— Update application settings
🤖 Models (5 tools)
list_all_models— List all configured modelscreate_model— Create a new model configurationdelete_model_by_id— Delete a model by IDget_default_models— Get default model assignmentsupdate_default_models— Update default model assignments
🔄 Transformations (8 tools)
list_all_transformations— List all transformation recordsget_transformation_by_id— Get a single transformation by IDcreate_transformation— Create a new transformationupdate_transformation— Update an existing transformationdelete_transformation_by_id— Delete a transformation by IDexecute_transformation— Execute a transformation on input textget_default_transformation_prompt— Get the default promptupdate_default_transformation_prompt— Update the default prompt
🧩 Embedding (3 tools)
embed_content— Embed content for vector searchstart_embedding_rebuild— Start a background rebuild jobget_rebuild_status— Get rebuild operation status
💬 Chat (7 tools)
list_chat_sessions— List chat sessions for a notebookcreate_chat_session— Create a new chat sessionget_chat_session— Get a chat session with messagesupdate_chat_session— Update a chat sessiondelete_chat_session— Delete a chat sessionexecute_chat— Execute a chat requestbuild_chat_context— Build notebook context
🔌 Source Chat (5 tools)
create_source_chat_session— Create a source chat sessionlist_source_chat_sessions— List source chat sessionsget_source_chat_session— Get a source chat sessionupdate_source_chat_session— Update a source chat sessiondelete_source_chat_session— Delete a source chat session
🎙️ Podcasts (6 tools)
generate_podcast— Generate a podcast episodeget_podcast_job_status— Get podcast job statuslist_podcast_episodes— List all podcast episodesget_podcast_episode— Get a specific episoderetry_podcast_episode— Retry a failed episodedelete_podcast_episode— Delete a podcast episode
🎬 Episode Profiles (6 tools)
list_episode_profiles— List all episode profilesget_episode_profile— Get a profile by namecreate_episode_profile— Create a new episode profileupdate_episode_profile— Update an episode profiledelete_episode_profile— Delete an episode profileduplicate_episode_profile— Duplicate an episode profile
🗣️ Speaker Profiles (6 tools)
list_speaker_profiles— List all speaker profilesget_speaker_profile— Get a profile by namecreate_speaker_profile— Create a new speaker profileupdate_speaker_profile— Update a speaker profiledelete_speaker_profile— Delete a speaker profileduplicate_speaker_profile— Duplicate a speaker profile
📋 Commands (4 tools)
submit_command_job— Submit a command for background processingget_command_job_status— Get command job statuslist_command_jobs— List command jobscancel_command_job— Cancel a running command job
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。