mimo-vision-mcp
An MCP server that uses Xiaomi MiMo v2.5 multimodal model to provide image recognition capabilities (description, multi-image analysis, OCR, and image info validation) for text-only main models like deepseek-v4-flash, accepting local paths, URLs, file://, and base64 data inputs.
README
mimo-vision-mcp
MCP Server:用小米 MiMo v2.5 多模态模型,为纯文本主模型(如 deepseek-v4-flash)补齐图像识别能力。
主模型没有视觉能力时,通过本 Server 把截图、UI 图、报错图、设计稿、照片等转成文字描述,
主模型据此继续推理。二次开发自 Mriestac/mimo-image-recognition-mcp(选型记录见下文)。
功能
| 工具 | 说明 |
|---|---|
describe_image(image, prompt?) |
单图理解(默认给详细描述) |
analyze_images(images, question) |
多图联合分析(前后对比 / A/B 方案) |
extract_text_from_image(image) |
纯 OCR,保留换行缩进 |
read_image_info(image) |
只做本地校验,不调 API(排查输入问题) |
mimo://config 资源 |
查看脱敏配置 |
图片输入支持:本地路径、http(s):// URL、file://、data:image/...;base64,...;
格式仅限 jpg/jpeg/png/gif/webp/bmp,单张 ≤10MB(官方限制)。
架构
主模型(纯文本)─ 图片路径/URL → MCP 工具
→ server 读图转 base64 → POST https://api.xiaomimimo.com/v1/chat/completions (mimo-v2.5)
→ 纯文本描述 → 主模型继续推理
安装
cd <仓库路径> # 例如 C:\path\to\mimo-vision-mcp
uv sync --dev # 创建 .venv 并安装依赖(mcp[cli]<2、httpx、python-dotenv)
Copy-Item .env.example .env
# 编辑 .env 填入 MIMO_API_KEY
注册到 Claude Code(全局)
cd <仓库路径> # 例如 C:\path\to\mimo-vision-mcp
$key = ((Get-Content .env | Where-Object { $_ -match '^MIMO_API_KEY=' }) -split '=', 2)[1]
claude mcp add mimo-vision -s user `
-e "MIMO_API_KEY=$key" `
-e "MIMO_BASE_URL=https://api.xiaomimimo.com/v1" `
-e "MIMO_VISION_MODEL=mimo-v2.5" `
-- "$PWD\.venv\Scripts\python.exe" "$PWD\server.py"
验证:
claude mcp list # 应列出 mimo-vision
claude mcp get mimo-vision
claude mcp inspect mimo-vision # 协议级连通性自检
主会话中需 重启 Claude Code 或 /mcp 重连 后工具才出现。
两种 Key 的差异
| Key 类型 | 前缀 | MIMO_BASE_URL |
|---|---|---|
| 普通按量付费 | sk- |
https://api.xiaomimimo.com/v1 |
| Token Plan | tp- |
https://token-plan-cn.xiaomimimo.com/v1 |
mimo-v2.5-pro 是纯文本推理模型,视觉理解必须用 mimo-v2.5。
使用
主会话中对模型说,例如:
描述这张图:C:\path\to\your\image.png 提取这张报错截图里的文字:C:\path\to\error.png
模型会自动调用对应工具。
验证
uv run --env-file .env pytest tests/test_image_utils.py tests/smoke_test.py # 离线单测
uv run --env-file .env pytest tests/test_api.py # 真实 API 直连
踩坑记录
- MiMo API 硬性要求:content 数组必须同时包含
image_url与text对象, 角色必须user,否则返回400 Param Incorrect - text is not set(见api_client.build_vision_message)。 - mcp SDK 2.x 移除了
mcp.server.fastmcp:pyproject 锁定mcp[cli]>=1.2,<2.0。 - mcp 1.29 lifespan 是构造函数参数(非
@mcp.lifespan_context);工具/资源通过参数注解Context注入。 - resource 有函数参数会被注册为模板资源(
_templates)而非普通资源,list_resources看不到——配置资源改为无参数函数。 - 认证头用
Authorization: Bearer(base 项目 Mriestac 原用api-key,已修正);单图大小上限按官方改 10MB;补充file://输入支持。
配置项(.env)
| 变量 | 默认 | 说明 |
|---|---|---|
MIMO_API_KEY |
— | 必填 |
MIMO_BASE_URL |
https://api.xiaomimimo.com/v1 |
Token Plan 需改 |
MIMO_VISION_MODEL |
mimo-v2.5 |
视觉模型名 |
MIMO_MAX_TOKENS |
2048 |
最大输出 token |
MIMO_TIMEOUT |
60 |
请求超时(秒) |
MIMO_ENABLE_THINKING |
False |
是否输出思考过程(更慢) |
MIMO_MAX_IMAGE_BYTES |
10485760 |
单图上限(10MB) |
选型记录
候选仓库(均已 clone 审阅后删除 _ref/):
- 选定 base:
Mriestac/mimo-image-recognition-mcp—— 天然用 OpenAIchat/completions格式 +api.xiaomimimo.com,依赖轻(httpx),async 实现,工具/资源写法为标准 FastMCP。 - 备选:
kuohao233/mimo-vision-mcp—— 工具更全(describe/analyze/ocr)但走 Anthropic/v1/messages格式,重写请求层成本高;其工具设计(默认 prompt、OCR 提示词)已借鉴到本项目。
修复自 base 的 3 处问题:认证头、10MB 上限、file:// 支持,并新增 read_image_info 工具与 4 个独立工具拆分。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.