Agnes MCP Server
Enables AI assistants to generate images and videos via the Agnes AI API, supporting text-to-image, image-to-image, and video generation.
README
Agnes MCP Server
An MCP (Model Context Protocol) server that wraps the Agnes AI image and video generation APIs, enabling AI assistants (Claude, Cursor, VS Code, etc.) to generate images and videos via standardized tool calls.
Features
- Image Generation — Text-to-image and image-to-image via
generate_image - Video Generation — Text-to-video and image-to-video via
generate_video+get_video - Two Transport Modes —
stdio(local) andStreamable HTTP(remote) - Auto Download — Optionally save generated media to disk automatically
- Blocking & Async —
wait=truefor synchronous generation, or poll withget_video
Quick Start
1. Install Dependencies
cd agnes-mcp-server
npm install
npm run build
2. Set API Key
export AGNES_API_KEY="sk-agnes-your-api-key-here"
3. Run the Server
Stdio mode (default, for local MCP clients like Claude Desktop, Cursor):
npm run start
# or
node agnes-mcp-server.cjs
Streamable HTTP mode (for remote MCP clients):
MCP_TRANSPORT=http npm run start:http
# Default port: 3100 (configurable via HTTP_PORT)
4. Configure Your MCP Client
Add this to your MCP client configuration (e.g., .mcp.json):
{
"mcpServers": {
"agnes": {
"command": "node",
"args": ["agnes-mcp-server.cjs"],
"env": {
"AGNES_API_KEY": "sk-agnes-your-api-key-here"
}
}
}
}
Available Tools
| Tool | Description |
|---|---|
generate_image |
Generate or edit an image. Supports text-to-image and image-to-image modes. |
generate_video |
Submit a video generation task. Set wait=true to block until complete. |
get_video |
Query video generation status and optionally download the result. |
Tool Parameters
generate_image
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
string | Yes | — | Text description of the desired image |
size |
string | No | 1024x1024 |
Image dimensions (e.g., 512x512, 1024x1024) |
images |
string[] | No | — | Input images (local file paths or base64 data URIs) |
format |
"url" | "b64" |
No | url |
Output format when no outputDir is set |
outputDir |
string | No | — | Directory to download the image file |
generate_video
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
string | Yes | — | Text description of the desired video |
image |
string | string[] | No | — | Input image(s) for image-to-video mode |
mode |
string | No | — | Generation mode (e.g., "image-to-video") |
width |
number | No | — | Video width |
height |
number | No | — | Video height |
num_frames |
number | No | — | Number of frames |
frame_rate |
number | No | — | Frames per second |
seed |
number | No | — | Random seed for reproducibility |
negative_prompt |
string | No | — | Things to exclude from the video |
outputDir |
string | No | — | Directory to download the video file |
wait |
boolean | No | false |
Block until generation completes |
get_video
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
videoId |
string | Yes | — | Video ID returned by generate_video |
taskId |
string | No | — | Task ID (fallback for querying) |
outputDir |
string | No | — | Directory to download the video file |
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
AGNES_API_KEY |
Yes | — | Your Agnes API key (starts with sk-) |
MCP_TRANSPORT |
No | stdio |
Transport mode: stdio or http |
HTTP_PORT |
No | 3100 |
HTTP server port (only in http mode) |
DEFAULT_DOWNLOAD_DIR |
No | — | Root directory for auto-downloaded media |
Project Structure
agnes-mcp-server/
├── src/
│ ├── app/ # Server entry points (stdio, http, bundle)
│ ├── client/ # HTTP client wrapper
│ ├── core/ # Core MCP setup and registry
│ ├── module/
│ │ ├── image/ # Image generation service
│ │ └── video/ # Video generation service
│ ├── providers/ # API providers (AgnesClient, image, video)
│ ├── tools/ # MCP tool implementations
│ └── types/ # Shared types and result formatters
├── agnes-mcp-server.cjs # Bundled entry point
├── agnes-bundle.cjs # Standalone bundle
├── SKILL.md # MCP skill definition
├── TOKEN_AUTH.md # Authentication documentation
└── package.json
Development
# Watch mode (TypeScript → Node)
npm run dev
# Build TypeScript
npm run build
# Create standalone bundle
npm run bundle
# Run smoke test
npm run test
Test Script
A standalone test script is included for verifying the image-to-video API flow:
npx tsx test-video-image.ts <local-image-path> <api-key>
# or
IMAGE_PATH=test.jpg AGNES_API_KEY=sk-xxx npx tsx test-video-image.ts
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.