Skip to main content

MCP 图床上传服务器

这是一个基于MCP(Model Context Protocol)的图床上传服务器,支持将本地图片上传到图床并返回完整的图片链接。

功能特性

  • 🖼️ 支持多种图片格式:PNG, JPG, JPEG, GIF, BMP, WEBP
  • 🔗 自动生成完整的图片链接
  • 🛡️ 文件存在性和格式验证
  • 📝 详细的错误信息反馈
  • 🔧 可配置的认证码

安装

# 克隆项目
git clone <repository-url>
cd mcp-image-upload

# 安装依赖
uv sync

使用方法

启动MCP服务器

python -m mcp_image_upload

可用工具

1. upload_image

上传本地图片到图床

参数:

  • file_path (str): 本地图片文件路径
  • auth_code (str, 可选): 认证码,默认为"luoshui"

返回: 完整的图片链接URL

示例:

# 上传图片
result = upload_image("/path/to/your/image.png")
# 返回: https://imgbed.deepseeking.app/file/1749965438804_image.png

2. get_supported_formats

获取支持的图片格式列表

返回: 支持的图片格式字符串

错误处理

服务器会处理以下错误情况:

  • 文件不存在
  • 不支持的文件格式
  • 网络请求失败
  • 上传服务器错误
  • 其他异常情况

技术栈

  • Python 3.13+
  • MCP (Model Context Protocol)
  • requests
  • FastMCP

开发

# 安装开发依赖
uv sync --dev

# 运行服务器
python -m mcp_image_upload

Metadata

Release files for mcp-image-upload 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 mcp-image-upload 0.1.0
File Size Uploaded Provenance
mcp_image_upload-0.1.0.tar.gz 13.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-image-upload 0.1.0
File Interpreter ABI Platform
mcp_image_upload-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / mcp_image_upload-0.1.0.tar.gz

Download URL mcp_image_upload-0.1.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
30bdf160ab9e145f0f3a3dfa941ff88bddc9581592b601ea47bbcc18d8c43933
BLAKE2b-256 checksum
How to use checksums
3892d299a6ec9859af92e59accac8314b57197ac01fae0922c57209110d50703
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

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

Download URL mcp_image_upload-0.1.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95b3d1ad2f7479db35cdc060e3b55e07d3e9606129c2744d0c367954b98f26fd
BLAKE2b-256 checksum
How to use checksums
f6faf2f0aedf8aceacf73dca708769bc8a4d88d5aa516fc07bd6b636add20eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Security for mcp-image-upload 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