API易 MCP Server
Enables Google search to retrieve current information from the web.
Click on "Deploy 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., "@API易 MCP ServerAnalyze this video: describe the main scene"
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.
API易 MCP Server
基于 aistudio-mcp-server 改造,支持 API易 的 Gemini 原生格式调用。
Docker Hub: zuozuoliang999/apiyi-mcp-server
✨ 特性
🎬 视频理解:支持 MP4, AVI, MOV, WebM, FLV, MPG, WMV (最大 20MB)
🎙️ 音频处理:支持 MP3, WAV, AIFF, AAC, OGG, FLAC
🖼️ 图片分析:支持 JPG, PNG, GIF, WebP, SVG, BMP, TIFF
📄 文档转换:PDF 转 Markdown,支持 TXT, MD, JSON, XML, CSV, HTML
🔍 Google 搜索:内置 Google 搜索能力
💻 代码执行:支持 Python 代码执行
🧠 思维链推理:支持 Gemini 2.5 系列的 thinking_budget
💰 分辨率优化:支持媒体分辨率调整,节省 tokens 费用
🐳 Docker 支持:完整的 Docker 容器化部署
Related MCP server: AI Vision MCP Server
🚀 快速开始
1. 获取 API易 密钥
访问 API易控制台 注册账号
充值后获取 API Key
2. 配置 MCP 客户端
Cursor / Claude Desktop 配置
{
"mcpServers": {
"apiyi": {
"command": "node",
"args": ["D:/jianji_FFMPEG/apiyi-mcp-server/dist/index.js"],
"env": {
"APIYI_API_KEY": "你的API易密钥",
"GEMINI_MODEL": "gemini-3.1-pro-preview-thinking",
"APIYI_BASE_URL": "https://api.apiyi.com"
}
}
}
}使用 npx 方式(需要先发布到 npm)
{
"mcpServers": {
"apiyi": {
"command": "npx",
"args": ["-y", "apiyi-mcp-server"],
"env": {
"APIYI_API_KEY": "你的API易密钥"
}
}
}
}3. 🐳 Docker 部署 (推荐)
无需安装 Node.js,直接从 Docker Hub 拉取镜像!
# 直接使用 Docker Hub 镜像
docker pull zuozuoliang999/apiyi-mcp-server:latest
# 运行容器
docker run -it --rm \
-e APIYI_API_KEY=你的API易密钥 \
-v /path/to/your/media:/app/media:ro \
zuozuoliang999/apiyi-mcp-server:latest使用 docker-compose
# 克隆项目
git clone https://github.com/2799662352/apiyi-mcp-server.git
cd apiyi-mcp-server
# 创建环境变量文件
echo "APIYI_API_KEY=你的API易密钥" > .env
# 启动服务
docker-compose up -d
# 查看日志
docker logs -f apiyi-mcp-serverCursor MCP 配置 (Docker 方式)
{
"mcpServers": {
"apiyi": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "APIYI_API_KEY=你的API易密钥",
"-v", "/path/to/your/media:/app/media:ro",
"zuozuoliang999/apiyi-mcp-server:latest"
]
}
}
}Windows + Cursor 完整实战配置(含长输出 / 长超时 / Gemini 3.1 思维链)
下面这份是经过实测可用的 Windows 配置:把整个 D:\ 盘以只读方式挂进容器内的 /app/media,这样 Cursor 里给 files.path 传 D:/video/foo.mp4 也能直接被容器读到;同时通过 -e 单独声明环境变量(key 从 env 字段注入,避免在 args 里出现明文密钥)。
{
"mcpServers": {
"apiyi": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "APIYI_API_KEY",
"-e", "GEMINI_MODEL",
"-e", "APIYI_BASE_URL",
"-e", "GEMINI_MAX_OUTPUT_TOKENS",
"-e", "GEMINI_TIMEOUT",
"-v", "D:/:/app/media:ro",
"zuozuoliang999/apiyi-mcp-server:latest"
],
"env": {
"APIYI_API_KEY": "sk-YOUR_API_KEY_HERE",
"GEMINI_MODEL": "gemini-3.1-pro-preview-thinking",
"APIYI_BASE_URL": "https://api.apiyi.com",
"GEMINI_MAX_OUTPUT_TOKENS": "65536",
"GEMINI_TIMEOUT": "1800000"
}
}
}
}要点说明:
-v D:/:/app/media:ro:把整个D:盘只读挂载到容器,Cursor 中无论传D:/...还是D:\...路径都能命中容器内/app/media/...。用
-e KEY+env.KEY的分离写法,可避免把密钥明文写在args中(args 在某些日志里会被打印)。GEMINI_MAX_OUTPUT_TOKENS=65536:跑长视频/长文档分析时建议放开,默认 8192 容易被截断。GEMINI_TIMEOUT=1800000(30 分钟):搭配 thinking 模型/大文件多模态分析时避免提前超时。GEMINI_MODEL=gemini-3.1-pro-preview-thinking:开启 Gemini 3.1 思维链模型;如想节省成本可改回gemini-2.5-flash。
4. 本地开发 (需要 Node.js)
# 进入项目目录
cd D:\jianji_FFMPEG\apiyi-mcp-server
# 安装依赖
npm install
# 编译
npm run build
# 启动
npm start⚙️ 环境变量配置
变量名 | 描述 | 默认值 |
| API易 密钥 (必需) | - |
| 备用:Google AI Studio 密钥 | - |
| API易 端点 |
|
| 备用:自定义端点 | - |
| 默认模型 |
|
| 超时时间 (ms) |
|
| 最大输出 tokens |
|
| 最大文件数 |
|
| 最大总文件大小 (MB) |
|
| 温度参数 |
|
| 媒体分辨率 (LOW/MEDIUM/HIGH) |
|
📖 使用示例
视频理解
{
"user_prompt": "分析这个视频的内容,描述主要场景和人物动作",
"files": [
{
"path": "D:/jianji_FFMPEG/误解向剪辑.mp4"
}
]
}图片分析
{
"user_prompt": "描述这张图片中的内容",
"files": [
{
"path": "/path/to/image.jpg"
}
]
}PDF 转 Markdown
{
"user_prompt": "将这个 PDF 转换为格式良好的 Markdown,保留结构和格式",
"files": [
{"path": "/document.pdf"}
]
}Google 搜索
{
"user_prompt": "2024年最新的AI技术突破有哪些?",
"enable_google_search": true
}代码执行
{
"user_prompt": "编写并运行一个计算100以内质数的Python脚本",
"enable_code_execution": true
}思维链推理 (Gemini 3.1 Thinking)
{
"user_prompt": "详细分析量子计算的技术方案",
"model": "gemini-3.1-pro-preview-thinking"
}Gemini 3.1 思维链版本默认开启 thinking,无需手动指定
thinking_budget。若你仍想精细控制,可继续传thinking_budget参数。
💰 媒体分辨率优化 (节省费用)
使用较低分辨率处理图片/视频,节省 tokens 费用:
{
"user_prompt": "这张图片的主题是什么?",
"files": [{"path": "/path/to/large_image.jpg"}],
"media_resolution": "LOW"
}分辨率 | 说明 | 适用场景 |
| 最低分辨率 | 简单识别、节省费用 |
| 中等分辨率 (默认) | 一般场景 |
| 最高分辨率 | 需要细节分析 |
📚 API易 文档参考
🔧 支持的模型
模型 | 描述 |
| 默认:Gemini 3.1 思维链版本,最强复杂任务/长上下文 |
| Gemini 3.1 标准版(不开 thinking,速度更快) |
| Gemini 3 预览版(上一代) |
| 混合推理,响应最快,适合简单识别 |
⚠️ 注意事项
文件大小限制:单个媒体文件不超过 20MB
推理成本:thinking tokens 会计入输出成本
代码执行:仅支持 Python,在沙箱环境中运行
API 密钥:使用 API易 密钥,非 Google AI Studio 密钥
🔗 链接
Docker Hub: https://hub.docker.com/r/zuozuoliang999/apiyi-mcp-server
API易文档: https://docs.apiyi.com/
📄 许可证
MIT License
Available Tools
2 toolsgenerate_contentA
Generate content using Gemini with optional file inputs, code execution, and Google search. Supports multiple files: images (JPG, PNG, GIF, WebP, SVG, BMP, TIFF), video (MP4, AVI, MOV, WebM, FLV, MPG, WMV), audio (MP3, WAV, AIFF, AAC, OGG, FLAC), documents (PDF), and text files (TXT, MD, JSON, XML, CSV, HTML). MIME type is auto-detected from file extension.
Example usage:
{
"user_prompt": "Analyze this video",
"files": [{"path": "/path/to/video.mp4"}]
}PDF to Markdown conversion:
{
"user_prompt": "Convert this PDF to well-formatted Markdown",
"files": [{"path": "/document.pdf"}]
}With Google Search:
{
"user_prompt": "What are the latest AI breakthroughs in 2024?",
"enable_google_search": true
}With Code Execution:
{
"user_prompt": "Write and run a Python script to calculate prime numbers",
"enable_code_execution": true
}Media Resolution Optimization (save tokens):
{
"user_prompt": "Describe this image",
"files": [{"path": "/image.jpg"}],
"media_resolution": "LOW"
}| Name | Required | Description | Default |
|---|---|---|---|
| files | No | Array of files to include in generation (optional) | |
| model | No | Gemini model to use. Choose from these Gemini 3.x models ONLY: - "gemini-3.5-flash" DEFAULT — best price/perf, fast. Pick this 99% of the time (including video, audio, image, PDF). - "gemini-3.1-pro-preview-thinking" Slow + expensive. ONLY use when you need deep reasoning / a non-trivial `thinking_budget`. - "gemini-3-flash-preview" Cheapest + dumbest. ONLY for high-volume simple classification / extraction. NEVER pass legacy Gemini 2.x ids (gemini-2.5-pro, gemini-2.5-flash, gemini-pro, gemini-flash). They are DEPRECATED for this server. If omitted, the server falls back to the env-configured default (typically "gemini-3.5-flash"). | gemini-3.5-flash |
| temperature | No | Temperature (0-2) | |
| user_prompt | Yes | User prompt for generation | |
| system_prompt | No | System prompt to guide the AI behavior (optional) | |
| thinking_budget | No | Thinking budget for supported models (-1 for unlimited) | |
| media_resolution | No | Media resolution: LOW (saves tokens), MEDIUM, HIGH | MEDIUM |
| enable_google_search | No | Enable Google search capability | |
| enable_code_execution | No | Enable code execution capability |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses supported file types, MIME auto-detection, model deprecation warnings, default values, and limits (max 10 files). However, output format and error handling are not mentioned, reducing transparency slightly.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is lengthy with multiple examples, making it less concise. However, it is well-structured with sections and code blocks. Some information could be condensed without losing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Lacks output schema or description of return values, and does not cover error handling or rate limits. For a tool with 9 parameters, the description is moderately complete but missing critical output context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by providing detailed model selection guidance (including deprecated models), example usage for parameters like files, enable_google_search, etc., clarifying how parameters interact.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool generates content using Gemini, listing supported file types and capabilities. The sibling 'generate_content_batch' suggests this is for single generation, differentiating it effectively.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Examples illustrate various use cases (with files, Google search, code execution, media resolution). Model selection guidance advises when to use each model. However, it does not explicitly contrast with the batch sibling, and assumes context from the name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_content_batchA
Generate multiple contents concurrently using Gemini. This tool allows you to send multiple requests in parallel for better performance.
Each request in the batch requires a unique 'id' field to identify results. All other parameters are the same as generate_content.
Example usage:
{
"requests": [
{
"id": "req1",
"user_prompt": "Describe image 1",
"files": [{"path": "/image1.jpg"}]
},
{
"id": "req2",
"user_prompt": "Describe image 2",
"files": [{"path": "/image2.jpg"}]
},
{
"id": "req3",
"user_prompt": "Summarize this document",
"files": [{"path": "/doc.pdf"}]
}
],
"max_concurrency": 5
}The response includes success/failure status for each request:
{
"total": 3,
"succeeded": 2,
"failed": 1,
"results": [
{"id": "req1", "success": true, "content": "..."},
{"id": "req2", "success": true, "content": "..."},
{"id": "req3", "success": false, "error": "..."}
]
}| Name | Required | Description | Default |
|---|---|---|---|
| requests | Yes | Array of generation requests to process concurrently | |
| max_concurrency | No | Maximum concurrent requests (1-20) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must cover behavioral traits. It mentions concurrent execution and performance benefits, and shows a response format with success/failure per request. However, it does not disclose potential side effects, auth requirements, or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with an example, front-loading the purpose and concurrency benefit. It is slightly lengthy but every sentence serves a purpose; the example is helpful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of an output schema, the description includes a detailed response format example. It covers the `id` requirement and `max_concurrency` parameter, differentiating from `generate_content`. Some details like error handling beyond the response format are missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description adds value by explaining the 'id' field requirement and showing an example, but does not significantly expand on other parameters beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Generate multiple contents concurrently using Gemini', specifying the verb 'generate' and resource 'multiple contents'. It distinguishes from the sibling tool 'generate_content' by emphasizing concurrency and batch processing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains that this tool is for multiple requests in parallel for better performance, implying its use case. However, it does not explicitly state when to use the single request alternative or provide exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.0.0- First observed
generate_content - First observed
generate_content_batch
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one for single content generation, one for batch processing. No overlap or ambiguity.
Both tools follow the exact same prefix 'generate_content', with a descriptive suffix '_batch' for the batch variant. Perfectly consistent pattern.
With only two tools, the server is minimal but scoped appropriately for Gemini content generation. Could potentially include a model listing tool, but not necessary.
The tool set covers the core functionality (single and batch generation). Missing optional features like model selection or streaming, but not gaps that prevent basic usage.
Related MCP Connectors
247 LLMs + image/video/voice/music gen + crypto/DeFi/markets/web-search. Pay-per-call USDC, no key.
Analyze images and videos with Gemini to get fast, reliable visual insights. Handle content from U…
AI agent tools: web search, browser, 400+ LLMs, image gen, TTS, phone verify. Pay-per-use.
AI LLM with Gemini, MiniMax, Replicate, OpenRouter. Vision, search, code review. USDC on Base.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables multi-turn conversations with Google Gemini AI models, supporting file and image analysis, automatic model selection, deep thinking mode, and Google Search integration through the AIStudioProxyAPI backend.22MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered image and video analysis using Google Gemini and Vertex AI models. Supports analyzing single or multiple images, detecting objects with bounding boxes, and video content analysis through natural language prompts.28 npmMIT
- AlicenseAqualityDmaintenanceProvides 23 tools for Google's Gemini API, enabling chat, multimodal analysis, deep research, file management, and YouTube analysis via natural language.231MIT
- AlicenseAqualityCmaintenanceMCP server for Google's Gemini API, enabling text, image, video, speech, embeddings, and deep research capabilities through a single tool set.10MIT