agnes-mcp
MCP server that exposes Agnes AI's text, image, video, and multimodal capabilities as tools with up to 1M context and 4K video.
README
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 | agnes_chat |
agnes-2.0-flash, agnes-1.5-flash |
| 2 | Image generation & editing | agnes_image |
agnes-image-2.1-flash, agnes-image-2.0-flash |
| 3 | Video & audio-video generation (async) | agnes_video_create, agnes_video_query, agnes_video_wait |
agnes-video-v2.0 |
| 4 | Multimodal understanding | agnes_vision (+ image input in agnes_chat) |
agnes-2.0-flash, agnes-1.5-flash |
| – | Model discovery | agnes_models |
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.
Setup
cd agnes-mcp
npm install
npm run build
Configure your API key in .env (already created):
AGNES_API_KEY=sk-...
Optional override:
AGNES_BASE_URL=https://apihub.agnes-ai.com/v1
Run
npm start # node dist/index.js (stdio transport)
npm run dev # tsx src/index.ts
Integrate 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 listing
The 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.json
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。