当前位置: 首页 > news >正文

Jupyter-notebook-mcp Quickstart

目录

    • 设置
    • 使用方法
      • 1. 启动你的Jupyter Notebook(6.x版本)服务器:
      • 2. 创建一个新的Jupyter笔记本,并确保选择`jupyter-mcp`内核:`kernel` -> `change kernel` -> `jupyter-mcp`,并设置trusted
      • 3. 在一个笔记本单元格中运行以下代码以初始化WebSocket服务器:
      • 4. 使用支持MCP的IDE桌面启动。

设置

  1. 克隆或下载此仓库到你的电脑:

    git clone https://github.com/jjsantos01/jupyter-notebook-mcp.git
    
  2. 创建包含所需软件包的虚拟环境并安装jupyter-mcp内核,以便它可以被你的jupyter安装识别(如果你之前有一个的话)。

    uv run python -m ipykernel install --name jupyter-mcp
    uv pip install ipywidgets
    
  3. (可选)为你的分析安装额外的Python包:

    uv pip install seaborn
    
  4. 配置IDE桌面集成:

       {"mcpServers": {"jupyter": {"command": "uv","args": ["--directory","/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/src","run","jupyter_mcp_server.py"]}}}
    

    /ABSOLUTE/PATH/TO/替换为你系统上src文件夹的实际路径。例如:

    • Windows: "C:\\Users\\MyUser\\GitHub\\jupyter-notebook-mcp\\src\\"
    • Mac: /Users/MyUser/GitHub/jupyter-notebook-mcp/src/

    例如:

    {"mcpServers": {"jupyter": {"command": "uv","args": ["--directory","D:/agent-llm/mcp_ser/jupyter-notebook-mcp/src","run","jupyter_mcp_server.py"]}}
    }
    

使用方法

1. 启动你的Jupyter Notebook(6.x版本)服务器:

uv run jupyter nbclassic

2. 创建一个新的Jupyter笔记本,并确保选择jupyter-mcp内核:kernel -> change kernel -> jupyter-mcp,并设置trusted

在这里插入图片描述

3. 在一个笔记本单元格中运行以下代码以初始化WebSocket服务器:

import sys
sys.path.append('/path/to/jupyter-notebook-mcp/src')  # 添加脚本所在位置的路径from jupyter_ws_server import setup_jupyter_mcp_integration# 在Jupyter中启动WebSocket服务器
server, port = setup_jupyter_mcp_integration()

不要忘记在这里将'/path/to/jupyter-notebook-mcp/src'替换为你系统上的src文件夹。例如:

  • Windows: "C:\\Users\\MyUser\\GitHub\\jupyter-notebook-mcp\\src\\"
  • Mac: /Users/MyUser/GitHub/jupyter-notebook-mcp/src/
    在这里插入图片描述

4. 使用支持MCP的IDE桌面启动。

例如trae:
设置好参数并连接,成功后显示下面参数

在这里插入图片描述

问题:

You have access to a Jupyter Notebook server.I need to create a presentation about Python's Seaborn library.  
The content is as follows:- What is Seaborn?
- Long vs. Wide data format
- Advantages of Seaborn over Matplotlib
- Commonly used Seaborn functions
- Live demonstration (comparison of Seaborn vs. Matplotlib)- Bar plot- Line plot- Scatter plotFor each concept, I want the main explanations provided in markdown cells, followed by one or more Python code cells demonstrating its usage. Keep the text concise—the cells shouldn't exceed 10 lines each.Use appropriate slideshow types for each cell to make the presentation visually appealing.

回答:
在这里插入图片描述

在这里插入图片描述

参考链接:
https://github.com/jjsantos01/jupyter-notebook-mcp/blob/main/README.md

http://www.lqws.cn/news/490267.html

相关文章:

  • 融合LSTM与自注意力机制的多步光伏功率预测新模型解析
  • SpringBoot多数据源配置详解
  • 《游戏工业级CI/CD实战:Jenkins+Node.js自动化构建与本地网盘部署方案》
  • 设计模式简介
  • 音视频全链路开发实践:基于SmartMediakit的架构设计与应用实战
  • SQLite3 在嵌入式系统中的应用指南
  • (8)(8.1) 光学流量传感器测试和设置(一)
  • 亚矩云手机赋能Vinted矩阵运营:破解二手电商多账号与本地化困局
  • Java面试复习:Java基础、面向对象编程、JVM原理、Spring框架解析
  • Docker单独部署grafana
  • Day40 训练和测试的规范写法
  • AI时代关键词SEO优化
  • Docker 服务无法启动问题
  • 阿里云无影:开启云端办公娱乐新时代
  • 阿里云Elasticsearch生产环境误删数据恢复指南
  • Long类型返回给前端精度丢失问题(解决方案)
  • Spring Boot 插件化开发模式
  • VM经常遇见的运行慢几种情况、以及设置方法
  • 从二维到三维:ArcGIS Pro与Aerialod联合制作三维人口密度分布图
  • C++的前世今生-C++11
  • 【智能协同云图库】智能协同云图库第一弹:前后端项目启动和初始化
  • vue3整合element-plus
  • Linux部署Sonic前后端(详细版)(腾讯云)
  • 老项目Android开发环境搭建的困境与解决之道-优雅草卓伊凡
  • 【数据库复习】
  • 用 EXCEL/WPS 实现聚类分析:赋能智能客服场景的最佳实践
  • 使用 catthehacker/ubuntu Docker 镜像部署 GitHub Actions 本地运行环境
  • 【C++项目】基于IPV4的流媒体广播
  • Redis中的bigkey的介绍及影响
  • 能耗管理新革命:物联网实现能源高效利用