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

@juguli/mcp

v0.1.3

Published

A package containing files for the MCP project.

Readme

@juguli/mcp - AI 图片生成工具

一个基于 ModelScope API 的 AI 图片生成工具,可以通过 npx 快速使用,特别适合在 Cursor IDE 中集成使用。

功能特点

  • 🚀 即开即用: 通过 npx 命令一键运行,无需复杂配置
  • 🎨 AI 图片生成: 基于 ModelScope 的 MAILAND/majicflus_v1 模型
  • 📱 手机壳产品图: 专门优化用于生成手机壳产品展示图片
  • 🔧 Cursor 集成: 完美集成到 Cursor IDE 工作流中
  • 🌐 跨平台: 支持 Windows、macOS 和 Linux

快速开始

1. 直接使用

npx @juguli/mcp

2. 环境要求

在使用之前,请确保您的系统满足以下要求:

安装 Python 3

  • Python 官网 下载并安装 Python 3
  • 安装时请勾选 "Add Python to PATH" 选项

安装 Python 依赖

pip install requests pillow

在 Cursor IDE 中使用

方法一:通过终端集成

  1. 在 Cursor 中打开集成终端 (Ctrl+`` 或 Cmd+``)
  2. 运行命令:
    npx @juguli/mcp
  3. 生成的图片将保存在当前工作目录中

方法二:创建自定义任务

在您的项目根目录创建 .vscode/tasks.json 文件:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "生成产品图片",
            "type": "shell",
            "command": "npx",
            "args": ["@juguli/mcp"],
            "group": "build",
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared"
            },
            "problemMatcher": []
        }
    ]
}

然后通过 Ctrl+Shift+P (或 Cmd+Shift+P) 打开命令面板,搜索 "Tasks: Run Task",选择 "生成产品图片"。

方法三:配置为 MCP 服务器

如果您在 Cursor 中使用 Claude 等 AI 助手,可以将此工具配置为 MCP 服务器:

  1. 在 Cursor 设置中添加 MCP 服务器配置
  2. 服务器命令:npx @juguli/mcp
  3. 这样 AI 助手就可以直接调用图片生成功能

方法四:快捷键绑定

在 Cursor 的 keybindings.json 中添加:

{
    "key": "ctrl+shift+g",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
        "text": "npx @juguli/mcp\n"
    }
}

现在您可以通过 Ctrl+Shift+G 快速生成图片。

工作原理

  1. 命令执行: 运行 npx @juguli/mcp 时,会下载并执行 cli.js
  2. Python 调用: cli.js 会自动调用 generate_image.py 脚本
  3. API 请求: Python 脚本向 ModelScope API 发送图片生成请求
  4. 图片下载: 下载生成的图片并保存为 product_2.jpg

自定义配置

修改生成提示词

如果您想修改生成的图片内容,可以:

  1. 复制这个包到本地项目
  2. 修改 generate_image.py 中的 prompt 字段
  3. 本地运行 python generate_image.py

API 密钥

当前使用的是演示 API 密钥。在生产环境中,建议:

  1. 注册 ModelScope 账号
  2. 获取您自己的 API 密钥
  3. 替换 generate_image.py 中的 Authorization 头部

故障排除

Python 未找到

错误: 'python' 不是内部或外部命令

解决方案: 确保 Python 已安装并添加到系统 PATH 中

依赖库缺失

ModuleNotFoundError: No module named 'requests'

解决方案: 运行 pip install requests pillow

网络连接问题

SSL 错误或连接超时

解决方案: 检查网络连接,确保可以访问 ModelScope API

许可证

MIT License - 详见 LICENSE 文件

贡献

欢迎提交 Issue 和 Pull Request!

更新日志

v0.1.2

  • 初始发布
  • 支持基本的图片生成功能
  • 集成 Cursor IDE 使用说明

需要帮助? 请在 GitHub Issues 中提出问题。