hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Enables publishing the MCP server as an npm package, allowing users to easily install and use the tool.
Utilizes TypeScript for developing MCP tools, providing type safety and better developer experience.
Uses Zod for schema validation of tool inputs, ensuring proper data validation for the image generation tools.
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
指向正确的入口文件
- 确保
- 本地构建和测试:Copy
- 登录 npm(如有必要,请创建帐户):Copy
- 发布你的包:Copy
发布后,用户可以将其添加到他们的 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
进行编译 - 服务器将在启动时自动加载您的工具
了解更多
You must be authenticated.
模型上下文协议服务器使用 Templated.io 提供图像生成工具,允许用户基于带有文本和图像层的模板创建自定义图像。
- Overview
- Quick Start
- Project Structure
- Available Tools
- Tool Development
- Adding Components
- Publishing to npm
- Using with Claude Desktop
- Building and Testing
- Learn More