io.github.PiotrAleksander/open-notebook

编码与调试

by epochal-dev

封装 Open Notebook API 的 MCP server,便于通过统一接口访问与集成笔记能力。

什么是 io.github.PiotrAleksander/open-notebook

封装 Open Notebook API 的 MCP server,便于通过统一接口访问与集成笔记能力。

README

Open Notebook MCP Server

<!-- mcp-name: io.github.Epochal-dev/open-notebook -->

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

Installation

Using uv (recommended)

bash
# Clone the repository
git clone https://github.com/PiotrAleksander/open-notebook-mcp.git
cd open-notebook-mcp

# Install with uv
uv sync

Using pip

bash
pip install -e .

Configuration

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

Environment Variables

Create a .env file or set these environment variables:

bash
# 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

Example Configuration

For local development with default Open Notebook settings:

bash
# .env
OPEN_NOTEBOOK_URL=http://localhost:5055

If you've configured authentication in Open Notebook:

bash
# .env
OPEN_NOTEBOOK_URL=http://localhost:5055
OPEN_NOTEBOOK_PASSWORD=my_secure_password

Usage

Running the Server

Development Mode (STDIO)

For local use with AI assistants:

bash
uv run open-notebook-mcp

Or using the MCP CLI:

bash
mcp dev src/open_notebook_mcp/server.py

Production Mode (Streamable HTTP)

For remote deployment:

bash
MCP_TRANSPORT=streamable-http HOST=0.0.0.0 PORT=8000 uv run open-notebook-mcp

Using with Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

json
{
  "mcpServers": {
    "open-notebook": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/open-notebook-mcp",
        "open-notebook-mcp"
      ],
      "env": {
        "OPEN_NOTEBOOK_URL": "http://localhost:5055",
        "OPEN_NOTEBOOK_PASSWORD": "your_password_if_needed"
      }
    }
  }
}

Discovering Available Tools

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

python
# 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

python
# 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

python
# 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

python
# 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

python
# 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

python
# 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 39 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

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

code
open-notebook-mcp/
├── src/
│   └── open_notebook_mcp/
│       ├── __init__.py
│       └── server.py          # Main MCP server implementation
├── tests/                      # (to be added)
├── pyproject.toml
├── README.md
└── .env.example

Testing

Test the server using the MCP Inspector:

bash
mcp dev src/open_notebook_mcp/server.py

or

bash
npx @modelcontextprotocol/inspector uv --directory ./src/open_notebook_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:

常见问题

io.github.PiotrAleksander/open-notebook 是什么?

封装 Open Notebook API 的 MCP server,便于通过统一接口访问与集成笔记能力。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描111.1k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描111.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描111.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.0k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
51.7k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.2k

评论