Skip to main content
Glama
OpenNotebook MCP Proxy Server

OpenNotebook MCP Proxy Server

by homeserverhq

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 contextvars to 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_fields flag.

  • πŸ§ͺ 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).

Related MCP server: NotebookLM MCP Server

πŸ”§ 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

  1. Ensure you have Python 3.12+ installed.

  2. Install dependencies:

    pip install fastmcp httpx pydantic uvicorn toon-mcp-server
  3. 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 β€” The include_all_fields parameter (available on all get_* and list_* tools) controls whether all available fields are included in responses. Defaults to False for performance; set to True only 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 API

  • list_all_notebooks β€” List all notebook records

  • get_notebook_by_id β€” Get a single notebook by ID

  • create_notebook β€” Create a new notebook

  • update_notebook β€” Update an existing notebook

  • delete_notebook_by_id β€” Delete a notebook by ID

  • get_notebook_delete_preview β€” Get a preview of what will be deleted

  • add_source_to_notebook β€” Add an existing source to a notebook

  • remove_source_from_notebook β€” Remove a source from a notebook

  • list_recently_viewed β€” List recently viewed items

πŸ“ Notes (5 tools)

  • list_all_notes β€” List all note records

  • get_note_by_id β€” Get a single note by ID

  • create_note β€” Create a new note

  • update_note β€” Update an existing note

  • delete_note_by_id β€” Delete a note by ID

πŸ”— Sources (8 tools)

  • list_all_sources β€” List all source records

  • get_source_by_id β€” Get a single source by ID

  • create_source β€” Create a new source (link or text type)

  • update_source β€” Update an existing source

  • delete_source_by_id β€” Delete a source by ID

  • get_source_status β€” Get processing status for a source

  • retry_source_processing β€” Retry processing for a failed source

  • list_source_insights β€” List all insights for a source

  • create_source_insight β€” Start insight generation for a source

πŸ’‘ Insights (4 tools)

  • get_insight_by_id β€” Get a single insight by ID

  • delete_insight_by_id β€” Delete an insight by ID

  • save_insight_as_note β€” Convert an insight to a note

  • list_source_insights β€” List insights for a source

πŸ” Search & Settings (4 tools)

  • search_knowledge_base β€” Search the knowledge base

  • ask_knowledge_base_simple β€” Ask the knowledge base a question

  • get_settings β€” Get all application settings

  • update_settings β€” Update application settings

πŸ€– Models (5 tools)

  • list_all_models β€” List all configured models

  • create_model β€” Create a new model configuration

  • delete_model_by_id β€” Delete a model by ID

  • get_default_models β€” Get default model assignments

  • update_default_models β€” Update default model assignments

πŸ”„ Transformations (8 tools)

  • list_all_transformations β€” List all transformation records

  • get_transformation_by_id β€” Get a single transformation by ID

  • create_transformation β€” Create a new transformation

  • update_transformation β€” Update an existing transformation

  • delete_transformation_by_id β€” Delete a transformation by ID

  • execute_transformation β€” Execute a transformation on input text

  • get_default_transformation_prompt β€” Get the default prompt

  • update_default_transformation_prompt β€” Update the default prompt

🧩 Embedding (3 tools)

  • embed_content β€” Embed content for vector search

  • start_embedding_rebuild β€” Start a background rebuild job

  • get_rebuild_status β€” Get rebuild operation status

πŸ’¬ Chat (7 tools)

  • list_chat_sessions β€” List chat sessions for a notebook

  • create_chat_session β€” Create a new chat session

  • get_chat_session β€” Get a chat session with messages

  • update_chat_session β€” Update a chat session

  • delete_chat_session β€” Delete a chat session

  • execute_chat β€” Execute a chat request

  • build_chat_context β€” Build notebook context

πŸ”Œ Source Chat (5 tools)

  • create_source_chat_session β€” Create a source chat session

  • list_source_chat_sessions β€” List source chat sessions

  • get_source_chat_session β€” Get a source chat session

  • update_source_chat_session β€” Update a source chat session

  • delete_source_chat_session β€” Delete a source chat session

πŸŽ™οΈ Podcasts (6 tools)

  • generate_podcast β€” Generate a podcast episode

  • get_podcast_job_status β€” Get podcast job status

  • list_podcast_episodes β€” List all podcast episodes

  • get_podcast_episode β€” Get a specific episode

  • retry_podcast_episode β€” Retry a failed episode

  • delete_podcast_episode β€” Delete a podcast episode

🎬 Episode Profiles (6 tools)

  • list_episode_profiles β€” List all episode profiles

  • get_episode_profile β€” Get a profile by name

  • create_episode_profile β€” Create a new episode profile

  • update_episode_profile β€” Update an episode profile

  • delete_episode_profile β€” Delete an episode profile

  • duplicate_episode_profile β€” Duplicate an episode profile

πŸ—£οΈ Speaker Profiles (6 tools)

  • list_speaker_profiles β€” List all speaker profiles

  • get_speaker_profile β€” Get a profile by name

  • create_speaker_profile β€” Create a new speaker profile

  • update_speaker_profile β€” Update a speaker profile

  • delete_speaker_profile β€” Delete a speaker profile

  • duplicate_speaker_profile β€” Duplicate a speaker profile

πŸ“‹ Commands (4 tools)

  • submit_command_job β€” Submit a command for background processing

  • get_command_job_status β€” Get command job status

  • list_command_jobs β€” List command jobs

  • cancel_command_job β€” Cancel a running command job

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers