Claude Code Notebook MCP
A Model Context Protocol (MCP) server that provides comprehensive Jupyter notebook interaction capabilities, compatible with Claude Code.
README
Claude Code Notebook MCP
A Model Context Protocol (MCP) server that provides comprehensive Jupyter notebook interaction capabilities, compatible with Claude Code.
Note: This library emulates the functionality of the cursor-notebook-mcp repository but runs in a web browser. For live updates in Jupyter, install the collaboration extension:
pip install jupyter-collaboration jupyter labextension install @jupyter/collaboration-extensionOr for JupyterLab 3.x:
pip install jupyterlab-collaboration
Features
This MCP server implements all 29 required Jupyter notebook operations:
Notebook Management
notebook_create- Creates a new, empty notebook filenotebook_delete- Deletes an existing notebook filenotebook_rename- Renames/moves a notebook file from one path to anothernotebook_read- Reads an entire notebook and returns its structure as a dictionary
Cell Operations
notebook_read_cell- Reads the source content of a specific cellnotebook_add_cell- Adds a new code or markdown cell after a specified indexnotebook_edit_cell- Replaces the source content of a specific cellnotebook_delete_cell- Deletes a specific cellnotebook_change_cell_type- Changes a cell's type (code, markdown, or raw)notebook_duplicate_cell- Duplicates a cell multiple times (default: once)notebook_move_cell- Moves a cell to a different positionnotebook_split_cell- Splits a cell into two at a specified line numbernotebook_merge_cells- Merges a cell with the cell immediately following it
Cell Content & Metadata
notebook_read_cell_metadata- Reads the metadata of a specific cellnotebook_edit_cell_metadata- Updates the metadata of a specific cellnotebook_read_cell_output- Reads the output list of a specific code cellnotebook_edit_cell_output- Allows direct manipulation and setting of cell outputsnotebook_clear_cell_outputs- Clears the outputs and execution count of a specific cellnotebook_clear_all_outputs- Clears outputs and execution counts for all code cells
Notebook Information & Metadata
notebook_get_cell_count- Returns the total number of cellsnotebook_read_metadata- Reads the top-level notebook metadatanotebook_edit_metadata- Updates the top-level notebook metadatanotebook_get_info- Retrieves general information (cell count, metadata, kernel, language info)notebook_validate- Validates the notebook structure against the nbformat schema
Advanced Operations
notebook_export- Exports the notebook to another format (e.g., python, html) using nbconvertnotebook_get_outline- Produces an outline showing cell numbers with major headings/functions and line countsnotebook_search- Searches cells for a keyword, showing which cell matches were found with contextual snippetsnotebook_bulk_add_cells- Adds multiple cells to a notebook in a single operationnotebook_get_server_path_context- Provides detailed server path configuration
Installation
npm install
Usage
As MCP Server (for Claude Code)
Option 1: Using Claude CLI (Recommended)
- Navigate to the project directory:
cd /path/to/claude-code-notebook-mcp
- Add the MCP server:
claude mcp add jupyter "$(pwd)/src/server.js"
- Verify the server was added:
claude mcp list
Option 2: Manual Configuration
- Copy the example configuration file and customize it:
# For project-specific configuration
cp .mcp.example.json .mcp.json
# Or for Claude Code configuration
cp claude-code-config.example.json claude-code-config.json
- Edit the configuration file and update the
cwdpath to your project location:
{
"mcpServers": {
"jupyter": {
"command": "node",
"args": ["src/server.js"],
"cwd": "/your/actual/path/to/claude-code-notebook-mcp"
}
}
}
- For user-wide settings, add to
~/.claude/settings.json:
{
"mcpServers": {
"jupyter": {
"command": "node",
"args": ["src/server.js"],
"cwd": "/path/to/claude-code-notebook-mcp"
}
}
}
- Start Claude Code and the Jupyter tools will be available.
Standalone Client
node src/client.js
This will run a demonstration showing the basic capabilities.
Programmatic Usage
import { JupyterMCPClient } from './src/client.js';
const client = new JupyterMCPClient();
await client.connect();
// Create a new notebook
await client.createNotebook('./my_notebook.ipynb');
// Add a markdown cell
await client.addCell('./my_notebook.ipynb', 'markdown', '# My Notebook', -1);
// Add a code cell
await client.addCell('./my_notebook.ipynb', 'code', 'print("Hello World")', 0);
// Get notebook outline
const outline = await client.getOutline('./my_notebook.ipynb');
console.log(outline.content[0].text);
Compatibility
- Claude Code: Fully compatible with Claude Code's MCP integration
- Node.js: Requires Node.js 18+ with ES modules support
- Jupyter: Compatible with nbformat 4.x notebooks
Development
Running the Server
npm start
Development Mode (with file watching)
npm run dev
Testing
node src/client.js
Architecture
- Server (
src/server.js): MCP server implementation with all 29 Jupyter notebook tools - Client (
src/client.js): Example client with convenience methods for common operations - Configuration (
claude-code-config.json): Claude Code MCP server configuration
The server uses the official MCP SDK and implements the full MCP protocol for tool calling. All notebook operations are performed using Node.js file system operations and JSON manipulation, ensuring compatibility across platforms.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。