MCP Catalogs
首页cursor-notebook-mcp screenshot

cursor-notebook-mcp

by jbeno·157·综合分 45

一个MCP服务器,使AI代理能够通过单元格操作和元数据编辑与Jupyter笔记本文件交互。

developer-toolsfile-systemai-llm
15
Forks
11
活跃 Issue
6 个月前
最近提交
2 天前
收录于

概述

cursor-notebook-mcp是一个基于Python的模型上下文协议(MCP)服务器,旨在帮助AI代理与Jupyter笔记本文件交互。它提供全面的工具用于创建、读取、编辑和导出笔记本文件,解决了Cursor在代理模式下无法直接编辑笔记本的限制。该服务器使用nbformat进行安全操作,使用nbconvert提供导出功能,并采取措施将操作限制在用户定义的目录中。

试试问 AI

装完之后,这里有 6 个你可以让 AI 做的事:

:AI代理在Cursor IDE中编辑Jupyter笔记本,用于数据分析和创建机器学习教程
:开发工作流程中的自动化笔记本验证和清理
:将笔记本转换为Python脚本或HTML格式用于文档目的
:这个服务器支持哪些传输模式?
:除了Cursor,这个服务器可以与其他AI工具一起使用吗?
:导出功能需要哪些外部依赖?

什么时候选它

当您需要通过 MCP 让 AI 代理执行全面的笔记本操作时,请选择这个 MCP 服务器。

什么时候不要选它

如果您需要 Jupyter 生态系统之外的更高级绘图或可视化工具,或者需要比基本单元格操作更集成的 AI/笔记本功能,请避免使用此服务器。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • notebook_create

    Creates a new, empty notebook file.

  • notebook_read

    Reads an entire notebook and returns its structure as a dictionary.

  • notebook_add_cell

    Adds a new code or markdown cell after a specified index.

  • notebook_edit_cell

    Replaces the source content of a specific cell.

  • notebook_delete_cell

    Deletes a specific cell.

  • notebook_export

    Exports the notebook to another format (e.g., python, html).

  • notebook_split_cell

    Splits a cell into two at a specified line number.

  • notebook_merge_cells

    Merges a cell with the cell immediately following it.

  • notebook_search

    Searches cells for a keyword, showing contextual snippets.

  • notebook_get_outline

    Produces an outline showing cell numbers with major headings/functions.

  • notebook_clear_all_outputs

    Clears outputs and execution counts for all code cells.

  • notebook_rename

    Renames/moves a notebook file from one path to another.

可对比工具

jupyter-mcpnotebook-integrationfile-system-mcp

安装

安装

从PyPI安装:

pip install cursor-notebook-mcp

从源码安装:

git clone https://github.com/jbeno/cursor-notebook-mcp.git
cd cursor-notebook-mcp
python -m venv .venv
source .venv/bin/activate  # Windows上使用 `.venv\Scripts\activate`
pip install -e .

服务器配置 (Cursor)

创建或更新您的 ~/.cursor/mcp.json

{
  "mcpServers": {
    "notebook_mcp": {
      "url": "http://127.0.0.1:8080/mcp"
    }
  }
}

然后运行服务器:

cursor-notebook-mcp --transport streamable-http --allow-root /path/to/your/notebooks --host 127.0.0.1 --port 8080

FAQ

这个服务器支持哪些传输模式?
该服务器支持stdio、流式HTTP和SSE传输模式。建议新设置使用流式HTTP。
除了Cursor,这个服务器可以与其他AI工具一起使用吗?
是的,虽然它是为Cursor设计的,但该服务器可以配置为与VS Code(Insiders)、Claude Code或任何支持MCP的模型/代理一起使用。
导出功能需要哪些外部依赖?
Pandoc用于大多数非HTML导出格式。对于PDF导出,nbconvert还需要LaTeX(推荐XeLaTeX)。

cursor-notebook-mcp 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。