Skip to main content
Glama
mikulovesuki

mimo-vision-mcp

by mikulovesuki

mimo-vision-mcp

Give text-only LLMs vision capability through MCP, powered by vision models like Xiaomi MiMo-V2.5.

通过 MCP(Model Context Protocol),把视觉模型(如小米 MiMo-V2.5)的图像理解能力暴露给不具备多模态能力的文本 LLM。文本模型遇到图片/截图/图片路径时,可主动调用 analyze_imagedescribe_imageextract_text_from_image 等工具获得视觉能力。

Python License CI

🚀 一键启动(新手也能 1 分钟上手,无需敲任何命令)

本项目内置 WebUI 一键启动,全程鼠标操作,自动完成所有环境配置,零命令行门槛:

  1. 下载 / 克隆本项目到本地

  2. 双击 start-webui.bat(Windows)——脚本会自动创建 .env(从 .env.example)、自动装环境/依赖、启动服务、并自动打开浏览器

  3. 浏览器打开后,在网页里填入你的 API Key → 点「应用到 CLI」,或直接拖一张图片进去 → 选个视觉模型 → 点「预览测试」,即可看到视觉模型"看图说话"

首次启动会自动安装依赖(需联网,约 1~2 分钟),之后双击即秒开。 完全不需要懂 Python、不需要手敲 pip、不需要手动创建 .env——脚本全自动完成。

命令行里的文本 LLM 使用视觉能力的完整接入见下方 接入 opencode

Related MCP server: mimo-vision-mcp

原理

文本模型负责"调度",视觉模型负责"看",MCP 是把两者接起来的接口——图片数据本身不经过文本模型

用户给图片路径/URL
  → ① 文本 LLM 根据工具列表 + 调用指引,决定调用 analyze_image
  → ② opencode / 任意 MCP 客户端(stdio)
  → ③ mimo-vision MCP server(图片归一化 + 转发请求)
  → ④ 视觉模型(MiMo-V2.5 等,经 OpenCode Go / 自定义供应商)真正"看"图
  → ⑤ 文本结果原路返回,文本模型转述给用户

特性

  • 一键启动:双击 start-webui.bat 即可,自动装依赖、起服务、开浏览器,新手零门槛

  • 开箱即用:默认接入 OpenCode Go,填一个 API Key 即可开始,也可切换小米官方 / 任意自定义供应商

  • 基于 OpenAI 兼容协议,stdio 本地传输,可接入 opencode / Claude Desktop / Cursor 等任意 MCP 客户端

  • 图片输入灵活:本地路径 / http(s) URL / base64 data URI / 纯 base64 均可

  • 支持多图输入、图片格式自动识别(JPEG/PNG/GIF/WebP/BMP)、50MB 限制校验

  • 自动按模型选择 API 协议:gpt-*/grok-* 走 Responses API,其余走 chat/completions(可强制指定)

  • 内置 WebUI 配置面板:可视化选模型、预览测试,选择即同步到 CLI,无需重启

  • 无 API key 时返回友好错误提示,不会崩溃

目录结构

mimo-vision-mcp/
├── mimo_vision_mcp/
│   ├── config.py           # 配置读取(.env 实时重读)+ 应用到 MCP
│   ├── image_loader.py     # 图片输入归一化 + MIME 探测
│   ├── providers.py        # 供应商注册表 + call_vision(chat/responses 适配)
│   └── server.py           # FastMCP server + 3 个工具
├── webui/                  # WebUI 配置面板(FastAPI + 单页 HTML)
├── tests/                  # 单元测试
├── .github/workflows/ci.yml
├── opencode.example.json   # opencode 接入配置示例
├── AGENTS.md               # 文本模型的调用指引
├── start-webui.bat           # 🚀 一键启动(Windows,双击即用)
├── LICENSE
└── pyproject.toml

安装

python -m venv .venv
# Windows: .\.venv\Scripts\python.exe -m pip install -e ".[dev]"
.venv/bin/python -m pip install -e ".[dev]"

配置 API Key

本项目默认走 OpenCode Go 套餐调用 MiMo-V2.5(模型 mimo-v2.5,OpenAI 兼容端点 https://opencode.ai/zen/go/v1)。

  1. opencode.ai/auth 订阅 Go,复制 API Key

  2. .env.example 复制为 .env 并填写:

    MIMO_API_KEY=你的-opencode-go-key

也可通过环境变量覆盖(config.py 每次调用实时重读 .env):

变量

说明

默认值

MIMO_API_KEY

API Key(也可用 OPENAI_API_KEY

MIMO_PROVIDER

供应商 ID

opencode-go

MIMO_MODEL

视觉模型 ID

mimo-v2.5

MIMO_BASE_URL

OpenAI 兼容端点

https://opencode.ai/zen/go/v1

MIMO_API_STYLE

chat / responses(空则自动)

自动

MIMO_MAX_TOKENS

单次输出上限

4096

MIMO_TIMEOUT

请求超时(秒)

120

切换视觉模型:OpenCode Go 里更快的多模态模型可把 MIMO_MODEL 改成 gpt-5.6-luna(走 /responses)或 minimax-m3。注意 mimo-v2.5-pro纯文本模型,不能看图。

运行 MCP server

# 方式一:控制台脚本
mimo-vision-mcp
# 方式二:模块运行
python -m mimo_vision_mcp.server

接入 opencode

参考 opencode.example.jsonmimo-vision 注册为本地 stdio MCP server:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "mimo-vision": {
      "type": "local",
      "command": ["<你的python路径>", "-m", "mimo_vision_mcp.server"],
      "enabled": true,
      "environment": { "MIMO_API_KEY": "{env:MIMO_API_KEY}" }
    }
  },
  "experimental": { "mcp_timeout": 120000 }
}

