Skip to main content
Glama

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 Modesstdio (local) and Streamable HTTP (remote)

  • Auto Download — Optionally save generated media to disk automatically

  • Blocking & Asyncwait=true for synchronous generation, or poll with get_video

Related MCP server: ImaginePro MCP Server

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

Available Tools

3 tools
generate_imageB

Generate or edit an image using the Agnes AI image generation API. Supports text-to-image and image-to-image modes.

ParametersJSON Schema
NameRequiredDescriptionDefault
sizeNo1024x1024
formatNourl
imagesNo
promptYes
outputDirNo

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It mentions two modes but does not explain prerequisites (e.g., requiring images parameter for editing), return format, or other side effects. This is insufficient for a tool with 5 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences and no redundancy. However, it sacrifices necessary detail in favor of brevity. It is well-structured but lacks depth.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 parameters, no output schema, and no annotations, the description is incomplete. It does not address return values, parameter roles, or typical use cases, making it inadequate for complex interactions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, and the description adds almost no meaning beyond stating modes. Parameters like size, format, images, and outputDir are not explained, leaving the agent with no guidance on how to use them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: generate or edit an image using a specific API. It mentions two modes (text-to-image and image-to-image), which distinguishes it from sibling tools that handle video.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for image generation/editing but does not explicitly guide when to use this tool versus siblings like generate_video or get_video. No exclusions or alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_videoA

Submit a video generation task. By default returns a videoId immediately for progress polling with get_video. Set wait=true to block until generation completes. Optionally provide outputDir to auto-download the video when completed.

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNo
seedNo
waitNo
imageNo
widthNo
heightNo
promptYes
outputDirNo
frame_rateNo
num_framesNo
negative_promptNo

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses the default async behavior (returns videoId), the blocking option, and auto-download. However, it omits potential side effects, authentication, rate limits, or failure handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences, each adding value. Front-loaded with the primary action, then options. No redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 11 parameters, no output schema, and no annotations, the description is incomplete. It covers key workflow but leaves many parameters unexplained, forcing the agent to guess or rely on external knowledge.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so description must compensate. It only explains wait and outputDir, leaving 9 parameters (prompt, mode, seed, image, width, height, frame_rate, num_frames, negative_prompt) undocumented. This is insufficient for an agent to use the tool effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool's purpose: submitting a video generation task. It distinguishes from siblings by mentioning videoId polling (related to get_video) and implies difference from generate_image.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on using wait=false (default) for polling vs wait=true for blocking, and mentions outputDir for auto-download. It does not explicitly exclude scenarios but offers clear context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_videoA

Get the current status of a video generation task and optionally download it. Accepts videoId (required) and taskId (optional). Returns progress percentage, status (queued/in_progress/completed/failed), and download URL when completed. Provide outputDir to auto-download the video file when generation is complete.

ParametersJSON Schema
NameRequiredDescriptionDefault
taskIdNo
videoIdYes
outputDirNo

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully covers behavior: it's a read operation returning status and download URL, with optional auto-download via outputDir. It does not mention side effects, but 'Get' implies non-destructive. The description adds context beyond minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences: first frames purpose, second lists parameters and returns, third notes optional auto-download. No redundant information; every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description covers inputs, outputs (progress, status, download URL), and optional behavior. It lacks mention of error cases, prerequisites (e.g., needing to have called generate_video first), or authentication needs, but is fairly complete for a simple status-checking tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% coverage (no parameter descriptions). The description explains videoId (required), taskId (optional for identifying task), and outputDir (for auto-download). This adds meaning beyond the raw schema, though formats and constraints are not detailed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves the status of a video generation task and optionally downloads it. The verb 'Get' and resource 'video generation task' are specific. Siblings 'generate_image' and 'generate_video' are distinct, so no confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use after initiating a generation task but does not explicitly state when to use this tool versus alternatives. No mention of prerequisites or when not to use it. The context of siblings suggests usage, but explicit guidance is missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.8/5.0
Disambiguation5/5

Each tool targets a distinct operation: image generation, video generation submission, and video status polling/download. No overlapping functionality, making selection unambiguous.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (generate_image, generate_video, get_video), with no deviations or mixed conventions.

Tool Count5/5

Three tools cover the essential workflows for image and video generation without unnecessary bloat, fitting well within the ideal 3-15 range.

Completeness4/5

Core generation and status retrieval are covered. Missing delete or list operations for generated content, but these are minor gaps given the server's likely purpose.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zssty2010/agnes-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server