Skip to main content
Glama

agnes-image-mcp

Give any MCP client image generation and image understanding with one API key.

The point is not "another image MCP". The point is that a text-only model gains eyes and hands. Pair a cheap text model (DeepSeek, Qwen, a local model — anything without vision) with this server and it can suddenly read screenshots, describe photos, and draw.

Free tier available, no credit card.

Tools

Tool

What it does

generate_image

Text → image. Optional reference images. Returns the image into the conversation, and saves a png.

describe_image

Image(s) + a question → an answer. Screenshots, photos, charts, comparing two images.

set_api_key

Paste your key in chat and it's saved. Verified against the API first, so a typo fails immediately.

list_models

What's available on your key, and which model each tool picked.

Model IDs are resolved live on every call — when Agnes ships a newer generation, this server picks it up with no update needed.

Related MCP server: imagegen-mcp

Setup

Add the server to your client's MCP config. You do not need to put your key here — see step 3.

{
  "mcpServers": {
    "agnes-image": {
      "command": "uvx",
      "args": ["--from",
               "git+https://github.com/hskelp9527-pixel/agnes-image-mcp",
               "agnes-image-mcp"]
    }
  }
}

Do not clone this repo. uvx fetches and builds it into its own cache; there is no checkout for you to maintain. Copy the block above as-is.

Not on PyPI yet, so plain uvx agnes-image-mcp will fail — use the --from git+... form above. Once the package is published the short form starts working and this note goes away.

  1. Get a free key at https://agnes-ai.com, or https://platform.agnes-ai.cn if you are in mainland China.

  2. Restart your client.

  3. Say in chat: "my Agnes key is sk-..."

That's it. The agent calls set_api_key, which does the rest of the install for you: verifies the key, generates one small test image, reads it back to confirm vision works, saves the key, and reports:

Key verified against https://apihub.agnes-ai.com/v1 — 7 models reachable.
Image generation: OK (agnes-image-2.1-flash).
Image understanding: OK — it read back 'Red circle shape.'
Key saved to ~/.agnes-image-mcp-key.

Setup complete — image generation and image understanding are both live. Go try it!
已经接通了识图和生图能力,快来试试吧

A wrong key fails at step 3, not on your first real image. Nothing else to configure. If you'd rather not paste a key into a chat window, put "env": { "AGNES_API_KEY": "sk-..." } in the config block instead; the environment variable takes priority over the saved one.

Works in Claude Desktop, Claude Code, Cursor, Codex, Cline, WorkBuddy, or any MCP client. On Windows, if uvx isn't found, put "command": "cmd" and prepend "/c", "uvx" to the args — Windows has no uvx.exe for a process spawn to find.

No account, no telemetry, no proxy. The key is stored at ~/.agnes-image-mcp-key on your own machine and is sent only to Agnes.

Two endpoints, picked for you

Agnes runs a global service and a separate mainland-China one, and a key works on exactly one of them:

Sign-up site

API endpoint

agnes-ai.com

https://apihub.agnes-ai.com/v1

platform.agnes-ai.cn

https://api.agnes-ai.cn/v1

Nobody has to choose. set_api_key tries both, keeps whichever accepts the key, and saves it on line 2 of the key file — later calls go straight there with no extra request. Set AGNES_BASE_URL in the config's env block to force a specific endpoint (or a self-hosted proxy); it overrides everything.

The one thing worth reading

How many reference images you pass decides whether the model listens to you. This matters more than how you word the prompt. Measured, not guessed:

refs

keeps the character's look

obeys pose/composition

obeys art style

0

only what you describe in words

yes

yes, exactly

1

yes

yes

no — style follows the reference

3+

it's a photocopy

no

no — copies props and artifacts too

Style control and likeness control cannot both be had in one call. Pick one:

  • Want a specific art style → pass no references, describe the character in words.

  • Want the same character in a new pose → pass exactly one reference, and accept its style.

  • Want both → generate once with 0 refs to lock the style, then use that output as the single reference.

Hard cap is 6; more returns HTTP 400. The tool description says all of this too, so the model applies it without you repeating it every time.

