Model Context Protocol — Connect AI agents directly to InfinixUI
The Model Context Protocol (MCP) is an open standard for connecting AI agents to external tools. Instead of your agent figuring out complex API calls via prompt engineering, MCP provides a structured interface where the agent knows exactly what tools are available and how to call them.
No need for elaborate system prompts explaining the API. The agent discovers tools automatically.
Add InfinixUI to any MCP-compatible client: Claude, Cursor, Windsurf, or your own agent.
All tool inputs are validated with Zod schemas. The agent always sends correct data.
The InfinixUI MCP server is included in the package. Build it once, then point your MCP client to the compiled server.
1. Clone & Install
git clone https://github.com/guewol/infinixui.git
cd infinixui
npm install2. Build the MCP server
npm run mcp:build3. Test it locally
# Start InfinixUI first
npm run dev -- -p 3002
# In another terminal, test the MCP server
INFINIXUI_URL=http://localhost:3002 INFINIXUI_API_KEY=mcp_live_... npm run mcp:startThe MCP server uses two environment variables:
| Variable | Default | Description |
|---|---|---|
| INFINIXUI_URL | http://localhost:3002 | Base URL of your InfinixUI instance |
| INFINIXUI_API_KEY | (none) | MCP access token (mcp_live_...) |
Generate an MCP token via POST /api/keys with "keyType": "mcp". See API docs.
Add InfinixUI to your claude_desktop_config.json:
{
"mcpServers": {
"infinixui": {
"command": "node",
"args": ["C:/path/to/infinixui/mcp/dist/index.js"],
"env": {
"INFINIXUI_URL": "https://infinixui.dev",
"INFINIXUI_API_KEY": "mcp_live_your_key_here"
}
}
}
}Restart Claude Desktop after editing the config. The tools will appear in Claude's tool list.
Add to your .cursor/mcp.json or .windsurf/mcp.json:
{
"mcpServers": {
"infinixui": {
"command": "node",
"args": ["./mcp/dist/index.js"],
"env": {
"INFINIXUI_URL": "http://localhost:3002",
"INFINIXUI_API_KEY": "mcp_live_your_key_here"
}
}
}
}Connect programmatically from your own agent using the MCP SDK:
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
const transport = new StdioClientTransport({
command: 'node',
args: ['./mcp/dist/index.js'],
env: {
INFINIXUI_URL: 'http://localhost:3002',
INFINIXUI_API_KEY: 'mcp_live_...',
},
});
const client = new Client({ name: 'my-agent', version: '1.0.0' });
await client.connect(transport);
// List available tools
const tools = await client.listTools();
console.log(tools);
// Generate an ebook
const result = await client.callTool('generate_ebook', {
title: 'My AI Guide',
theme: 'github',
chapters: [
{
title: 'Chapter 1',
sections: [{ title: 'Intro', content: ['Hello world...'] }],
},
],
});
console.log(result);List all available templates, themes, formats, and designs. Call this first to discover options before generating.
Parameters
NoneExample
// Agent calls list_config with no arguments
// Returns all templates, themes, formats, designs for both carousel and ebook modesGenerate social media carousel slides from structured data. Returns a studio URL and export URLs.
Parameters
{
template: string // e.g. "carousel-pro"
format?: string // e.g. "linkedin-carousel" (default)
design?: string // e.g. "modern"
title: string // Main title
subtitle?: string
author?: string
slides: [ // Array of slides
{ title: string, content: string, stat?: string }
]
cta_text?: string // Call-to-action text
cta_url?: string // Call-to-action URL
}Example
{
"template": "carousel-pro",
"title": "5 Tips for Better UX",
"slides": [
{ "title": "Tip 1", "content": "Keep it simple and clear" },
{ "title": "Tip 2", "content": "Use consistent whitespace" }
]
}Generate a full ebook layout with cover, chapters, and back cover. Returns a studio URL for editing and PDF export.
Parameters
{
template?: string // e.g. "guide-pratique" (default)
theme?: string // e.g. "stripe", "github", "midnight"
title: string // Book title
subtitle?: string
author?: string
chapters: [ // Array of chapters
{
title: string,
hook?: string,
sections: [{ title: string, content: string[] }],
summary?: string[],
tip?: string
}
]
introduction?: { body: string }
conclusion?: { body: string, summary?: string }
}Example
{
"template": "guide-pratique",
"theme": "stripe",
"title": "The Complete Guide to AI",
"chapters": [
{
"title": "What is AI?",
"sections": [
{ "title": "Definition", "content": ["AI is..."] }
]
}
]
}Export a previously generated carousel as a PDF file.
Parameters
{ sessionId: string } // ID from generate_carouselExample
{ "sessionId": "carousel_1709312345_a1b2c3" }List all generated files (carousels and ebooks) stored in InfinixUI.
Parameters
NoneExample
// Returns array of all generated records with id, mode, title, createdAtHere's how an AI agent typically interacts with InfinixUI via MCP:
Agent calls list_config to discover available templates & themes
Agent calls generate_ebook or generate_carousel with structured content
Tool returns studioUrl for the user to preview/edit, or pdfUrl for direct download
Agent calls export_carousel_pdf to get a downloadable PDF