注意experimental.mcp_timeout(默认 30s)控制 MCP 工具调用超时。视觉请求可能耗时几十秒,需调到 120s 以上;不要mcp.mimo-vision 里单独设置 timeout,它会覆盖 mcp_timeout 并导致超时。配置改动后需重启 opencode 生效。

本项目还附带 AGENTS.md(文本模型的调用指引),可通过全局配置 "instructions": ["<路径>/AGENTS.md"] 注入每个会话,让纯文本模型遇到图片时主动调用工具。

工具说明

工具

说明

analyze_image(images, prompt, detail?)

通用图片问答,可多图

describe_image(images, detail?)

详细描述图片内容

extract_text_from_image(images, detail?)

提取图中文字(OCR)

images 每项支持:

  • 本地绝对路径:C:/Users/xx/Pictures/a.png

  • 公网 URL:https://example.com/a.jpg

  • base64 data URI:data:image/png;base64,....

  • 纯 base64 字符串

返回 JSON:{ "result": "...", "error": "", "model": "...", "usage": {...} }

WebUI(交互式前端 · 一键启动)

新手首选入口:图形化界面,上传图片、选模型、看效果,全鼠标操作。

一键启动(最简单,无需懂任何命令)

双击 start-webui.bat(Windows)即可:

  1. 脚本自动检查/创建环境、自动安装依赖

  2. 自动启动服务并自动打开浏览器

  3. 若服务已在运行则直接打开浏览器,不会重复启动

非 Windows 用户手动启动:python -m pip install -e ".[web]" && python -m webui.app,然后浏览器打开 http://127.0.0.1:8000(端口可用 MIMO_WEBUI_PORT 修改)。

界面功能

  • 顶部「CLI / MCP 当前生效模型」显示命令行 LLM 实际使用的供应商/模型/风格

  • 选好模型后点**「应用到 CLI(同步到 MCP)」**,配置写入 .env无需重启,CLI 下次调用即用新模型

  • 下方「预览测试(不影响 CLI)」用于先试效果

  • API Key 存于浏览器 localStorage;「应用到 CLI」时可一并写入 .env

测试

python -m pytest -q

常见问题

  • 我不会编程 / 不想敲命令怎么办?:双击 start-webui.bat 即可,脚本会自动创建 .env、装依赖、起服务、开浏览器,全程鼠标操作

  • API Key 填在哪?:clone 后没有 .env(仓库只含空模板 .env.example)。双击启动脚本会自动生成 .env,之后在网页里填 Key 并点「应用到 CLI」,或直接编辑 .envMIMO_API_KEY

  • 返回"未配置 API Key":在 .env 配置 MIMO_API_KEY(或直接在 WebUI 里填写并「应用到 CLI」)

  • 图片格式不支持:仅支持 JPEG/PNG/GIF/WebP/BMP

  • base64 输入报"无法解析":确认输入为合法 base64,且格式在支持范围内

  • MCP 工具调用超时:将 experimental.mcp_timeout 调到 120000ms 以上

许可证

MIT

参考

Available Tools

3 tools
analyze_imageA

分析图片内容并回答你的问题(基于视觉模型)。

当用户要求"看图片/描述图片/识别图中内容/截图分析",或对话中出现本地图片路径、 图片 URL 或 base64 图片数据时,主动调用本工具。

Args: images: 图片列表,每项可以是: - 本地绝对路径,如 "C:/Users/xx/Pictures/a.png" - 公网 URL,如 "https://example.com/a.jpg" - base64 data URI,如 "data:image/png;base64,...." - 纯 base64 字符串 prompt: 对图片提出的问题或指令,如 "这张图里有什么动物?" detail: 可选,图片采样精细度,取 "low" / "high" / "auto"

ParametersJSON Schema
NameRequiredDescriptionDefault
detailNo
imagesYes
promptYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

无注解,描述承担全部行为披露责任。仅提到'基于视觉模型'暗示外部调用,但未说明网络依赖、图片大小限制、失败处理或隐私影响等关键行为。描述只覆盖输入格式,行为细节缺失。

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

描述采用分节结构(触发条件+参数解释),信息密集且无冗余。中文表述流畅,但长度稍长,每句均有价值,整体简洁。

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

工具中等复杂,有输出schema故无需描述返回值。描述覆盖了参数和触发场景,但未提及错误处理或资源限制等潜在注意事项,在有无注解情况下仍可更完整。

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

