Skip to main content

Open Notebook MCP Server

[English] | 日本語 | 简体中文

An MCP (Model Context Protocol) server that provides tools to interact with the Open Notebook API. This server enables AI assistants like Claude to manage notebooks, sources, notes, search content, and interact with AI models through Open Notebook.

Features

  • Notebooks Management: Create, read, update, and delete notebooks
  • Sources Management: Add and manage content sources (links, uploads, text)
  • Notes Management: Create and organize notes within notebooks
  • Search & AI: Search content using vector/text search and ask questions
  • Models Management: Configure and manage AI models
  • Chat Sessions: Create and manage chat conversations
  • Settings: Access and update application settings
  • Progressive Disclosure: Efficient tool discovery with search_capabilities

Quick Start with uvx (Recommended)

Since this package is published on PyPI, you do not need to clone or install it manually. You can run the server instantly using uvx (the tool runner for uv):

# Run the MCP server instantly
uvx onb-mcp

Using with Claude Desktop

Add the server to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, or %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "open-notebook": {
      "command": "uvx",
      "args": [
        "onb-mcp"
      ],
      "env": {
        "OPEN_NOTEBOOK_URL": "http://localhost:5055",
        "OPEN_NOTEBOOK_PASSWORD": "your_password_here"
      }
    }
  }
}

Configuration

The server requires configuration to connect to your Open Notebook instance:

Environment Variables

Set these environment variables in your MCP client configuration (e.g. Claude Desktop config):

# Required: URL of your Open Notebook instance
OPEN_NOTEBOOK_URL=http://localhost:5055

# Optional: Authentication password (if APP_PASSWORD is set in Open Notebook)
OPEN_NOTEBOOK_PASSWORD=your_password_here

# Optional: Transport configuration (default: stdio)
MCP_TRANSPORT=stdio  # or streamable-http for remote deployment

Development & Installation from Source

If you want to modify the code or run it locally from source:

Clone and Sync

# Clone the repository
git clone https://github.com/rmc8/onb-mcp.git
cd onb-mcp

# Install with uv
uv sync

Running the Dev Server

Development Mode (STDIO)

For local use with AI assistants from the source directory:

uv run onb-mcp

Production Mode (Streamable HTTP)

For remote deployment:

MCP_TRANSPORT=streamable-http HOST=0.0.0.0 PORT=8000 uv run onb-mcp

Discovering Available Tools

The server implements progressive disclosure. Use the search_capabilities tool to discover available functionality:

# Get a summary of all tools
search_capabilities(query="", detail="summary", limit=50)

# Search for specific functionality
search_capabilities(query="notebook", detail="summary", limit=10)

# Get full details for a specific tool
search_capabilities(query="create_notebook", detail="full", limit=1)

Example Workflows

Creating and Managing Notebooks

# Create a new notebook
result = create_notebook(
    name="AI Research",
    description="Research on AI applications"
)
notebook_id = result["notebook"]["id"]

# List all notebooks
notebooks = list_notebooks(archived=False, limit=20)

# Update a notebook
update_notebook(
    notebook_id=notebook_id,
    name="AI Research (Updated)"
)

# Get a specific notebook
notebook = get_notebook(notebook_id=notebook_id)

Adding Sources

# Add a web source
source = create_source(
    notebook_id=notebook_id,
    type="link",
    url="https://example.com/ai-article",
    title="AI Research Article",
    embed=True  # Generate embeddings
)

# List sources in a notebook
sources = list_sources(notebook_id=notebook_id, limit=20)

Creating Notes

# Create a note
note = create_note(
    notebook_id=notebook_id,
    title="Key Findings",
    content="Important insights about AI applications...",
    topics=["AI", "Research"]
)

# Update a note
update_note(
    note_id=note["note"]["id"],
    content="Updated insights..."
)

Searching and Asking Questions

# Search content
results = search(
    query="artificial intelligence",
    type="vector",
    notebook_id=notebook_id,
    limit=10
)

# List available models first
models = list_models(limit=50)
model_id = models["models"][0]["id"]

# Ask a question
answer = ask_simple(
    question="What are the main AI applications mentioned?",
    strategy_model=model_id,
    answer_model=model_id,
    final_answer_model=model_id,
    notebook_id=notebook_id
)

Chat Sessions

# Create a chat session
session = create_chat_session(
    notebook_id=notebook_id,
    title="Research Discussion"
)
session_id = session["session"]["id"]

