BM

block/mcp-jupyter

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

46 stars 9 forks 质量 66 趋势 0Apache-2.0

block/mcp-jupyter 是从 https://github.com/block/mcp-jupyter. 导入的 MCP 服务器候选

概览

block/mcp-jupyter 是从 https://github.com/block/mcp-jupyter. 导入的 MCP 服务器候选

概述(AI 翻译)

** ⚠️ API 兼容性通知**:本项目目前专注于 MCP(模型上下文协议)的使用。由于界面仍在不断演进,版本间没有 API 兼容性保证。任何版本中都可能发生破坏性变更。

Jupyter MCP Server 允许你使用 Goose 或 Cursor 等工具,与你在 JupyterLab 笔记本中配对,变量状态由 JupyterLab 内核保存。这实现了无缝协作,代理可以安装包、修复错误,并随时交给你进行数据探索。

架构:使用 Jupyter 的 REST API 实现可靠的代理操作,同时通过 RTC 保持实时用户同步。详见架构文档以获取详细技术信息。

主要特色

  • 4 合并MCP工具(从11个减少):
  • query_notebook - 所有只读操作(查看源代码、检查服务器等)
  • modify_notebook_cells - 所有单元格修改(添加、编辑、删除单元格)
  • execute_notebook_code - 所有执行操作(运行单元,安装包)
  • setup_notebook - 笔记本初始化和内核连接

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Jupyter MCP Server

⚠️ API Compatibility Notice: This project is currently focused on MCP (Model Context Protocol) usage. There are no API compatibility guarantees between versions as the interface is actively evolving. Breaking changes may occur in any release.

Jupyter MCP Server allows you to use tools like Goose or Cursor to pair with you in a JupyterLab notebook where the state of your variables is preserved by the JupyterLab Kernel. This enables seamless collaboration where agents can install packages, fix errors, and hand off to you for data exploration at any time.

Architecture: Uses Jupyter’s REST API for reliable agent operations while maintaining real-time user synchronization through RTC. See Architecture Documentation for detailed technical information.

Key Features

  • 4 Consolidated MCP Tools (reduced from 11):
    • query_notebook - All read-only operations (view source, check server, etc.)
    • modify_notebook_cells - All cell modifications (add, edit, delete cells)
    • execute_notebook_code - All execution operations (run cells, install packages)
    • setup_notebook - Notebook initialization and kernel connection
  • Workflow-oriented design optimized for AI agent collaboration
  • State preservation across notebook sessions
  • Automatic parameter validation with float-to-int conversion

This works with any client that supports MCP but will focus on using Goose for the examples.

Requirements

You will need UV is required to be installed.

Installation

This MCP server supports multiple transport modes and can be added to client with the command uvx mcp-jupyter.

Transport Modes

The server supports two transport protocols:

  • stdio (default) - Standard input/output communication, ideal for local IDE integrations
  • http - Streamable HTTP transport with session management, enabling serverless deployments and remote access

Use Cases for HTTP Transport

  • Serverless deployments: Host the MCP server in cloud environments (AWS Lambda, Google Cloud Functions, etc.)
  • Remote access: Connect to the server from different machines or networks
  • Web integrations: Build web-based AI assistants that connect to the MCP server
  • Stateless operations: Use --stateless-http for environments where session persistence isn’t needed

To use a specific transport:

# Default stdio transport
uvx mcp-jupyter

# HTTP transport on custom port (stateful - maintains session)
uvx mcp-jupyter --transport http --port 8080

# HTTP transport in stateless mode (no session persistence)
uvx mcp-jupyter --transport http --port 8080 --stateless-http

Using HTTP Transport with Cursor

To connect Cursor to an HTTP MCP server:

  1. Start the server separately:
uvx mcp-jupyter --transport http --port 8090
  1. Configure Cursor’s .cursor/mcp.json:
{
  "mcpServers": {
在 GitHub 查看完整 README

安装

uvx mcp-jupyter
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "notebook-http": { "url": "http://localhost:8090/mcp/" // ⚠️ Trailing slash is REQUIRED } } }