Limits, stated plainly

  • No SLA. Agnes's free tier exists to collect usage data. Roughly 20 RPM, and the terms can change without notice. Don't build anything load-bearing on it.

  • Errors are not retried. If you hit a rate limit you get the error, not a silent backoff. That is deliberate — a hidden retry loop makes a rate limit look like slowness.

  • Generation takes 15–45s per image. Reference images push it toward the high end.

  • No video, on purpose. The Agnes key can reach agnes-video-v2.0 and a generate_video tool was written and worked on apihub.agnes-ai.com. It is not shipped because on api.agnes-ai.cn the job completes but the finished file cannot be fetched: /videos/{id}/content answers HTTP 200 with Content-Type: video/mp4 and a 22-byte {"detail":"Not Found"} body. The gateway blanks model_id in the video id it returns, so the download never resolves upstream. A capability that only works for half the users is worse than no capability. Reachable from git history if that endpoint gets fixed.

  • Not maintained. This is shared as-is under MIT. Issues and PRs may sit. Fork it — it is one file, ~300 lines, and you will not need help understanding it.

Development

pip install -e .
python -m agnes_image_mcp --selftest   # no key needed: checks JSON-RPC handshake + tool schemas

MIT.

Available Tools

4 tools
describe_imageA

Look at one or more images and answer a question about them.

Gives vision to a text-only model. Useful for: reading text in a screenshot, describing a photo, checking whether a generated image matches a brief, comparing two images, extracting data from a chart.

Args: images: local file paths or public https URLs. question: what to ask about them. Be specific — "what error is shown in this screenshot" beats "describe this".

Inputs: images (required), question. Returns: result

generate_imageA

Generate an image from a text prompt. Returns the image itself.

HOW MANY reference_images you pass decides whether the model obeys you. This matters more than prompt wording:

0 refs -> art style and composition instructions are followed exactly. The look of any character must be described in words. 1 ref -> keeps the referenced character's likeness AND follows pose instructions, BUT the art style will follow the reference, not your prompt. Use for expression sets / same character, new pose. 3+ refs -> the model starts copying instead of creating. Pose and style instructions stop working; it reproduces the reference, including its background props and artifacts. Avoid.

Style control and likeness control cannot both be had in one call. Decide which one this image needs. To get both: generate once with 0 refs to fix the style, then use that output as the single ref for follow-ups.

Hard limit: 6 reference images, more returns HTTP 400.

Args: prompt: what to draw. Put the full art-style description here. reference_images: local file paths or public https URLs. Read the rule above. size: e.g. "1024x1024", or a tier like "1K" / "2K". ratio: e.g. "1:1", "16:9". save_path: where to write the png. Defaults to a temp file; the path is always reported so the user can find the file.

Inputs: prompt (required), size, ratio, save_path, +1 more.

list_modelsA

List the models available on this API key, and which ones this server picks by default for generation and for vision.

Inputs: no named parameters. Returns: result

set_api_keyA

Set up this server with the user's API key. This is the whole install: save the key, then prove both capabilities actually work end to end.

Call this as soon as the user provides a key. Report the returned message back to them verbatim — it is the completion notice.

The key is verified before being written, so a typo fails here rather than on the first real request. It is stored in plain text at ~/.agnes-image-mcp-key on this machine only, and is sent only to Agnes. AGNES_API_KEY in the environment still wins if set.

Args: key: the Agnes API key, starting with "sk-". Free at https://agnes-ai.com. run_check: generate one small image and read it back to confirm both paths work. Takes 20-60s. Only skip it if the user is in a hurry.

Inputs: key (required), run_check. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.7/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: list_models shows available models, set_api_key configures the API key, generate_image creates images, and describe_image interprets images. There is no functional overlap between any pair.

    Naming Consistency5/5

    All tool names follow the same verb_noun pattern in snake_case: list_models, set_api_key, generate_image, describe_image. The naming is perfectly consistent and predictable.

    Tool Count5/5

    Four tools is a well-scoped count for an image generation and vision server. Each tool covers a necessary step in the workflow from setup to generation to analysis, with no redundant or missing components.

    Completeness5/5

    The tool set covers the full lifecycle of the server's purpose: configuration (set_api_key), discovery (list_models), creation (generate_image), and understanding (describe_image). There are no obvious gaps for the intended use case.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers