Skip to main content
Glama
shwetalsoni

Jupyter Notebook MCP Server

by shwetalsoni

Jupyter Notebook MCP Server

A FastMCP server that provides tools for interacting with Jupyter notebooks. Built using the FastMCP framework.

Features

  • ✅ Read notebook cells with filtering

  • ✅ Add new cells at any position

  • ✅ Execute individual cells

  • ✅ Execute entire notebooks

  • ✅ Get notebook metadata and statistics

  • ✅ Proper error handling and validation

  • ✅ Progress reporting for long operations

  • ✅ Comprehensive logging via FastMCP Context

Related MCP server: Jupyter MCP Server

Integration with your MCP Client

Make sure uv is installed. To use this server with cursor, claude desktop or any other MCP client, add the following to your mcp config file:

{
  "mcpServers": {
    "jupyter-notebook": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp>=2.8.1",
        "python",
        "<absolute_path_to_jupyter_mcp_server>/main.py"
      ]
    }
  }
}

Testing

Run the test client to see all functionality in action:

python test_client.py

Security Notes

  • Cell execution runs Python code directly via subprocess

  • Only execute notebooks from trusted sources

  • Consider running in a sandboxed environment for production use

  • Timeout controls help prevent runaway executions

Dependencies

  • fastmcp - MCP server framework

Tools

This MCP server provides the following tools for working with Jupyter notebooks:

📖 read_notebook_cells

Read cells from a Jupyter notebook with optional filtering by cell type.

Parameters:

  • notebook_path (str): Path to the .ipynb file

  • cell_type (optional str): Filter by cell type ('code', 'markdown', 'raw')

add_cell_to_notebook

Add a new cell to a Jupyter notebook at a specified position.

Parameters:

  • notebook_path (str): Path to the .ipynb file

  • cell_content (str): Content of the new cell

  • cell_type (str, default="code"): Type of cell ('code', 'markdown', 'raw')

  • position (optional int): Position to insert cell (default: append to end)

  • metadata (optional dict): Optional cell metadata

execute_notebook_cell

Execute a specific cell in a Jupyter notebook.

Parameters:

  • notebook_path (str): Path to the .ipynb file

  • cell_index (int): Index of the cell to execute (0-based)

  • kernel_name (str, default="python3"): Jupyter kernel to use

  • timeout (int, default=30): Execution timeout in seconds

🔄 execute_entire_notebook

Execute all code cells in a Jupyter notebook sequentially.

Parameters:

  • notebook_path (str): Path to the .ipynb file

  • kernel_name (str, default="python3"): Jupyter kernel to use

  • timeout_per_cell (int, default=30): Timeout per cell in seconds

  • stop_on_error (bool, default=True): Whether to stop execution if a cell fails

📊 get_notebook_info

Get basic information about a Jupyter notebook.

Parameters:

  • notebook_path (str): Path to the .ipynb file

Available Tools

5 tools
add_cell_to_notebookA
Add a new cell to a Jupyter notebook.

Args:
    notebook_path: Absolute path to the .ipynb file
    cell_content: Content of the new cell
    cell_type: Type of cell ('code', 'markdown', 'raw')
    position: Position to insert cell (default: append to end)
    metadata: Optional cell metadata

Returns:
    Status of the operation
ParametersJSON Schema
NameRequiredDescriptionDefault
metadataNo
positionNo
cell_typeNocode
cell_contentYes
notebook_pathYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fails to disclose important behavioral traits such as whether the tool modifies the notebook file (destructive hint missing), any side effects, or error behavior. The return value is vague ('Status of the operation') with no format or possible values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise and well-structured: one-line purpose, then Args and Returns sections. Every sentence is necessary and no redundant information. Appropriate length for five parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters, no annotations, no output schema), the description covers basic purpose and parameter meanings but lacks critical contextual details like what happens if notebook_path does not exist, return value structure, error handling, or permissions required. The description is adequate but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description carries the full burden. The Args section provides meaningful explanations for all five parameters including types, defaults, and enum values for cell_type. This adds significant value beyond the schema, though position indexing (0-based vs 1-based) and metadata format are not specified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'Add a new cell to a Jupyter notebook' with a specific verb and resource. It is distinct from sibling tools like execute_entire_notebook, execute_notebook_cell, get_notebook_info, and read_notebook_cells, which handle different operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. Does not mention prerequisites (e.g., notebook must exist) or scenarios where another tool would be preferred. The description only states what the tool does, not when to apply it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_entire_notebookA
Execute all code cells in a Jupyter notebook sequentially.

Args:
    notebook_path: Absolute path to the .ipynb file
    kernel_name: Jupyter kernel to use for execution
    timeout_per_cell: Timeout per cell in seconds
    stop_on_error: Whether to stop execution if a cell fails

Returns:
    Execution summary with results for each cell
ParametersJSON Schema
NameRequiredDescriptionDefault
kernel_nameNopython3
notebook_pathYes
stop_on_errorNo
timeout_per_cellNo

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes sequential execution and the stop_on_error parameter, but does not disclose potential side effects (e.g., modifying the notebook, resource consumption) or details on how execution affects the notebook state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, using a clear first sentence for purpose followed by structured Args and Returns sections. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (4 parameters, no output schema, no annotations), the description covers the tool's purpose and parameters adequately. It mentions a return summary, though details on the summary format are minimal. Still, it provides enough context for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description's Args section explains each parameter's meaning (absolute path, Jupyter kernel, timeout in seconds, boolean for stop). This adds value beyond the raw schema, though parameter descriptions could be more detailed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute all code cells in a Jupyter notebook sequentially,' specifying the verb (execute), resource (notebook), and scope (all cells). This distinguishes it from siblings like execute_notebook_cell or add_cell_to_notebook.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. It does not mention situations to prefer execute_notebook_cell or other siblings, nor does it provide exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_notebook_cellA
Execute a specific cell in a Jupyter notebook.

