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 🙏

© 2026 – Pkg Stats / Ryan Hefner

python-plot-sandbox-mcp

v1.0.2

Published

Python sandbox MCP server for matplotlib visualization - execute Python code and generate charts

Readme

Python Plot MCP

一个专注于 Python 画图的 MCP (Model Context Protocol) 服务器,支持在云端执行 Python 代码并生成 matplotlib 图表。

功能特点

  • Python 沙箱执行:安全隔离的 Python 代码执行环境
  • Matplotlib 支持:内置 matplotlib 和中文字体
  • Base64 图像返回:生成的图表直接返回为 data URL
  • 完整 MCP 协议:符合 MCP 标准
  • 多种安装方式:支持 uvx、pip、npx

安装

方式一:uvx(推荐 - 魔搭平台)

uvx python-plot-mcp

方式二:pip

pip install python-plot-mcp
python-plot-mcp

方式三:npx(Node.js)

npx python-plot-sandbox-mcp

使用

魔搭平台配置

在魔搭 MCP 广场或支持 MCP 的客户端中配置:

{
  "mcpServers": {
    "python-plot": {
      "command": "uvx",
      "args": ["python-plot-mcp"]
    }
  }
}

本地开发配置

{
  "mcpServers": {
    "python-plot": {
      "command": "python",
      "args": ["-m", "python_plot_mcp"]
    }
  }
}

工具:run_python

执行 Python 代码并生成图表。

参数

  • code (string, 必需): Python 代码
  • timeout_s (integer, 可选): 超时时间(秒),默认 12
  • return_inline_image (boolean, 可选): 返回 base64 图片,默认 true

示例

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 10, 100)
y = np.sin(x)

plt.figure(figsize=(10, 6))
plt.plot(x, y)
plt.title('正弦波')
plt.xlabel('x')
plt.ylabel('sin(x)')
plt.grid(True)
plt.show()

依赖

  • Python 3.9+
  • matplotlib
  • numpy
  • Pillow

许可证

MIT

作者

Your Name