mcp图片占位符生成器
该服务器从各个提供商生成占位符图像URL,支持输入验证以及与Claude和Cursor等桌面应用程序的集成。
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
image_placeholder 3 个参数 需填 3 项
Generate a placeholder image based on a provider, width, and height. Use this tool to generate a placeholder image for testing or development purposes. Args: provider: The provider to use for the image, must be either `placehold` or `lorem-picsum`. width: The width of the image, must be a positive integer between 1 and 10000. height: The height of the image, must be a positive integer between 1 and 10000.
必填参数:provider、width、height
服务介绍
MCP 图片占位符服务器
这是一个 Model Context Protocol (MCP) 服务器,提供从不同提供商生成占位符图片的工具。
功能
- 从支持的提供商生成占位符图片
- 支持两种图片提供商:
placehold:提供简单的占位符图片lorem-picsum:提供真实图片作为占位符图片
- 验证输入参数
- 返回立即可用的图片 URL
要求
- Python 3.9+
uv包管理器
安装
- 克隆此仓库
- 为 MCP 服务器设置配置
使用
该服务器暴露一个工具:
image_placeholder
根据指定参数生成占位符图片 URL。
参数:
provider:要使用的图片提供商(placehold或lorem-picsum)width:图片宽度(1-10000)height:图片高度(1-10000)
返回:
- 生成图片的 URL 字符串
示例用法:
# Generate a 300x200 placeholder image
url = image_placeholder(provider="placehold", width=300, height=200)
# Generate a 500px square lorem-picsum image
url = image_placeholder(provider="lorem-picsum", width=500)
配置
要将此服务器连接到 Claude for Desktop:
- 在您的
claude_desktop_config.json中添加以下内容:{ "mcpServers": { "image-placeholder": { "command": "uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PROJECT", "run", "main.py" ] } } } - 重启 Claude for Desktop
要将此服务器连接到 Cursor:
- 打开 Cursor 设置
- 前往
Features部分 - 向下滚动到
MCP Servers部分 - 点击
Add new MCP server按钮 - 输入以下信息:
- 名称:
image-placeholder - 类型:
command - 服务器 URL:
uv --directory /ABSOLUTE/PATH/TO/PROJECT run main.py
- 名称:
- 点击
Add ↵按钮
故障排除
如果工具未被检测到,请使用 uv 命令的绝对路径,例如
/ABSOLUTE/PATH/TO/uv --directory /ABSOLUTE/PATH/TO/PROJECT run main.py
示例用法和输出(Cursor)
提示:
Create a new directory named "example" and a file named output.html.
Then create a single modern looking page using tailwindcss: https://unpkg.com/@tailwindcss/browser@4
Show a nice header, content, and footer, showing a photo gallery.
Save this into output.html

输出:
示例输出(Cursor)