m

mcp图片占位符生成器

@husniadil/mcp-image-placeholder
1 Stars 475 次浏览 husniadil 更新于 2026-08-23

该服务器从各个提供商生成占位符图像URL,支持输入验证以及与Claude和Cursor等桌面应用程序的集成。

该服务暂未提供标准配置,请参考 README 手动接入

可用工具 (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) 服务器,提供从不同提供商生成占位符图片的工具。

功能

  • 从支持的提供商生成占位符图片
  • 支持两种图片提供商:
  • 验证输入参数
  • 返回立即可用的图片 URL

要求

  • Python 3.9+
  • uv 包管理器

安装

  1. 克隆此仓库
  2. 为 MCP 服务器设置配置

使用

该服务器暴露一个工具:

image_placeholder

根据指定参数生成占位符图片 URL。

参数:

  • provider:要使用的图片提供商(placeholdlorem-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:

  1. 在您的 claude_desktop_config.json 中添加以下内容:
    {
        "mcpServers": {
            "image-placeholder": {
                "command": "uv",
                "args": [
                    "--directory",
                    "/ABSOLUTE/PATH/TO/PROJECT",
                    "run",
                    "main.py"
                ]
            }
        }
    }
    
  2. 重启 Claude for Desktop

要将此服务器连接到 Cursor:

  1. 打开 Cursor 设置
  2. 前往 Features 部分
  3. 向下滚动到 MCP Servers 部分
  4. 点击 Add new MCP server 按钮
  5. 输入以下信息:
    • 名称:image-placeholder
    • 类型:command
    • 服务器 URL:uv --directory /ABSOLUTE/PATH/TO/PROJECT run main.py
  6. 点击 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 Agent 截图

输出:
示例输出(Cursor)

许可证

MIT 许可证

相关 MCP 服务