返回市场
图像工具包MCP服务器

图像工具包MCP服务器

作者:Kira-Pgr15 星标更新:2025-03-20

项目介绍

PromptShopMCP

English | 中文

一款强大的MCP(模型上下文协议)服务器,使用简单的文本命令来转换图像。像专业设计师一样编辑照片——只需用自然语言描述你想要的内容!

示例

原始图像
<img src="https://gips2.baidu.com/it/u=3839744925,2622864650&fm=3081&app=3081&f=PNG?w=226&h=155" width="300"/>

提示:给狗穿上外套
<img src="https://gips3.baidu.com/it/u=3249809768,350903426&fm=3081&app=3081&f=PNG?w=1024&h=700" width="300"/>

提示:给它戴上帽子
<img src="https://gips1.baidu.com/it/u=1336763726,2884031874&fm=3081&app=3081&f=PNG?w=1024&h=698" width="300"/>

功能

  • 图像生成:使用Google的Gemini模型从文本提示创建图像
  • 图像修改:根据文本指令修改现有图像
  • 背景移除:使用remove.bg API从图像中移除背景
  • 图像托管:通过FreeImage.host分享生成的图像
  • 资源管理:跟踪和管理生成及上传的图像

要求

安装

  1. 克隆此仓库:

    git https://github.com/Kira-Pgr/Image-Toolkit-MCP-Server.git
    cd Image-Toolkit-MCP-Server
    
  2. 安装UV(如果尚未安装):

    # 在macOS和Linux上。
    curl -LsSf https://astral.sh/uv/install.sh | sh
    # 在Windows上。
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    # 使用pip。
    pip install uv
    
  3. 使用UV安装依赖项:

    uv venv --python=python3.11
    source .venv/bin/activate # 或在Windows上使用 .venv/Scripts/activate
    uv pip install -r requirements.txt
    

使用方法

  1. Claude Desktop集成:在你的claude_desktop_config.json文件中添加以下配置以直接从Claude Desktop运行服务器:

    "PromptShopMCP": {
      "command": "uv",
      "args": [
        "--directory",
        "/project/dir/",
        "run",
        "mcp",
        "run",
        "/project/dir/server.py"
      ],
      "env": {
        "GEMINI_API_KEY": "key",
        "FREEIMAGE_API_KEY": "key",
        "REMOVEBG_API_KEY": "key"
      }
    }
    

    注意:请将占位符"key"值替换为您的实际API密钥。

  2. Cursor集成Linux/macOS: 修改cursor.sh文件以设置您的API密钥和项目目录。

  • 在Cursor设置中,转到"MCP"标签页,点击添加新MCP服务器
  • 将服务器命名为您想要的名字,并将命令设置为sh /绝对路径/to/cursor.sh
  • 等待服务器启动,然后您可以查看服务器和可用工具。
  • 当您使用代理时,它会自动检测是否使用这些工具。 <img width="1240" alt="image" src="https://gips1.baidu.com/it/u=2414658631,3788088075&fm=3081&app=3081&f=PNG?w=2480&h=602" />

Windows: 修改cursor.bat文件以设置您的API密钥和项目目录。

  • 在Cursor设置中,转到"MCP"标签页,点击添加新MCP服务器
  • 将服务器命名为您想要的名字,并将命令设置为cmd /c C:\绝对路径\to\cursor.bat
  • 等待服务器启动,然后您可以查看服务器和可用工具。
  • 当您使用代理时,它会自动检测是否使用这些工具。

致谢