Generate images using the Templated.io API. Requires a Templated.io API key.
A Model Context Protocol (MCP) server built with mcp-framework that provides an image generation tool using Templated.io.
This template provides a starting point for building MCP servers with custom tools. It includes an example tool and instructions on how to add more tools, develop them, and publish them to npm. This README will guide you through the process of setting up, developing, and deploying your own MCP server.
# Install dependencies
npm install
# Build the project
npm run build
mcp-templateio/
├── src/
│ ├── tools/ # MCP Tools
│ │ ├── ExampleTool.ts
│ │ └── TemplatedImageTool.ts # Image generation tool
│ └── index.ts # Server entry point
├── package.json
└── tsconfig.json
This tool generates an image based on a template, given text and image URLs, using the Templated.io API.
Input Parameters:
templateId
: ID of the Templated.io template to usephotoBgImageUrl
: URL for the image to place in the "photo-bg" layer.bgYellowImageUrl
: URL for the image to place in the "bg-yellow" layer.buildText
: Text content for the "build" text layer.Example tool structure:
import { MCPTool } from "mcp-framework";
import { z } from "zod";
interface MyToolInput {
message: string;
}
class MyTool extends MCPTool<MyToolInput> {
name = "my_tool";
description = "Describes what your tool does";
schema = {
message: {
type: z.string(),
description: "Description of this input parameter",
},
};
async execute(input: MyToolInput) {
// Your tool logic here
return `Processed: ${input.message}`;
}
}
export default MyTool;
The project comes with an example tool in src/tools/ExampleTool.ts
and the TemplatedImageTool.ts
. You can add more tools using the CLI:
# Add a new tool
mcp add tool my-tool
# Example tools you might create:
mcp add tool data-processor
mcp add tool api-client
mcp add tool file-handler
Update your package.json:
name
is unique and follows npm naming conventionsversion
description
, author
, license
, etc.bin
points to the correct entry fileBuild and test locally:
npm run build
npm link
mcp-templateio # Test your CLI locally
Login to npm (create account if necessary):
npm login
Publish your package:
npm publish
After publishing, users can add it to their claude desktop client (read below) or run it with npx
Add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-templateio": {
"command": "node",
"args": ["/absolute/path/to/mcp-templateio/dist/index.js"]
}
}
}
GET YOUR API KEY HERE: https://app.templated.io/api-integration?template=4ae9a86b-4ecd-44ee-aebd-7c5a49c16969
Add this configuration to your Claude Desktop config file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-templateio": {
"command": "node",
"args": [
"C:\\Users\\alex0\\Documents\\AA_CodeAndScripts\\modelcontextprotocol\\mcp-templateio\\dist\\index.js"
],
"env": {"TEMPLATED_API_KEY":"YOUR-API-KEY-HERE"}
},
}
}
npm run build
to compileInteract with various build systems including Gradle, Maven, NPM/Yarn, Cargo, Python, Makefile, and CMake.
A gateway server that intelligently routes MCP requests to multiple backend servers based on external configuration.
A unified framework for integrating various language models and embedding providers to generate text completions and embeddings.
Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning with Cycode.
A self-hostable middleware to manage all your MCPs through a GUI and a local proxy, supporting multiple clients and workspaces.
Interact with Alchemy's blockchain APIs to query data without writing code.
Check software end-of-life (EOL) dates and support status using the endoflife.date API to provide accurate lifecycle and security information.
An example of a remote MCP server for Odoo, deployable on Cloudflare Workers without authentication.
A NestJS module for building MCP servers to expose tools and resources for AI, with support for multiple transport types.
Navigate your OpenTelemetry resources, investigate incidents and query metrics, logs and traces on Dash0.