Datalayer_jupyter Mcp Server

Datalayer_jupyter Mcp Server

🚀 🪐 ✨ Jupyter MCP 服务器

Jupyter MCP 服务器可助力你启动 JupyterLab 并实现实时协作,还能与 Claude Desktop 结合使用,为你提供便捷的笔记本操作体验。

Datalayer

成为赞助商

🚀 快速开始

启动 JupyterLab

请确保安装了以下内容。对笔记本的修改可以通过 Jupyter 实时协作(RTC)看到。

pip install jupyterlab jupyter-collaboration ipykernel

然后,使用以下命令启动 JupyterLab:

jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0

⚠️ 重要提示

--ip 设置为 0.0.0.0 以便运行在 Docker 容器中的 MCP 服务器能够访问您的本地 JupyterLab。

与 Claude Desktop 结合使用

要将其与 Claude Desktop 结合使用,请将以下内容添加到 claude_desktop_config.json 中:

⚠️ 重要提示

确保 SERVER_URLTOKEN 的端口与 jupyter lab 命令中使用的匹配。NOTEBOOK_PATH 应该相对于 JupyterLab 启动目录。

MacOS 和 Windows

{
"mcpServers": {
"jupyter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SERVER_URL",
"-e",
"TOKEN",
"-e",
"NOTEBOOK_PATH",
"datalayer/jupyter-mcp-server:latest"
],
"env": {
"SERVER_URL": "http://host.docker.internal:8888",
"TOKEN": "MY_TOKEN",
"NOTEBOOK_PATH": "notebook.ipynb"
}
}
}
}

Linux

{
"mcpServers": {
"jupyter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SERVER_URL",
"-e",
"TOKEN",
"-e",
"NOTEBOOK_PATH",
"--network=host",
"datalayer/jupyter-mcp-server:latest"
],
"env": {
"SERVER_URL": "http://localhost:8888",
"TOKEN": "MY_TOKEN",
"NOTEBOOK_PATH": "notebook.ipynb"
}
}
}
}

✨ 主要特性

组件 - 工具

当前服务器提供两个工具:

  1. add_execute_code_cell
  • 在 Jupyter 笔记本中添加并执行一个代码单元格。
  • 输入:
    • cell_content(字符串):要执行的代码
  • 返回:成功消息
  1. add_markdown_cell
  • 在 Jupyter 笔记本中添加一个 Markdown 单元格。
  • 输入:
    • cell_content(字符串):Markdown 内容
  • 返回:成功消息

📦 安装指南

构建

docker build -t datalayer/jupyter-mcp-server .

通过 Smithery 安装

要通过 Smithery 自动安装 Jupyter MCP Server 用于 Claude Desktop:

npx -y @smithery/cli install @datalayer/jupyter-mcp-server --client claude
  • 0 关注
  • 0 收藏,22 浏览
  • system 提出于 2025-10-02 15:39

相似服务问题

相关AI产品