agnes-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agnes-mcpgenerate an image of a cat wearing a hat"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agnes-mcp
An MCP (Model Context Protocol) server for the Agnes AI API by Sapiens AI.
It exposes all four documented core capabilities as MCP tools, integrates every Agnes model, and surfaces all configurable parameters — including the 1M-token context window and 4K video resolution.
Base URL:
https://apihub.agnes-ai.com/v1(OpenAI-compatible)Auth:
Authorization: Bearer <AGNES_API_KEY>
Core capabilities & tools
# | Capability | Tool(s) | Models |
1 | Text generation & reasoning |
|
|
2 | Image generation & editing |
|
|
3 | Video & audio-video generation (async) |
|
|
4 | Multimodal understanding |
|
|
– | Model discovery |
| all |
Highlights
1M context —
agnes_chat/agnes_visionacceptmax_tokensup to1,048,576;agnes-2.0-flashsupports a 1M-token context window.4K video —
agnes_video_createacceptswidth/heightup to3840(multiples of 64). The gateway auto-standardizes to the nearest supported level (480p/720p/1080p/4K).All parameters — temperature, top_p, max_tokens, stream, tools, tool_choice, Thinking mode (
chat_template_kwargs.enable_thinkingand Anthropic-stylethinking.budget_tokens), frequency/presence/repetition penalty, stop, seed, image input (URL/data-URI), response_format, return_base64, num_frames (8n+1, ≤441), frame_rate (1–60), negative_prompt, seed, and free-formextra_bodypassthrough.Resilience — automatic retry with exponential backoff for transient errors (429 capacity/cooldown, 5xx), as recommended by the Agnes error-code docs.
Streaming —
stream: trueis consumed server-side and returned as assembled text.
Related MCP server: agentforge
Setup
cd agnes-mcp
npm install
npm run buildConfigure your API key in .env (already created):
AGNES_API_KEY=sk-...Optional override:
AGNES_BASE_URL=https://apihub.agnes-ai.com/v1Run
npm start # node dist/index.js (stdio transport)
npm run dev # tsx src/index.tsIntegrate with an MCP client
Add to your client config (e.g. Claude Desktop / opencode):
{
"mcpServers": {
"agnes": {
"command": "node",
"args": ["/Users/yingjunchi/Downloads/agnes-mcp/dist/index.js"],
"env": { "AGNES_API_KEY": "sk-..." }
}
}
}Because Agnes AI is OpenAI-compatible, you can also use it directly as a model provider (Base URL https://apihub.agnes-ai.com/v1, model agnes-2.0-flash).
Tests
Every capability is verified against the live API (the key in .env must be valid):
npm test # all tests
npm run test:chat # chat: basic, multi-turn, streaming, tools, thinking, 1.5-flash
npm run test:vision # multimodal understanding
npm run test:image # text-to-image (url + base64), image-to-image, 2.0-flash
npm run test:video # create, query, wait-for-completion (slow)
npm run test:models # model listingThe video wait test polls until the task completes and asserts the final MP4 URL is returned.
API quirks handled
Image base64: the documented top-level
return_base64: truedoes not actually populateb64_json. This server normalizes it toextra_body.response_format = "b64_json", which is the working path for both text-to-image and image-to-image.Image-to-image: input images are placed in
extra_body.image(not top-level) per the 2.1 docs.Video query: uses the recommended
GET /agnesapi?video_id=(host root, not/v1) and falls back to the legacyGET /v1/videos/{task_id}.
Project layout
agnes-mcp/
├── src/
│ ├── client.ts # Agnes API client (4 capabilities, all params, retry)
│ ├── tools.ts # MCP tool definitions & handlers
│ └── index.ts # stdio MCP server entry
├── tests/ # live-API tests (models, chat, vision, image, video)
├── .env # AGNES_API_KEY (and optional overrides)
└── package.jsonMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/nontracey/agnes-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server