Skip to main content
Glama

image-uploader

基于 PicGo Core 的图片上传 CLI 与 MCP server。PicGo 负责图床和上传;本项目负责命令行体验、链接格式和 MCP 工具。

flowchart LR
    CLI["picgo-link CLI"] --> Core["PicGo Core CLI"]
    MCP["picgo-mcp MCP server"] --> Core
    Core --> Host["PicGo 当前配置的图床"]
    CLI --> Links["URL / Markdown / HTML / BBCode"]
    MCP --> Links

环境

安装 PicGo Core 并配置图床:

npm install --global picgo
picgo set uploader

上传凭据保存在 PicGo 自己的本机配置中。本项目不读取或复制凭据;默认使用 PicGo 当前 uploader。若可执行文件不在 PATH,可设置 PICGO_COMMAND 或传入 --picgo-command。

Related MCP server: picgo-uploader

CLI

开发环境:

uv sync
uv run picgo-link .\figure.png
uv run picgo-link .\figure.png --format markdown --alt "结构示意"

默认输出直链、Markdown、HTML 和 BBCode。--format 支持 all、url、markdown(简写 md)、html、bbcode 和 json。

发布到 PyPI 后,可以直接运行:

uvx --from picgo-mcp picgo-link .\figure.png --format markdown

MCP

本机开发运行:

uv run picgo-mcp

MCP 使用 stdio transport,日志输出到 stderr。客户端配置示例(PyPI 发布后):

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

唯一工具 upload_image(file_path, alt_text?) 上传 MCP 主机可访问的本地文件,并返回 url、markdown、html、bbcode。文件路径必须对 MCP server 所在机器可见。

开发

uv sync
uv run picgo-link --help
uv build

自动发布

GitHub Actions 在推送 v* 标签后构建 wheel/sdist、发布到 PyPI,并创建 GitHub Release。先在仓库的 Settings → Secrets and variables → Actions 中添加名为 PYPI_API_TOKEN 的 Secret;发布 job 通过 UV_PUBLISH_TOKEN 使用它,不会把密钥写进代码或构建日志。

PyPI API token 需有权创建或发布 picgo-mcp。PyPI 支持账户级或项目级 token;项目创建后,建议将长期 token 限定到该项目。

首次从干净的 main 分支运行:

.\scripts\release.ps1 -Version 0.1.0

脚本构建发行包并推送首个标签;后续版本会更新版本和锁文件、提交,再推送分支与标签。GitHub Actions 自动发布 PyPI 并创建 GitHub Release。详见 uv 发布文档。

Available Tools

1 tool
upload_imageC

上传本地图片,并返回直链、Markdown、HTML 与 BBCode。

Inputs: file_path (required), alt_text. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 1 tool

    Disambiguation5/5

    With a single tool there is no possibility of selecting the wrong one; its purpose (upload a local image and return multiple link formats) is unambiguous.

    Naming Consistency4/5

    The lone name `upload_image` follows a clear snake_case verb_noun convention, which is easily extensible. There is no second name to confirm pattern consistency across the set.

    Tool Count3/5

    One tool is thin for an image-hosting integration; a single upload operation leaves little room for supporting operations. It is defensible as a minimal uploader but borderline per scope.

    Completeness3/5

    The core upload action is covered and returns several useful output formats, but there is no batch upload, URL-based upload, image history/list, or delete operation. Agents hitting those needs would be at a dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers