图片上传服务

一个用于从Claude兼容客户端上传图片到ImgBB的MCP服务器。

  • by flin-agency
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 flin-agency/flin-imgbb-mcp

使用说明

弗林imgbb mcp

用于上传图像的MCP服务器 ImgBB 来自克劳德兼容的客户。

快速开始

建议的设置使用 uvx --不需要存储库克隆或虚拟环境。

将此添加到您的Claude MCP配置中:

{
  "mcpServers": {
    "imgbb": {
      "command": "uvx",
      "args": ["flin-imgbb-mcp@latest"],
      "env": {
        "IMGBB_API_KEY": "your-imgbb-api-key"
      }
    }
  }
}

获取API密钥: api.imgbb.com.

工具

upload_image

将单个图像文件上传到ImgBB并获取其公共URL。

参数 类型 必填 说明
file_path string yes 图像文件的绝对或相对路径
name string no ImgBB上图像的可选名称
expiration number no 过期时间(秒)(60–15552000)

退货: url, display_url, delete_url, title

list_images

列出本地文件夹中的所有图像文件(png、jpg、jpeg、gif、webp、bmp)。

参数 类型 必填 说明
folder_path string yes 文件夹的绝对路径

upload_all_images

将本地文件夹中的所有图像上传到ImgBB。

参数 类型 必填 说明
folder_path string yes 文件夹的绝对路径
expiration number no 所有图像的过期时间(60–15552000秒)

配置

环境变量 必填 说明
IMGBB_API_KEY 是 您的ImgBB API密钥

故障排除

服务器未启动/“未设置IMGBB_API_KEY” 确保 IMGBB_API_KEY 设置在 env MCP配置的块。服务器在启动时检查它,如果它丢失,将退出并显示一个明确的错误。

上传失败,使用HTTP 400 文件路径必须指向有效的图像文件。支持的格式:png、jpg、jpeg、gif、webp、bmp。

uvx 命令未找到 安装 uv 从 docs.astral.sh/uv.

发展

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync --group dev

# Run tests
uv run pytest tests/ -v

# Lint
uv run ruff check src/ tests/

# Build distribution artifacts
uv build

发布

当按下版本标签时,发布会自动发布到PyPI:

git tag v1.0.2
git push origin v1.0.2

GitHub Actions发布工作流构建包并通过PyPI Trusted Publishing发布。

许可证

麻省理工学院