# Build context
context = get_chat_context(notebook_id=notebook_id)

# Send a message
response = execute_chat(
    session_id=session_id,
    message="What are the key insights from my research?",
    context=context["context"]
)

# Get session history
history = get_chat_session(session_id=session_id)

Available Tools

The server provides 60 tools across multiple categories:

Meta Tools

  • search_capabilities - Progressive tool discovery

Notebooks (5 tools)

  • list_notebooks, get_notebook, create_notebook, update_notebook, delete_notebook

Sources (5 tools)

  • list_sources, get_source, create_source, update_source, delete_source

Notes (5 tools)

  • list_notes, get_note, create_note, update_note, delete_note

Search (3 tools)

  • search, ask_question, ask_simple

Models (5 tools)

  • list_models, get_model, create_model, delete_model, get_default_models

Chat (7 tools)

  • list_chat_sessions, create_chat_session, get_chat_session, update_chat_session, delete_chat_session, execute_chat, get_chat_context

Settings (2 tools)

  • get_settings, update_settings

Transformations (3 tools)

  • list_transformations, create_transformation, apply_transformation

Podcasts (13 tools)

  • generate_podcast, retry_podcast, get_podcast_job_status
  • Speaker Profiles: list_speaker_profiles, get_speaker_profile, create_speaker_profile, update_speaker_profile, delete_speaker_profile
  • Episode Profiles: list_episode_profiles, get_episode_profile, create_episode_profile, update_episode_profile, delete_episode_profile

Credentials (4 tools)

  • list_credentials, test_credential, discover_models, register_models

Embedding Rebuild (1 tool)

  • rebuild_embeddings

Architecture

This server follows MCP best practices:

  • Progressive Disclosure: Use search_capabilities to minimize context usage
  • Context Efficiency: Small outputs by default, with limit parameters
  • Dual Transport: Supports both STDIO (local) and Streamable HTTP (remote)
  • Error Handling: Structured error messages with actionable hints
  • Timeouts: 30-second default timeout for all API requests
  • Authentication: Optional Bearer token authentication

Development

Project Structure

onb-mcp/
├── src/
│   └── onb_mcp/
│       ├── __init__.py
│       └── server.py          # Main MCP server implementation
├── tests/
├── pyproject.toml
├── README.md
└── .env.example

Testing

Test the server using the MCP Inspector:

mcp dev src/onb_mcp/server.py

or

npx @modelcontextprotocol/inspector uv --directory ./src/onb_mcp "run" "server.py"

This opens an interactive inspector where you can:

  1. Browse available tools
  2. Test tool calls
  3. Inspect responses
  4. Debug errors

Adding New Tools

To add new tools:

  1. Add a Capability entry to the CAPABILITIES tuple
  2. Implement the tool function with @mcp.tool() decorator
  3. Follow naming conventions: verb_noun (e.g., list_notebooks)
  4. Include proper docstrings and type hints
  5. Return structured responses with request_id

Requirements

  • Python 3.12+
  • Open Notebook instance (local or remote)
  • Dependencies: mcp[cli]>=1.23.2, httpx>=0.28.1

Contributing

Contributions are welcome! Please ensure:

  • Follow the existing code structure and patterns
  • Add tools to the CAPABILITIES index
  • Include proper type hints and docstrings
  • Test with MCP Inspector before submitting

License

See LICENSE file for details.

Links

Support

For issues related to:

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onb_mcp-0.4.6.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onb_mcp-0.4.6-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file onb_mcp-0.4.6.tar.gz.

File metadata

  • Download URL: onb_mcp-0.4.6.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for onb_mcp-0.4.6.tar.gz
Algorithm Hash digest
SHA256 bd46331000fdbf2977f328ced3cdb7c8ed55d8ff4a8a668ba6dec7bcc0bf08b7
MD5 d998b097018a1aede7a02abbe4a7207b
BLAKE2b-256 59761d400c24d970ff0e3e9b980d0f26aeb3b58603de8202a74e8547e4c928b8

See more details on using hashes here.

File details

Details for the file onb_mcp-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: onb_mcp-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for onb_mcp-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 800f33e591a40d7231dd186556aa698f98b8052e9b66e6193d697e85767c59a3
MD5 9b662ffff5d03c3841f54301b9059a51
BLAKE2b-256 52671df1992622d3f50f6696f33341435a26467b08786ca4be081b8d0f181ff7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.7

2 files

This release

0.4.6 This release

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page