MCP TemplateIO - 图像生成工具
使用 mcp-framework 构建的模型上下文协议 (MCP) 服务器,它使用 Templated.io 提供图像生成工具。
概述
此模板提供了使用自定义工具构建 MCP 服务器的起点。它包含一个示例工具,并提供有关如何添加、开发更多工具以及将其发布到 npm 的说明。此 README 将指导您完成设置、开发和部署您自己的 MCP 服务器的过程。
快速入门
项目结构
可用工具
模板图像生成器
该工具使用 Templated.io API,根据模板、给定的文本和图像 URL 生成图像。
输入参数:
templateId
:要使用的 Templated.io 模板的 IDphotoBgImageUrl
:放置在“photo-bg”层的图像的 URL。bgYellowImageUrl
:放置在“bg-yellow”层的图像的 URL。buildText
:“构建”文本层的文本内容。
工具开发
示例工具结构:
添加组件
该项目附带了src/tools/ExampleTool.ts
和TemplatedImageTool.ts
中的示例工具。您可以使用 CLI 添加更多工具:
发布到 npm
更新你的 package.json:
确保
name
唯一并遵循 npm 命名约定设置适当的
version
添加
description
、author
、license
等。检查
bin
指向正确的入口文件
本地构建和测试:
npm run build npm link mcp-templateio # Test your CLI locally登录 npm(如有必要,请创建帐户):
npm login发布你的包:
npm publish
发布后,用户可以将其添加到他们的 claude 桌面客户端(见下文)或使用 npx 运行它
与 Claude Desktop 一起使用
本地开发
将此配置添加到您的 Claude Desktop 配置文件:
MacOS : ~/Library/Application Support/Claude/claude_desktop_config.json
Windows : %APPDATA%/Claude/claude_desktop_config.json
发布后
在此处获取您的 API 密钥: https://app.templated.io/api-integration?template=4ae9a86b- 4ecd-44ee-aebd-7c5a49c16969
将此配置添加到您的 Claude Desktop 配置文件:
MacOS : ~/Library/Application Support/Claude/claude_desktop_config.json
Windows : %APPDATA%/Claude/claude_desktop_config.json
构建和测试
更改你的工具
运行
npm run build
进行编译服务器将在启动时自动加载您的工具
了解更多
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
模型上下文协议服务器使用 Templated.io 提供图像生成工具,允许用户基于带有文本和图像层的模板创建自定义图像。
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that provides image generation capabilities using the Ideogram API, allowing users to create images from text prompts with customizable parameters.Last updated -15
- AsecurityAlicenseAqualityA Model Context Protocol server that provides image generation capabilities using Google's Gemini 2 API, allowing users to generate multiple images with customizable parameters like prompts, aspect ratios, and person generation settings.Last updated -1174MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables generating and editing images using OpenAI's gpt-image-1 model, allowing AI assistants to create and modify images from text prompts.Last updated -24516MIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to generate images using Leonardo AI, supporting both HTTP and stdio communication modes.Last updated -1