npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@taotao7/notebook2rw

v0.1.2

Published

Jupyter Notebook Read/Write MCP Server

Downloads

4

Readme

Notebook R/W MCP 服务器

一个用于读写 Jupyter notebook 文件的 MCP (Model Context Protocol) 服务器。

功能特性

  • 📖 读取 notebook: 完整读取 Jupyter notebook 文件内容
  • ✏️ 写入 notebook: 创建或覆盖 notebook 文件
  • 📋 获取 cells 信息: 查看 notebook 中所有 cells 的概览信息
  • 🔄 更新 cell: 修改指定位置的 cell 内容
  • 添加 cell: 在指定位置插入新的 cell
  • 🗑️ 删除 cell: 删除指定位置的 cell

安装依赖

pnpm install

构建

pnpm build

运行

# 开发模式
pnpm dev

# 生产模式
node dist/main.mjs

# 使用启动脚本
./start-mcp.sh

🚀 快速配置 Claude Desktop

运行一键配置脚本:

./install-claude-config.sh

这将自动:

  • 创建 Claude Desktop 配置文件
  • 备份现有配置(如果存在)
  • 设置正确的 MCP 服务器路径

配置完成后,重启 Claude Desktop 即可使用!

支持的工具

1. read_notebook

读取完整的 notebook 文件内容

参数:

  • file_path (string): notebook 文件路径

2. write_notebook

写入 notebook 文件

参数:

  • file_path (string): notebook 文件路径
  • content (object): notebook 内容(标准 Jupyter 格式)

3. get_notebook_cells

获取 notebook 中所有 cells 的信息概览

参数:

  • file_path (string): notebook 文件路径

4. update_notebook_cell

更新指定 cell 的内容

参数:

  • file_path (string): notebook 文件路径
  • cell_index (number): cell 索引(从 0 开始)
  • cell_content (object): 新的 cell 内容

5. add_notebook_cell

向 notebook 添加新的 cell

参数:

  • file_path (string): notebook 文件路径
  • cell (object): 要添加的 cell 内容
  • index (number, 可选): 插入位置,默认添加到末尾

6. delete_notebook_cell

删除指定的 cell

参数:

  • file_path (string): notebook 文件路径
  • cell_index (number): 要删除的 cell 索引(从 0 开始)

Cell 格式示例

Code Cell

{
  "cell_type": "code",
  "source": ["print('Hello, World!')", "x = 42"],
  "metadata": {},
  "execution_count": null,
  "outputs": []
}

Markdown Cell

{
  "cell_type": "markdown",
  "source": ["# 标题", "这是markdown内容"],
  "metadata": {}
}

Raw Cell

{
  "cell_type": "raw",
  "source": ["原始文本内容"],
  "metadata": {}
}

Notebook 格式示例

{
  "cells": [
    {
      "cell_type": "markdown",
      "source": ["# 我的Notebook"],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": ["print('Hello!')"],
      "metadata": {},
      "execution_count": null,
      "outputs": []
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}

使用注意事项

  1. 确保 notebook 文件路径正确且可访问
  2. 写入操作会覆盖现有文件,请谨慎使用
  3. cell 索引从 0 开始计算
  4. 建议在修改前先备份重要的 notebook 文件

错误处理

服务器会返回详细的错误信息,包括:

  • 文件不存在
  • 无效的 notebook 格式
  • 索引超出范围
  • 权限问题等

技术栈

  • TypeScript: 主要编程语言
  • @modelcontextprotocol/sdk: MCP 协议实现
  • Node.js: 运行时环境
  • tsup: 构建工具