Args:
    notebook_path: Absolute path to the .ipynb file
    cell_index: Index of the cell to execute (0-based)
    kernel_name: Jupyter kernel to use for execution
    timeout: Execution timeout in seconds

Returns:
    Execution result with outputs
ParametersJSON Schema
NameRequiredDescriptionDefault
timeoutNo
cell_indexYes
kernel_nameNopython3
notebook_pathYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavior fully. It mentions execution and returns but does not cover side effects, synchronicity, timeout handling, or potential state changes. This lacks sufficient safety cues for an execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with clear sections for Args and Returns, no fluff. Every sentence adds value, and the main purpose is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers 4 parameters and vague return ('Execution result with outputs'), but with no output schema, more detail on output structure or errors would improve completeness. Adequate but not extensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description's detailed Args section adds full meaning for each parameter (e.g., path, index, kernel, timeout). This compensates for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute a specific cell in a Jupyter notebook,' identifying the resource (notebook cell) and action (execute). It differentiates from sibling tool 'execute_entire_notebook' by specifying 'specific cell'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'execute_entire_notebook' or 'read_notebook_cells'. No context for prerequisites or exclusions is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_notebook_infoB
Get basic information about a Jupyter notebook.

Args:
    notebook_path: Absolute path to the .ipynb file

Returns:
    Notebook metadata and statistics
ParametersJSON Schema
NameRequiredDescriptionDefault
notebook_pathYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry full burden of behavioral transparency. It fails to disclose traits such as read-only nature, required permissions, potential errors, or whether the info is always available. The docstring simply restates the purpose without behavioral implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, consisting of one clear sentence for purpose and a brief docstring. No extraneous information. It is well-structured and front-loaded with the main purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is minimally adequate given the tool's simplicity (1 param, no output schema). It states the return value as 'Notebook metadata and statistics', which is vague but sufficient. More details about what specific metadata is returned would improve completeness for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning to the parameter beyond the input schema: it specifies that notebook_path is an 'Absolute path to the .ipynb file'. This is helpful, but still lacks details like path format, required permissions, or handling of invalid paths. Schema coverage is 0%, so the description provides minimal compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Get basic information about a Jupyter notebook.' It uses a specific verb 'get' and a resource 'basic information about a Jupyter notebook', distinguishing it from sibling tools like add_cell_to_notebook or execute_notebook_cell which perform different actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention scenarios where getting basic info is preferable over reading cells or executing the notebook. The docstring only describes the tool's own function without context of sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_notebook_cellsA
Read cells from a Jupyter notebook.

Args:
    notebook_path: Absolute path to the .ipynb file
    cell_type: Optional filter by cell type ('code', 'markdown', 'raw')

Returns:
    List of cell dictionaries with metadata
ParametersJSON Schema
NameRequiredDescriptionDefault
cell_typeNo
notebook_pathYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavioral traits. It explains the read-only nature and return format (list of cell dictionaries with metadata), but omits details about file validation, error handling, or performance implications. Adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a clear structure: a one-sentence purpose, then Args and Returns sections. Every sentence adds value, and there is no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, no output schema, no annotations), the description covers main functionality, parameters, and return format. However, it is slightly incomplete by not addressing scenarios like non-existent files or empty results, but overall sufficient for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description carries full responsibility. It explains notebook_path as an absolute path and cell_type as an optional filter with allowed values ('code', 'markdown', 'raw'), adding meaning beyond the schema. Missing explanation of default behavior (returns all cells when filter is null).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Read cells from a Jupyter notebook', which is a specific verb+resource. It distinguishes itself from sibling tools like add_cell_to_notebook, execute_notebook_cell, and get_notebook_info by focusing on read-only access.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It lacks explicit usage context, exclusions, or references to other tools, leaving the agent without decision support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv0.1.0
    • First observedadd_cell_to_notebook
    • First observedexecute_entire_notebook
    • First observedexecute_notebook_cell
    • First observedget_notebook_info
    • First observedread_notebook_cells

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: adding cells, executing entire notebook, executing a specific cell, getting notebook info, and reading cells. No overlap exists.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case, such as add_cell_to_notebook, execute_entire_notebook, and read_notebook_cells.

Tool Count4/5

With 5 tools, the server is slightly underpopulated but still reasonable for focused notebook operations. The scope feels appropriate without being too thin.

Completeness3/5

The set covers adding, reading, and executing cells but is missing essential operations like creating or deleting notebooks and deleting cells, leaving notable gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to interact with Jupyter notebooks via MCP tools for querying, modifying, executing, and setting up notebooks, with state preservation and real-time collaboration.
    4
    45
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    A FastMCP server for loading, editing, searching, and saving Jupyter notebooks (.ipynb) through MCP tools. It maintains a single active notebook session with live cell indices that update as cells are inserted or removed.
    -