Skip to main content

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

环境

  • Python 3.10+
  • uv
  • PicGo Core,并至少配置一个 uploader

安装 PicGo Core 并配置图床:

npm install --global picgo
picgo set uploader

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

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 发布文档。

Metadata

Release files for picgo-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for picgo-mcp 0.1.0
File Size Uploaded Provenance Actions
picgo_mcp-0.1.0.tar.gz 9.0 kB Without provenance Details for picgo_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for picgo-mcp 0.1.0
File Interpreter ABI Platform Actions
picgo_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for picgo_mcp-0.1.0-py3-none-any.whl

Total release size: 18.3 kB

Release files / picgo_mcp-0.1.0.tar.gz

Download URL picgo_mcp-0.1.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a06aa201c2746adcc82e8eae352140f23e9a13c09ecf1d9cf02372d3e3d4a040
BLAKE2b-256 checksum
How to use checksums
af8c8e769eff09be86ae211c8539c9e4eae67a0a822b564416c4d672b7afef1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / picgo_mcp-0.1.0-py3-none-any.whl

Download URL picgo_mcp-0.1.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a3e1a1f0bb30ed0fcb973b34af8c5a5d9de25206e6017fdf441ced223de7f97
BLAKE2b-256 checksum
How to use checksums
7b93e8a17faed35dfda2b7755e454134182824f5c6394be4cb1cbdd80a9da0fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for picgo-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page