<div align="center">
<!-- omit in toc -->
# 🪐 Jupyter MCP Server
<img title="cover" src="https://raw.githubusercontent.com/ChengJiale150/jupyter-mcp-server/main/assets/cover.png" alt="Jupyter MCP Server" data-align="center" width="700">
<strong>专门为AI连接与管理Jupyter Notebook而开发的MCP服务</strong>
*由 [ChengJiale150](https://github.com/ChengJiale150) 开发*
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://pypi.org/project/better-jupyter-mcp-server/)
[](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.ChengJiale150/jupyter-mcp-server)
[English](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/README_EN.md) | 中文
</div>
## 📖 目录
- [项目简介](#-项目简介)
- [工具一览](#-工具一览)
- [快速上手](#-快速上手)
- [最佳实践](#-最佳实践)
- [贡献指南](#-贡献指南)
- [致谢](#-致谢)
## 🎯 项目简介
Jupyter MCP Server 是一个基于 [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) 的服务,为目前最先进的的AI IDE(如 [Cursor](https://www.cursor.com/)) 与CLI工具(如[Gemini CLI](https://github.com/google-gemini/gemini-cli))提供连接与管理Jupyter Notebook的能力。使得AI能够操作Notebook,进行数据分析、可视化、机器学习等任务。
### 🤔 为什么需要Jupyter MCP Server
Jupyter Notebook 是数据科学家最常用的工具之一,它提供了一个交互式的环境,使其可以方便地进行数据分析、可视化、机器学习等探索性任务。然而,由于Notebook自身的格式限制,使得其难以像纯文本文件(如Markdown、Python文件)一样被AI直接理解。
现有的提供操作Notebook的工具或MCP服务,要么仅能阅读与编辑Notebook,要么仅能操纵单个Notebook,难以满足同时操纵多个Notebook的复杂需求。此外,大多数工具也不支持多模态输出,无法充分利用目前最先进的多模态大模型(如Gemini 2.5)的强大图文理解能力。
Jupyter MCP Server 就是为了解决这个问题而开发的。它通过MCP协议,向AI提供了管理Jupyter Kernel与Notebook的工具,使其能够操纵**多个Notebook**进行**交互式**的任务执行,并输出**多模态**结果,助力数据科学家提高分析效率。
### ✨ 关键亮点
- 🔌 **MCP兼容**: 能够在任何支持MCP协议的IDE或CLI工具中使用
- 📚 **多Notebook管理**: 支持同时管理多个Notebook
- 🔁 **交互式执行**: 能够根据Cell的输出自动调整执行策略
- 📊 **多模态输出**: 支持输出多模态结果,如文本、图片、表格等
## 🔧 工具一览
### Notebook管理模块
| 名称 | 描述 | 说明 |
|:----------------:|:------------------:|:-----------------------------------:|
| connect_notebook | 连接/创建指定路径的Notebook | 因为需要启动Kernel,工具执行时间较长(10s~30s) |
| list_notebook | 列出所有目前连接的Notebook | 用于查看目前已经连接的Notebook,方便多Notebook任务执行 |
| restart_notebook | 重启指定名称的Notebook | 清除所有导入包与变量 |
| read_notebook | 读取指定名称的Notebook的源内容(不包含输出) | 用于查看Notebook的源内容,仅在明确要求时才使用 |
### Cell基本功能模块
| 名称 | 描述 | 说明 |
|:------------:|:------------------------------:|:---------------:|
| list_cell | 列出指定名称的Notebook的所有Cell的基本信息 | 用于定位Cell的索引与作用 |
| read_cell | 读取指定名称的Notebook指定索引的Cell内容 | 支持图像、表格、文本等多种输出 |
| delete_cell | 删除指定名称的Notebook指定索引的Cell | |
| insert_cell | 在指定名称的Notebook指定索引处上方/下方插入Cell | |
| execute_cell | 执行指定名称的Notebook指定索引的Cell | 返回Cell的输出结果 |
| overwrite_cell | 覆盖指定名称的Notebook指定索引的Cell内容 | 用于修改Cell内容 |
### Cell高级集成功能模块
| 名称 | 描述 | 说明 |
|:----------------------:|:----------------------:|:------------------------------------:|
| append_execute_code_cell | 在Notebook末尾添加并执行Code Cell | insert+execute的组合为高频操作,将其组合减少工具的调用次数 |
| execute_temporary_code | 执行临时代码块(不存储到Notebook中) | 用于进行魔法指令执行、代码片段调试、查看中间变量取值等临时操作 |
工具的具体内容详见[工具文档](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/docs/tools.md)
## 🛠️ 快速上手
### 环境准备
- Python 3.12+(推荐使用[Anaconda](https://www.anaconda.com/))
- uv(安装详见[安装指南](https://docs.astral.sh/uv/getting-started/installation/))
### 安装Jupyter MCP Server
<details>
<summary>uvx 快速安装(推荐)</summary>
在安装uv后,直接配置MCP的JSON格式即可,示例如下:
```json
{
"mcpServers":{
"Jupyter-MCP-Server":{
"command": "uvx",
"args": [
"better-jupyter-mcp-server"
],
"env": {
"ALLOW_IMG": "true"
},
"transport": "stdio"
}
}
}
```
具体客户端集成详见[集成文档](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/docs/integration.md)
</details>
<details>
<summary>源代码</summary>
1. **克隆项目并安装依赖**
```bash
git clone https://github.com/ChengJiale150/jupyter-mcp-server
cd jupyter-mcp-server
uv sync
```
2. **(可选)配置config.toml**
进入[src/config.toml](./src/config.toml)文件,根据需要配置参数(如是否允许返回图片数据)
3. **启动Jupyter MCP Server**
```bash
uv run fastmcp run src/main.py
```
如果成功启动,会输出类似如下信息代表启动成功:
```bash
[09/14/25 20:14:59] INFO Starting MCP server 'Jupyter-MCP-Server' with transport 'stdio'
```
4. **配置标准JSON格式**
```json
{
"mcpServers":{
"Jupyter-MCP-Server":{
"command": "uv",
"args": [
"run",
"--directory",
"your/path/to/jupyter-mcp-server",
"src/main.py"
],
"env": {},
"transport": "stdio"
}
}
}
```
具体客户端集成详见[集成文档](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/docs/integration.md)
</details>
### 使用Jupyter MCP Server
<details>
<summary>本地手动启动Jupyter Server</summary>
在正式使用前,需要连接Jupyter Server,这里介绍如何在本地手动启动Jupyter Server:
1. **打开终端并激活环境**:
打开计算机终端命令行,并激活环境
对于使用conda(Anaconda)的用户,可以使用以下命令激活环境:
```bash
conda activate your_environment_name
```
这里为了方便起见,这里可以直接使用`base`环境(`conda activate base`)
然后切换到你当前的项目目录,方便后续的文件操作
```bash
cd your/path/to/your/project
```
2. **安装必要依赖**:
```bash
pip uninstall -y pycrdt datalayer_pycrdt
pip install jupyter nbformat datalayer_pycrdt jupyter-collaboration
```
3. **启动Jupyter Server**:
使用下述命令启动Jupyter Server
```bash
jupyter lab
```
成功启动后会弹出浏览器窗口,你可以在此查看根路径是否为工程目录
4. **获取认证Token**:
使用下述命令获取认证Token
```bash
jupyter server list
```
运行后会输出类似如下信息:
```bash
http://localhost:8888/?token=YOUR_TOKEN :: YOUR_PROJECT_PATH
```
其中`YOUR_TOKEN`为认证Token
5. **添加提示词与规则**
在正式使用前,你**必须**添加如下提示词于规则文件中以提供Jupyter MCP Server的必要连接信息:
```
以下是Jupyter服务器连接参数:
URL = http://localhost:8888
Token = YOUR_TOKEN
```
此外,推荐在提示词中添加关键Notebook路径信息,方便AI快速定位目标Notebook提高`connect_notebook`工具的执行效率,可以在Jupyter Lab网页中右键点击目标Notebook文件,选择`Copy Path`获取相对路径
在提供上述内容后,你就可以开始使用Jupyter MCP Server了!
</details>
<details>
<summary>使用LLM托管Jupyter Server</summary>
1. **安装必要依赖**:
```bash
pip uninstall -y pycrdt datalayer_pycrdt
pip install jupyter nbformat datalayer_pycrdt jupyter-collaboration
```
2. **提供提示词与规则文档**:
```markdown
## Jupyter MCP Server 使用指南
在正式使用Jupyter MCP Server前,你**必须**完成如下步骤:
1. **启动Jupyter Server**:
在当前项目目录中以不阻塞当前终端的方式在命令行终端中输入启动Jupyter Server,例如:
- `Window`: `start jupyter lab`
- `MacOS/Linux`: `nohup jupyter lab &`
2. **获取URL与认证Token**:
使用`jupyter server list`获取URL与认证Token
仅当完成上述步骤后,你才可以使用Jupyter MCP Server
```
</details>
## ✅ 最佳实践
- 使用支持多模态输入的大模型(如Gemini 2.5 Pro)进行交互,以充分利用最先进的多模态理解能力
- 使用支持MCP协议返回图像数据并支持解析的客户端(如Cursor、Gemini CLI等),部分客户端可能不支持该功能
- 将复杂任务(如数据科学建模)拆分为多个子任务(如数据清洗、特征工程、模型训练、模型评估等),并逐步执行
- 给出结构清晰的提示词与规则,这里可以参考[提示词与规则文档](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/docs/prompt_example.md)
- 在提示词中融入**专家经验与智慧**(如数据清洗、特征工程的技巧),这是AI最缺乏的,也是最需要补充的
- 尽可能提供丰富的上下文信息(如现有数据集的字段解释,文件路径,详细的任务要求等)
- 提供Few Shot案例,提供Baseline或已有Workflow作为参考
### 示例
- [Titanic数据集分析](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/example/Titanic)
## 🤝 贡献指南
我们欢迎社区贡献!如果您想为Jupyter MCP Server项目做出贡献,请:
1. Fork 本仓库
2. 创建您的特性分支 (`git checkout -b feature/AmazingFeature`)
3. 提交您的更改 (`git commit -m 'Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 开启一个 Pull Request
### 贡献类型
- 🐛 Bug修复
- 📝 旧功能完善
- ✨ 新功能开发
- 📚 文档改进
- 🌍 国际化支持
### 开发帮助文档
- 可以详见[项目架构文档](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/src/README.md)辅助理解项目架构与关键通信流程
## 🤗 致谢
本项目受到以下项目的帮助,在此表示感谢:
- [DataLayer](https://github.com/datalayer): 感谢DataLayer开源的[jupyter_nbmodel_client](https://github.com/datalayer/jupyter-nbmodel-client)与[jupyter_kernel_client](https://github.com/datalayer/jupyter-kernel-client)库,为Jupyter MCP的快速开发提供了极大的帮助
- [FastMCP](https://github.com/jlowin/fastmcp): 感谢FastMCP的开发者们,没有FastMCP就没有Jupyter MCP的快速集成
此外,本项目还参考了以下已有Jupyter MCP服务的实现,在此也一并表示感谢:
- [datalayer/jupyter-mcp-server](https://github.com/datalayer/jupyter-mcp-server)
- [jjsantos01/jupyter-notebook-mcp](https://github.com/jjsantos01/jupyter-notebook-mcp)
- [ihrpr/mcp-server-jupyter](https://github.com/ihrpr/mcp-server-jupyter)
- [itisaevalex/jupyter-mcp-extended](https://github.com/itisaevalex/jupyter-mcp-extended)
---
<div align="center">
**如果这个项目对您有帮助,请给我们一个 ⭐️**
Made with ❤️ by [ChengJiale150](https://github.com/ChengJiale150)
</div>
Raw data
{
"_id": null,
"home_page": null,
"name": "better-jupyter-mcp-server",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "ai, data-science, jupyter, machine-learning, mcp, model-context-protocol, notebook",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/4a/4a/ea49c04f3109033317fd6aca39156d25acbaf56110c4ff94115efea743df/better_jupyter_mcp_server-1.4.4.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n<!-- omit in toc -->\n\n# \ud83e\ude90 Jupyter MCP Server\n\n<img title=\"cover\" src=\"https://raw.githubusercontent.com/ChengJiale150/jupyter-mcp-server/main/assets/cover.png\" alt=\"Jupyter MCP Server\" data-align=\"center\" width=\"700\">\n\n<strong>\u4e13\u95e8\u4e3aAI\u8fde\u63a5\u4e0e\u7ba1\u7406Jupyter Notebook\u800c\u5f00\u53d1\u7684MCP\u670d\u52a1</strong>\n\n*\u7531 [ChengJiale150](https://github.com/ChengJiale150) \u5f00\u53d1*\n\n[](https://www.python.org/downloads/)\n[](LICENSE)\n[](https://pypi.org/project/better-jupyter-mcp-server/)\n[](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.ChengJiale150/jupyter-mcp-server)\n\n[English](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/README_EN.md) | \u4e2d\u6587\n\n</div>\n\n## \ud83d\udcd6 \u76ee\u5f55\n\n- [\u9879\u76ee\u7b80\u4ecb](#-\u9879\u76ee\u7b80\u4ecb)\n- [\u5de5\u5177\u4e00\u89c8](#-\u5de5\u5177\u4e00\u89c8)\n- [\u5feb\u901f\u4e0a\u624b](#-\u5feb\u901f\u4e0a\u624b)\n- [\u6700\u4f73\u5b9e\u8df5](#-\u6700\u4f73\u5b9e\u8df5)\n- [\u8d21\u732e\u6307\u5357](#-\u8d21\u732e\u6307\u5357)\n- [\u81f4\u8c22](#-\u81f4\u8c22)\n\n## \ud83c\udfaf \u9879\u76ee\u7b80\u4ecb\n\nJupyter MCP Server \u662f\u4e00\u4e2a\u57fa\u4e8e [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) \u7684\u670d\u52a1\uff0c\u4e3a\u76ee\u524d\u6700\u5148\u8fdb\u7684\u7684AI IDE(\u5982 [Cursor](https://www.cursor.com/)) \u4e0eCLI\u5de5\u5177(\u5982[Gemini CLI](https://github.com/google-gemini/gemini-cli))\u63d0\u4f9b\u8fde\u63a5\u4e0e\u7ba1\u7406Jupyter Notebook\u7684\u80fd\u529b\u3002\u4f7f\u5f97AI\u80fd\u591f\u64cd\u4f5cNotebook\uff0c\u8fdb\u884c\u6570\u636e\u5206\u6790\u3001\u53ef\u89c6\u5316\u3001\u673a\u5668\u5b66\u4e60\u7b49\u4efb\u52a1\u3002\n\n### \ud83e\udd14 \u4e3a\u4ec0\u4e48\u9700\u8981Jupyter MCP Server\n\nJupyter Notebook \u662f\u6570\u636e\u79d1\u5b66\u5bb6\u6700\u5e38\u7528\u7684\u5de5\u5177\u4e4b\u4e00\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7684\u73af\u5883\uff0c\u4f7f\u5176\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u5206\u6790\u3001\u53ef\u89c6\u5316\u3001\u673a\u5668\u5b66\u4e60\u7b49\u63a2\u7d22\u6027\u4efb\u52a1\u3002\u7136\u800c\uff0c\u7531\u4e8eNotebook\u81ea\u8eab\u7684\u683c\u5f0f\u9650\u5236\uff0c\u4f7f\u5f97\u5176\u96be\u4ee5\u50cf\u7eaf\u6587\u672c\u6587\u4ef6\uff08\u5982Markdown\u3001Python\u6587\u4ef6\uff09\u4e00\u6837\u88abAI\u76f4\u63a5\u7406\u89e3\u3002\n\n\u73b0\u6709\u7684\u63d0\u4f9b\u64cd\u4f5cNotebook\u7684\u5de5\u5177\u6216MCP\u670d\u52a1\uff0c\u8981\u4e48\u4ec5\u80fd\u9605\u8bfb\u4e0e\u7f16\u8f91Notebook\uff0c\u8981\u4e48\u4ec5\u80fd\u64cd\u7eb5\u5355\u4e2aNotebook\uff0c\u96be\u4ee5\u6ee1\u8db3\u540c\u65f6\u64cd\u7eb5\u591a\u4e2aNotebook\u7684\u590d\u6742\u9700\u6c42\u3002\u6b64\u5916\uff0c\u5927\u591a\u6570\u5de5\u5177\u4e5f\u4e0d\u652f\u6301\u591a\u6a21\u6001\u8f93\u51fa\uff0c\u65e0\u6cd5\u5145\u5206\u5229\u7528\u76ee\u524d\u6700\u5148\u8fdb\u7684\u591a\u6a21\u6001\u5927\u6a21\u578b\uff08\u5982Gemini 2.5\uff09\u7684\u5f3a\u5927\u56fe\u6587\u7406\u89e3\u80fd\u529b\u3002\n\nJupyter MCP Server \u5c31\u662f\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u800c\u5f00\u53d1\u7684\u3002\u5b83\u901a\u8fc7MCP\u534f\u8bae\uff0c\u5411AI\u63d0\u4f9b\u4e86\u7ba1\u7406Jupyter Kernel\u4e0eNotebook\u7684\u5de5\u5177\uff0c\u4f7f\u5176\u80fd\u591f\u64cd\u7eb5**\u591a\u4e2aNotebook**\u8fdb\u884c**\u4ea4\u4e92\u5f0f**\u7684\u4efb\u52a1\u6267\u884c\uff0c\u5e76\u8f93\u51fa**\u591a\u6a21\u6001**\u7ed3\u679c\uff0c\u52a9\u529b\u6570\u636e\u79d1\u5b66\u5bb6\u63d0\u9ad8\u5206\u6790\u6548\u7387\u3002\n\n### \u2728 \u5173\u952e\u4eae\u70b9\n\n- \ud83d\udd0c **MCP\u517c\u5bb9**: \u80fd\u591f\u5728\u4efb\u4f55\u652f\u6301MCP\u534f\u8bae\u7684IDE\u6216CLI\u5de5\u5177\u4e2d\u4f7f\u7528\n- \ud83d\udcda **\u591aNotebook\u7ba1\u7406**: \u652f\u6301\u540c\u65f6\u7ba1\u7406\u591a\u4e2aNotebook\n- \ud83d\udd01 **\u4ea4\u4e92\u5f0f\u6267\u884c**: \u80fd\u591f\u6839\u636eCell\u7684\u8f93\u51fa\u81ea\u52a8\u8c03\u6574\u6267\u884c\u7b56\u7565\n- \ud83d\udcca **\u591a\u6a21\u6001\u8f93\u51fa**: \u652f\u6301\u8f93\u51fa\u591a\u6a21\u6001\u7ed3\u679c\uff0c\u5982\u6587\u672c\u3001\u56fe\u7247\u3001\u8868\u683c\u7b49\n\n## \ud83d\udd27 \u5de5\u5177\u4e00\u89c8\n\n### Notebook\u7ba1\u7406\u6a21\u5757\n\n| \u540d\u79f0 | \u63cf\u8ff0 | \u8bf4\u660e |\n|:----------------:|:------------------:|:-----------------------------------:|\n| connect_notebook | \u8fde\u63a5/\u521b\u5efa\u6307\u5b9a\u8def\u5f84\u7684Notebook | \u56e0\u4e3a\u9700\u8981\u542f\u52a8Kernel,\u5de5\u5177\u6267\u884c\u65f6\u95f4\u8f83\u957f(10s~30s) |\n| list_notebook | \u5217\u51fa\u6240\u6709\u76ee\u524d\u8fde\u63a5\u7684Notebook | \u7528\u4e8e\u67e5\u770b\u76ee\u524d\u5df2\u7ecf\u8fde\u63a5\u7684Notebook,\u65b9\u4fbf\u591aNotebook\u4efb\u52a1\u6267\u884c |\n| restart_notebook | \u91cd\u542f\u6307\u5b9a\u540d\u79f0\u7684Notebook | \u6e05\u9664\u6240\u6709\u5bfc\u5165\u5305\u4e0e\u53d8\u91cf |\n| read_notebook | \u8bfb\u53d6\u6307\u5b9a\u540d\u79f0\u7684Notebook\u7684\u6e90\u5185\u5bb9(\u4e0d\u5305\u542b\u8f93\u51fa) | \u7528\u4e8e\u67e5\u770bNotebook\u7684\u6e90\u5185\u5bb9,\u4ec5\u5728\u660e\u786e\u8981\u6c42\u65f6\u624d\u4f7f\u7528 |\n\n### Cell\u57fa\u672c\u529f\u80fd\u6a21\u5757\n\n| \u540d\u79f0 | \u63cf\u8ff0 | \u8bf4\u660e |\n|:------------:|:------------------------------:|:---------------:|\n| list_cell | \u5217\u51fa\u6307\u5b9a\u540d\u79f0\u7684Notebook\u7684\u6240\u6709Cell\u7684\u57fa\u672c\u4fe1\u606f | \u7528\u4e8e\u5b9a\u4f4dCell\u7684\u7d22\u5f15\u4e0e\u4f5c\u7528 |\n| read_cell | \u8bfb\u53d6\u6307\u5b9a\u540d\u79f0\u7684Notebook\u6307\u5b9a\u7d22\u5f15\u7684Cell\u5185\u5bb9 | \u652f\u6301\u56fe\u50cf\u3001\u8868\u683c\u3001\u6587\u672c\u7b49\u591a\u79cd\u8f93\u51fa |\n| delete_cell | \u5220\u9664\u6307\u5b9a\u540d\u79f0\u7684Notebook\u6307\u5b9a\u7d22\u5f15\u7684Cell | |\n| insert_cell | \u5728\u6307\u5b9a\u540d\u79f0\u7684Notebook\u6307\u5b9a\u7d22\u5f15\u5904\u4e0a\u65b9/\u4e0b\u65b9\u63d2\u5165Cell | |\n| execute_cell | \u6267\u884c\u6307\u5b9a\u540d\u79f0\u7684Notebook\u6307\u5b9a\u7d22\u5f15\u7684Cell | \u8fd4\u56deCell\u7684\u8f93\u51fa\u7ed3\u679c |\n| overwrite_cell | \u8986\u76d6\u6307\u5b9a\u540d\u79f0\u7684Notebook\u6307\u5b9a\u7d22\u5f15\u7684Cell\u5185\u5bb9 | \u7528\u4e8e\u4fee\u6539Cell\u5185\u5bb9 |\n\n### Cell\u9ad8\u7ea7\u96c6\u6210\u529f\u80fd\u6a21\u5757\n\n| \u540d\u79f0 | \u63cf\u8ff0 | \u8bf4\u660e |\n|:----------------------:|:----------------------:|:------------------------------------:|\n| append_execute_code_cell | \u5728Notebook\u672b\u5c3e\u6dfb\u52a0\u5e76\u6267\u884cCode Cell | insert+execute\u7684\u7ec4\u5408\u4e3a\u9ad8\u9891\u64cd\u4f5c,\u5c06\u5176\u7ec4\u5408\u51cf\u5c11\u5de5\u5177\u7684\u8c03\u7528\u6b21\u6570 |\n| execute_temporary_code | \u6267\u884c\u4e34\u65f6\u4ee3\u7801\u5757(\u4e0d\u5b58\u50a8\u5230Notebook\u4e2d) | \u7528\u4e8e\u8fdb\u884c\u9b54\u6cd5\u6307\u4ee4\u6267\u884c\u3001\u4ee3\u7801\u7247\u6bb5\u8c03\u8bd5\u3001\u67e5\u770b\u4e2d\u95f4\u53d8\u91cf\u53d6\u503c\u7b49\u4e34\u65f6\u64cd\u4f5c |\n\n\u5de5\u5177\u7684\u5177\u4f53\u5185\u5bb9\u8be6\u89c1[\u5de5\u5177\u6587\u6863](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/docs/tools.md)\n\n## \ud83d\udee0\ufe0f \u5feb\u901f\u4e0a\u624b\n\n### \u73af\u5883\u51c6\u5907\n\n- Python 3.12+(\u63a8\u8350\u4f7f\u7528[Anaconda](https://www.anaconda.com/))\n- uv(\u5b89\u88c5\u8be6\u89c1[\u5b89\u88c5\u6307\u5357](https://docs.astral.sh/uv/getting-started/installation/))\n\n### \u5b89\u88c5Jupyter MCP Server\n\n<details>\n\n<summary>uvx \u5feb\u901f\u5b89\u88c5(\u63a8\u8350)</summary>\n\n\u5728\u5b89\u88c5uv\u540e,\u76f4\u63a5\u914d\u7f6eMCP\u7684JSON\u683c\u5f0f\u5373\u53ef,\u793a\u4f8b\u5982\u4e0b:\n\n```json\n{\n \"mcpServers\":{\n \"Jupyter-MCP-Server\":{\n \"command\": \"uvx\",\n \"args\": [\n \"better-jupyter-mcp-server\"\n ],\n \"env\": {\n \"ALLOW_IMG\": \"true\"\n },\n \"transport\": \"stdio\"\n }\n }\n}\n```\n\n\u5177\u4f53\u5ba2\u6237\u7aef\u96c6\u6210\u8be6\u89c1[\u96c6\u6210\u6587\u6863](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/docs/integration.md)\n\n</details>\n\n<details>\n\n<summary>\u6e90\u4ee3\u7801</summary>\n\n1. **\u514b\u9686\u9879\u76ee\u5e76\u5b89\u88c5\u4f9d\u8d56**\n\n```bash\ngit clone https://github.com/ChengJiale150/jupyter-mcp-server\ncd jupyter-mcp-server\nuv sync\n```\n\n2. **(\u53ef\u9009)\u914d\u7f6econfig.toml**\n\n\u8fdb\u5165[src/config.toml](./src/config.toml)\u6587\u4ef6,\u6839\u636e\u9700\u8981\u914d\u7f6e\u53c2\u6570(\u5982\u662f\u5426\u5141\u8bb8\u8fd4\u56de\u56fe\u7247\u6570\u636e)\n\n3. **\u542f\u52a8Jupyter MCP Server**\n\n```bash\nuv run fastmcp run src/main.py\n```\n\n\u5982\u679c\u6210\u529f\u542f\u52a8,\u4f1a\u8f93\u51fa\u7c7b\u4f3c\u5982\u4e0b\u4fe1\u606f\u4ee3\u8868\u542f\u52a8\u6210\u529f:\n\n```bash\n[09/14/25 20:14:59] INFO Starting MCP server 'Jupyter-MCP-Server' with transport 'stdio' \n```\n\n4. **\u914d\u7f6e\u6807\u51c6JSON\u683c\u5f0f**\n\n```json\n{\n \"mcpServers\":{\n \"Jupyter-MCP-Server\":{\n \"command\": \"uv\",\n \"args\": [\n \"run\",\n \"--directory\",\n \"your/path/to/jupyter-mcp-server\",\n \"src/main.py\"\n ],\n \"env\": {},\n \"transport\": \"stdio\"\n }\n }\n}\n```\n\n\n\u5177\u4f53\u5ba2\u6237\u7aef\u96c6\u6210\u8be6\u89c1[\u96c6\u6210\u6587\u6863](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/docs/integration.md)\n\n</details>\n\n### \u4f7f\u7528Jupyter MCP Server\n\n<details>\n\n<summary>\u672c\u5730\u624b\u52a8\u542f\u52a8Jupyter Server</summary>\n\n\u5728\u6b63\u5f0f\u4f7f\u7528\u524d,\u9700\u8981\u8fde\u63a5Jupyter Server,\u8fd9\u91cc\u4ecb\u7ecd\u5982\u4f55\u5728\u672c\u5730\u624b\u52a8\u542f\u52a8Jupyter Server:\n\n1. **\u6253\u5f00\u7ec8\u7aef\u5e76\u6fc0\u6d3b\u73af\u5883**:\n\n\u6253\u5f00\u8ba1\u7b97\u673a\u7ec8\u7aef\u547d\u4ee4\u884c,\u5e76\u6fc0\u6d3b\u73af\u5883\n\n\u5bf9\u4e8e\u4f7f\u7528conda(Anaconda)\u7684\u7528\u6237,\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6fc0\u6d3b\u73af\u5883:\n\n```bash\nconda activate your_environment_name\n```\n\n\u8fd9\u91cc\u4e3a\u4e86\u65b9\u4fbf\u8d77\u89c1,\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528`base`\u73af\u5883(`conda activate base`)\n\n\u7136\u540e\u5207\u6362\u5230\u4f60\u5f53\u524d\u7684\u9879\u76ee\u76ee\u5f55,\u65b9\u4fbf\u540e\u7eed\u7684\u6587\u4ef6\u64cd\u4f5c\n\n```bash\ncd your/path/to/your/project\n```\n\n2. **\u5b89\u88c5\u5fc5\u8981\u4f9d\u8d56**:\n\n```bash\npip uninstall -y pycrdt datalayer_pycrdt\npip install jupyter nbformat datalayer_pycrdt jupyter-collaboration\n```\n\n3. **\u542f\u52a8Jupyter Server**:\n\n\u4f7f\u7528\u4e0b\u8ff0\u547d\u4ee4\u542f\u52a8Jupyter Server\n\n```bash\njupyter lab\n```\n\n\u6210\u529f\u542f\u52a8\u540e\u4f1a\u5f39\u51fa\u6d4f\u89c8\u5668\u7a97\u53e3,\u4f60\u53ef\u4ee5\u5728\u6b64\u67e5\u770b\u6839\u8def\u5f84\u662f\u5426\u4e3a\u5de5\u7a0b\u76ee\u5f55\n\n4. **\u83b7\u53d6\u8ba4\u8bc1Token**:\n\n\u4f7f\u7528\u4e0b\u8ff0\u547d\u4ee4\u83b7\u53d6\u8ba4\u8bc1Token\n\n```bash\njupyter server list\n```\n\n\u8fd0\u884c\u540e\u4f1a\u8f93\u51fa\u7c7b\u4f3c\u5982\u4e0b\u4fe1\u606f:\n\n```bash\nhttp://localhost:8888/?token=YOUR_TOKEN :: YOUR_PROJECT_PATH\n```\n\n\u5176\u4e2d`YOUR_TOKEN`\u4e3a\u8ba4\u8bc1Token\n\n5. **\u6dfb\u52a0\u63d0\u793a\u8bcd\u4e0e\u89c4\u5219**\n\n\u5728\u6b63\u5f0f\u4f7f\u7528\u524d,\u4f60**\u5fc5\u987b**\u6dfb\u52a0\u5982\u4e0b\u63d0\u793a\u8bcd\u4e8e\u89c4\u5219\u6587\u4ef6\u4e2d\u4ee5\u63d0\u4f9bJupyter MCP Server\u7684\u5fc5\u8981\u8fde\u63a5\u4fe1\u606f:\n\n```\n\u4ee5\u4e0b\u662fJupyter\u670d\u52a1\u5668\u8fde\u63a5\u53c2\u6570:\nURL = http://localhost:8888\nToken = YOUR_TOKEN\n```\n\n\u6b64\u5916,\u63a8\u8350\u5728\u63d0\u793a\u8bcd\u4e2d\u6dfb\u52a0\u5173\u952eNotebook\u8def\u5f84\u4fe1\u606f,\u65b9\u4fbfAI\u5feb\u901f\u5b9a\u4f4d\u76ee\u6807Notebook\u63d0\u9ad8`connect_notebook`\u5de5\u5177\u7684\u6267\u884c\u6548\u7387,\u53ef\u4ee5\u5728Jupyter Lab\u7f51\u9875\u4e2d\u53f3\u952e\u70b9\u51fb\u76ee\u6807Notebook\u6587\u4ef6,\u9009\u62e9`Copy Path`\u83b7\u53d6\u76f8\u5bf9\u8def\u5f84\n\n\u5728\u63d0\u4f9b\u4e0a\u8ff0\u5185\u5bb9\u540e,\u4f60\u5c31\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528Jupyter MCP Server\u4e86!\n\n</details>\n\n<details>\n\n<summary>\u4f7f\u7528LLM\u6258\u7ba1Jupyter Server</summary>\n\n1. **\u5b89\u88c5\u5fc5\u8981\u4f9d\u8d56**:\n\n```bash\npip uninstall -y pycrdt datalayer_pycrdt\npip install jupyter nbformat datalayer_pycrdt jupyter-collaboration\n```\n\n2. **\u63d0\u4f9b\u63d0\u793a\u8bcd\u4e0e\u89c4\u5219\u6587\u6863**:\n\n```markdown\n## Jupyter MCP Server \u4f7f\u7528\u6307\u5357\n\n\u5728\u6b63\u5f0f\u4f7f\u7528Jupyter MCP Server\u524d,\u4f60**\u5fc5\u987b**\u5b8c\u6210\u5982\u4e0b\u6b65\u9aa4:\n\n1. **\u542f\u52a8Jupyter Server**:\n\n\u5728\u5f53\u524d\u9879\u76ee\u76ee\u5f55\u4e2d\u4ee5\u4e0d\u963b\u585e\u5f53\u524d\u7ec8\u7aef\u7684\u65b9\u5f0f\u5728\u547d\u4ee4\u884c\u7ec8\u7aef\u4e2d\u8f93\u5165\u542f\u52a8Jupyter Server,\u4f8b\u5982:\n- `Window`: `start jupyter lab`\n- `MacOS/Linux`: `nohup jupyter lab &`\n\n2. **\u83b7\u53d6URL\u4e0e\u8ba4\u8bc1Token**:\n\n\u4f7f\u7528`jupyter server list`\u83b7\u53d6URL\u4e0e\u8ba4\u8bc1Token\n\n\u4ec5\u5f53\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u540e,\u4f60\u624d\u53ef\u4ee5\u4f7f\u7528Jupyter MCP Server\n```\n\n</details>\n\n## \u2705 \u6700\u4f73\u5b9e\u8df5\n\n- \u4f7f\u7528\u652f\u6301\u591a\u6a21\u6001\u8f93\u5165\u7684\u5927\u6a21\u578b(\u5982Gemini 2.5 Pro)\u8fdb\u884c\u4ea4\u4e92,\u4ee5\u5145\u5206\u5229\u7528\u6700\u5148\u8fdb\u7684\u591a\u6a21\u6001\u7406\u89e3\u80fd\u529b\n- \u4f7f\u7528\u652f\u6301MCP\u534f\u8bae\u8fd4\u56de\u56fe\u50cf\u6570\u636e\u5e76\u652f\u6301\u89e3\u6790\u7684\u5ba2\u6237\u7aef(\u5982Cursor\u3001Gemini CLI\u7b49),\u90e8\u5206\u5ba2\u6237\u7aef\u53ef\u80fd\u4e0d\u652f\u6301\u8be5\u529f\u80fd\n- \u5c06\u590d\u6742\u4efb\u52a1(\u5982\u6570\u636e\u79d1\u5b66\u5efa\u6a21)\u62c6\u5206\u4e3a\u591a\u4e2a\u5b50\u4efb\u52a1(\u5982\u6570\u636e\u6e05\u6d17\u3001\u7279\u5f81\u5de5\u7a0b\u3001\u6a21\u578b\u8bad\u7ec3\u3001\u6a21\u578b\u8bc4\u4f30\u7b49),\u5e76\u9010\u6b65\u6267\u884c\n- \u7ed9\u51fa\u7ed3\u6784\u6e05\u6670\u7684\u63d0\u793a\u8bcd\u4e0e\u89c4\u5219,\u8fd9\u91cc\u53ef\u4ee5\u53c2\u8003[\u63d0\u793a\u8bcd\u4e0e\u89c4\u5219\u6587\u6863](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/docs/prompt_example.md)\n- \u5728\u63d0\u793a\u8bcd\u4e2d\u878d\u5165**\u4e13\u5bb6\u7ecf\u9a8c\u4e0e\u667a\u6167**(\u5982\u6570\u636e\u6e05\u6d17\u3001\u7279\u5f81\u5de5\u7a0b\u7684\u6280\u5de7),\u8fd9\u662fAI\u6700\u7f3a\u4e4f\u7684,\u4e5f\u662f\u6700\u9700\u8981\u8865\u5145\u7684\n- \u5c3d\u53ef\u80fd\u63d0\u4f9b\u4e30\u5bcc\u7684\u4e0a\u4e0b\u6587\u4fe1\u606f(\u5982\u73b0\u6709\u6570\u636e\u96c6\u7684\u5b57\u6bb5\u89e3\u91ca,\u6587\u4ef6\u8def\u5f84,\u8be6\u7ec6\u7684\u4efb\u52a1\u8981\u6c42\u7b49)\n- \u63d0\u4f9bFew Shot\u6848\u4f8b,\u63d0\u4f9bBaseline\u6216\u5df2\u6709Workflow\u4f5c\u4e3a\u53c2\u8003\n\n### \u793a\u4f8b\n\n- [Titanic\u6570\u636e\u96c6\u5206\u6790](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/example/Titanic)\n\n## \ud83e\udd1d \u8d21\u732e\u6307\u5357\n\n\u6211\u4eec\u6b22\u8fce\u793e\u533a\u8d21\u732e\uff01\u5982\u679c\u60a8\u60f3\u4e3aJupyter MCP Server\u9879\u76ee\u505a\u51fa\u8d21\u732e\uff0c\u8bf7\uff1a\n\n1. Fork \u672c\u4ed3\u5e93\n2. \u521b\u5efa\u60a8\u7684\u7279\u6027\u5206\u652f (`git checkout -b feature/AmazingFeature`)\n3. \u63d0\u4ea4\u60a8\u7684\u66f4\u6539 (`git commit -m 'Add some AmazingFeature'`)\n4. \u63a8\u9001\u5230\u5206\u652f (`git push origin feature/AmazingFeature`)\n5. \u5f00\u542f\u4e00\u4e2a Pull Request\n\n### \u8d21\u732e\u7c7b\u578b\n\n- \ud83d\udc1b Bug\u4fee\u590d\n- \ud83d\udcdd \u65e7\u529f\u80fd\u5b8c\u5584\n- \u2728 \u65b0\u529f\u80fd\u5f00\u53d1\n- \ud83d\udcda \u6587\u6863\u6539\u8fdb\n- \ud83c\udf0d \u56fd\u9645\u5316\u652f\u6301\n\n### \u5f00\u53d1\u5e2e\u52a9\u6587\u6863\n\n- \u53ef\u4ee5\u8be6\u89c1[\u9879\u76ee\u67b6\u6784\u6587\u6863](https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/src/README.md)\u8f85\u52a9\u7406\u89e3\u9879\u76ee\u67b6\u6784\u4e0e\u5173\u952e\u901a\u4fe1\u6d41\u7a0b\n\n## \ud83e\udd17 \u81f4\u8c22\n\n\u672c\u9879\u76ee\u53d7\u5230\u4ee5\u4e0b\u9879\u76ee\u7684\u5e2e\u52a9,\u5728\u6b64\u8868\u793a\u611f\u8c22:\n\n- [DataLayer](https://github.com/datalayer): \u611f\u8c22DataLayer\u5f00\u6e90\u7684[jupyter_nbmodel_client](https://github.com/datalayer/jupyter-nbmodel-client)\u4e0e[jupyter_kernel_client](https://github.com/datalayer/jupyter-kernel-client)\u5e93,\u4e3aJupyter MCP\u7684\u5feb\u901f\u5f00\u53d1\u63d0\u4f9b\u4e86\u6781\u5927\u7684\u5e2e\u52a9\n- [FastMCP](https://github.com/jlowin/fastmcp): \u611f\u8c22FastMCP\u7684\u5f00\u53d1\u8005\u4eec,\u6ca1\u6709FastMCP\u5c31\u6ca1\u6709Jupyter MCP\u7684\u5feb\u901f\u96c6\u6210\n\n\u6b64\u5916,\u672c\u9879\u76ee\u8fd8\u53c2\u8003\u4e86\u4ee5\u4e0b\u5df2\u6709Jupyter MCP\u670d\u52a1\u7684\u5b9e\u73b0,\u5728\u6b64\u4e5f\u4e00\u5e76\u8868\u793a\u611f\u8c22:\n\n- [datalayer/jupyter-mcp-server](https://github.com/datalayer/jupyter-mcp-server)\n- [jjsantos01/jupyter-notebook-mcp](https://github.com/jjsantos01/jupyter-notebook-mcp)\n- [ihrpr/mcp-server-jupyter](https://github.com/ihrpr/mcp-server-jupyter)\n- [itisaevalex/jupyter-mcp-extended](https://github.com/itisaevalex/jupyter-mcp-extended)\n\n---\n\n<div align=\"center\">\n\n**\u5982\u679c\u8fd9\u4e2a\u9879\u76ee\u5bf9\u60a8\u6709\u5e2e\u52a9\uff0c\u8bf7\u7ed9\u6211\u4eec\u4e00\u4e2a \u2b50\ufe0f**\n\nMade with \u2764\ufe0f by [ChengJiale150](https://github.com/ChengJiale150)\n\n</div>",
"bugtrack_url": null,
"license": "MIT",
"summary": "A powerful MCP server for AI-driven Jupyter Notebook management and execution",
"version": "1.4.4",
"project_urls": {
"Documentation": "https://github.com/ChengJiale150/jupyter-mcp-server/blob/main/README.md",
"Homepage": "https://github.com/ChengJiale150/jupyter-mcp-server",
"Issues": "https://github.com/ChengJiale150/jupyter-mcp-server/issues",
"Repository": "https://github.com/ChengJiale150/jupyter-mcp-server"
},
"split_keywords": [
"ai",
" data-science",
" jupyter",
" machine-learning",
" mcp",
" model-context-protocol",
" notebook"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "603e7110f73be1f1b57219a69d7769539b79f96cb23b23e184a30a1cd1d801c9",
"md5": "c5ec625e17c9a2dcb1a65d251bf9af61",
"sha256": "bcf66810d0b070807a402c57af511832531d707765dee7b40874454398fde6ca"
},
"downloads": -1,
"filename": "better_jupyter_mcp_server-1.4.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c5ec625e17c9a2dcb1a65d251bf9af61",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 20295,
"upload_time": "2025-10-07T08:48:09",
"upload_time_iso_8601": "2025-10-07T08:48:09.530766Z",
"url": "https://files.pythonhosted.org/packages/60/3e/7110f73be1f1b57219a69d7769539b79f96cb23b23e184a30a1cd1d801c9/better_jupyter_mcp_server-1.4.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4a4aea49c04f3109033317fd6aca39156d25acbaf56110c4ff94115efea743df",
"md5": "76a47b481c7e2df37912f485c0f075ad",
"sha256": "78201485d55c3277e9e746b13c58d30d38b3e467bb4a6975000083a3b751bae3"
},
"downloads": -1,
"filename": "better_jupyter_mcp_server-1.4.4.tar.gz",
"has_sig": false,
"md5_digest": "76a47b481c7e2df37912f485c0f075ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 26647,
"upload_time": "2025-10-07T08:48:10",
"upload_time_iso_8601": "2025-10-07T08:48:10.680959Z",
"url": "https://files.pythonhosted.org/packages/4a/4a/ea49c04f3109033317fd6aca39156d25acbaf56110c4ff94115efea743df/better_jupyter_mcp_server-1.4.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-07 08:48:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ChengJiale150",
"github_project": "jupyter-mcp-server",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "better-jupyter-mcp-server"
}