Local image bed MCP Server — exposes local images via HTTP for inline display in AI clients
Project description
MCP Image Server
本地图床 MCP Server,通过 HTTP 服务将本地图片暴露为可访问的 URL,用于在 Cherry Studio 等支持 Markdown 渲染的 AI 客户端中内联显示图片。
工作原理
- 以 MCP Server 形式运行,由 Cherry Studio 自动管理进程生命周期
- 启动后在本地开启 HTTP 图片服务(默认端口 18090)
- AI 通过系统提示词知道 URL 格式,直接输出 Markdown 图片链接
- 客户端渲染 Markdown 时自动从本地 HTTP 服务加载图片
AI 输出: 
↓
Cherry Studio 渲染 Markdown
↓
浏览器请求 localhost:18090 → HTTP 服务读取本地文件 → 返回图片
安装
推荐使用 uv tool install,无需克隆仓库,任意电脑一行命令搞定:
uv tool install git+https://gitee.com/xiaoye12345/image-server.git
或用 pip(需要先激活你想要的虚拟环境):
pip install git+https://gitee.com/xiaoye12345/image-server.git
安装完成后会自动注册 mcp-image-server 命令,MCP 配置中直接引用命令名即可,无需填写任何路径。
配置
Cherry Studio MCP 服务器
通过 JSON 导入:
{
"mcpServers": {
"image-server": {
"type": "stdio",
"command": "mcp-image-server"
}
}
}
系统提示词
在 Cherry Studio 的系统提示词中添加:
当需要显示本地图片时,直接用 Markdown 图片格式输出:

路径中的中文、空格等特殊字符必须 URL 编码。
`t` 参数为文件修改时间戳,用于避免缓存导致图片更新后显示旧版本。
示例:
升级
uv tool install --upgrade git+https://gitee.com/xiaoye12345/image-server.git
环境变量
| 变量 | 默认值 | 说明 |
|---|---|---|
IMAGE_SERVER_PORT |
18090 |
HTTP 服务监听端口 |
URL 格式
http://localhost:18090/image?path=<URL编码的文件路径>&t=<文件修改时间戳>
path:URL 编码的本地图片绝对路径t:伪参数,值为文件修改时间戳(秒),用于打破缓存。图片更新后时间戳改变,URL 不同,浏览器不会使用缓存。服务端忽略此参数。
支持的图片格式:.png .jpg .jpeg .gif .svg .webp .bmp
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_image_server-0.1.0.tar.gz.
File metadata
- Download URL: mcp_image_server-0.1.0.tar.gz
- Upload date:
- Size: 45.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2da461c712e893c02e6e13ce9a33c6d317f2584a075de2e2435fa714d080750
|
|
| MD5 |
72924796f9b27f3257eaf833029459ba
|
|
| BLAKE2b-256 |
a77bf2ec70bab3017754e1b5f2952e58f3176baa156663f7a9fdb6817f47a57f
|
File details
Details for the file mcp_image_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_image_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3427aaadbbba281320a547bae2e5123cad26b41dca7118fa5560120c1d276891
|
|
| MD5 |
37f19bfacf44a05c27e5357aaf93f379
|
|
| BLAKE2b-256 |
7352818712cae2036d5f8fd9c7c25e6cfc90d2b60eb4f122e50f37b8053d231b
|