schema覆盖率为0%,描述完全弥补了参数含义:详细列出images的四种合法格式(路径、URL、data URI、纯base64),解释prompt用途,并明确detail为采样精细度且枚举值low/high/auto。超越schema预期。

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

描述明确说明工具是'分析图片内容并回答你的问题',使用具体动词和资源。但未明确区分与兄弟工具describe_image、extract_text_from_image的边界,可能混淆,因此扣一分。

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

描述提供了明确的触发条件(用户要求看图片/描述图片等或出现图片路径/URL/base64),并指示'主动调用'。但未说明何时不使用(如仅需纯描述时是否应选describe_image),不过整体指引清晰。

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

describe_imageA

详细描述图片内容(基于视觉模型)。

当用户要求"描述/介绍一下这张图、看到什么"时调用。输入约定同 analyze_image。

ParametersJSON Schema
NameRequiredDescriptionDefault
detailNo
imagesYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full responsibility. It mentions '基于视觉模型' (vision model based) but does not elaborate on output format, limitations, or side effects. It also references '输入约定同 analyze_image' without specifying those conventions, leaving behavior opaque. Some context is given but insufficient for a fully transparent description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise: two sentences, no fluff, directly states purpose and when to call. It is well-structured with a clear trigger and a reference for input conventions. However, the conciseness comes at the cost of completeness, but for the dimension of conciseness and structure, it is efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description fails to provide comprehensive guidance: no exclusions, no detail on output, no mention of what happens for invalid input, and no standalone parameter explanation. The context signals show no annotations and 0% parameter coverage, so the description must compensate but only partially does by reusing analyze_image's conventions. For a simple tool this may be acceptable, but for an AI agent making decisions, it's insufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning no parameter descriptions are provided in the schema. The description mentions '输入约定同 analyze_image' which implies conventions are shared, but since analyze_image's conventions are not spelled out here, the agent must look elsewhere. The description lists only 'detail' and 'images' names without explanation. This adds minimal clarity, and the description does not compensate for the missing parameter docs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('详细描述图片内容' = describe image content in detail) and specifically mentions the vision model basis. While it doesn't explicitly contrast with sibling tools, the phrasing '当用户要求...' distinguishes it from extract_text_from_image which focuses on text extraction. Purpose is clear and specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit trigger conditions ('当用户要求描述/介绍一下这张图、看到什么时调用') and points to analyze_image for input conventionsastra. However, it does not mention exclusions or when to prefer extract_text_from_image over this tool, so some guidance is missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

extract_text_from_imageA

提取图片中的文字(OCR,基于视觉模型)。

当用户要求"识别/提取图中文字、截图里的文本"时调用。输入约定同 analyze_image。

ParametersJSON Schema
NameRequiredDescriptionDefault
detailNo
imagesYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It adds that it's 'OCR based on vision model', which gives some insight into how it works. However, it does not disclose potential limitations, error behavior, or whether images are stored, leaving some behavioral aspects unspecified. The read-only nature mitigates the gap, but the description is thin.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, two sentences, with the main purpose front-loaded. Every sentence adds value, and there is no wasted wording. The reference to analyze_image is efficient, though it creates a dependency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema is present, so return values are covered externally. The description covers purpose and usage trigger. The only gap is that it relies on the sibling tool for input conventions, but given the tool's simplicity and the presence of sibling context, it is adequately complete for an OCR tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only says 'input conventions same as analyze_image' without explaining what images or detail mean in practice. This is a pointer to sibling information rather than an explanation, failing to provide direct parameter semantics for the agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool extracts text from images via OCR with a specific verb and resource. It also distinguishes from sibling tools by explicitly mentioning when to use it for 'recognize/extract text in images, screenshots', which sets it apart from analyze_image and describe_image.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides an explicit trigger condition: 'Call when user asks to recognize/extract text in images'. It also references input conventions from analyze_image, giving clear context. However, it does not explicitly mention when not to use this tool, though the sibling distinction is implicit.

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.

  1. 3 tool updatesv0.1.0
    • First observedanalyze_image
    • First observeddescribe_image
    • First observedextract_text_from_image

TDQS

A3.6/5.0

Scored across 3 tools

Disambiguation2/5

The tools analyze_image and describe_image have overlapping purposes—both process images to provide content understanding, and analyze_image accepts a prompt that could easily request a description. This creates selection ambiguity, while extract_text_from_image is clearly distinct.

Naming Consistency5/5

All tool names follow the consistent verb_noun pattern: analyze_image, describe_image, extract_text_from_image. The naming is predictable and makes functionality intuitively obvious.

Tool Count4/5

With only 3 tools, the server stays within the typical 3-15 range and is appropriately scoped for a vision analysis service. Each tool addresses a high-level need without excessive bloat.

Completeness3/5

The set covers core image understanding (general Q&A, full description, OCR), but lacks dedicated tools for tasks like classification, comparison, or object detection. The overlap between analyze and describe indicates a design gap, though the current coverage handles basic workflows.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers