Skip to main content
Glama

ai-vision

支持 OpenAI 兼容协议的视觉识别 MCP 服务器。让 Claude Desktop / Cline / Cherry Studio 等 MCP 客户端获得图片识别能力,可接入 OpenAI、通义千问、智谱、Moonshot 等任意 OpenAI 兼容服务商。

📖 完整使用说明(中文): docs/使用说明.html

快速开始

pnpm install
pnpm build

# 方式一:环境变量(也可直接在 MCP 客户端的 env 字段里注入)
OPENAI_API_KEY=sk-xxx node dist/index.js

# 方式二:配置文件(支持多服务商,参考 sample-config.json)
cp sample-config.json config.json
node dist/index.js --config=config.json

Related MCP server: vision-mcp

MCP 客户端配置(推荐:env 注入,无需配置文件)

{
  "mcpServers": {
    "vision": {
      "command": "ai-vision",
      "args": [],
      "env": {
        "OPENAI_API_KEY": "sk-你的密钥",
        "OPENAI_BASE_URL": "https://api.openai.com/v1",
        "OPENAI_MODEL": "gpt-4o"
      }
    }
  }
}

提供的 MCP 工具

工具

功能

analyze_image

分析本地图片(路径 / base64)

analyze_image_url

分析远程图片 URL

analyze_images

多图对比(最多 10 张)

list_models

查询服务商可用模型

技术栈

测试

pnpm test   # 本地 mock 服务器验证协议格式,无需真实 API Key

Available Tools

4 tools
analyze_imageA

分析一张本地图片(通过路径或 base64 数据传入),返回视觉模型的识别结果

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNo覆盖默认的视觉模型,如 gpt-4o、qwen-vl-max
promptNo视觉分析指令,例如:请识别图片中的文字
providerNo使用的 API 服务商名称(config.json 中配置)
mime_typeNo图片 MIME 类型,如 image/png(当 image_data 为纯 base64 时需要)
image_dataNo图片 base64 数据,或带 data:image/png;base64, 前缀的 data URL
image_pathNo本地图片文件路径,如 C:/Users/me/photo.png 或 ./screenshot.png
max_tokensNo生成的最大 token 数(可选,不传则由服务商决定)
temperatureNo采样温度,默认 0.7

TDQS

A3.5/5.0
Behavior2/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 of disclosing behavioral traits. It only states that it returns a recognition result, without mentioning whether the operation is read-only, whether it has side effects such as network calls, or any limitations. This is a minimal disclosure, leaving important behavioral aspects unspecified.

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 a single, focused sentence that conveys the core purpose and input methods. It is front-loaded with the action and resource, contains no fluff, and every word contributes to understanding the tool's function.

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 explains the main purpose but lacks detail about the return format (since there is no output schema) and doesn't clarify when to use this tool over its siblings. The schema covers parameter semantics, but the overall context of choosing between local and URL-based analysis is not explicitly addressed in the description.

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

Parameters3/5

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

The schema description coverage is 100%—every parameter has a detailed description. The tool description adds no additional meaning beyond what the schema already provides (e.g., it mentions image_path and image_data but doesn't elaborate on their semantics). Thus the baseline of 3 is appropriate; the description does not compensate or enhance beyond the schema.

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 analyzes a local image via path or base64 data and returns the visual model's recognition result. It specifically mentions 'local image' which distinguishes it from the sibling tool 'analyze_image_url' that likely handles URLs, and 'analyze_image' (singular) differentiates from 'analyze_images' (plural). The verb 'analyze' and resource 'local image' are explicit.

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

Usage Guidelines3/5

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

The description implies usage for local images (via path or base64) but does not explicitly state when to use this tool vs alternatives like analyze_image_url or analyze_images. It neither mentions exclusions nor names alternative tools. The sibling names suggest a distinction, but the description itself doesn't provide clear comparative guidance.

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

analyze_imagesA

同时分析多张图片(路径/base64/URL 混合),用于对比、找差异、多图综合理解

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNo覆盖默认的视觉模型,如 gpt-4o、qwen-vl-max
imagesYes图片数组(最多 10 张)
promptNo视觉分析指令,例如:请识别图片中的文字
providerNo使用的 API 服务商名称(config.json 中配置)
max_tokensNo生成的最大 token 数(可选,不传则由服务商决定)
temperatureNo采样温度,默认 0.7

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the key behavior of accepting mixed image sources and the intended use cases, but does not mention any limitations, error handling, or return format. For a read-only analysis tool, this is acceptable but not rich. It adds some context beyond the schema.

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 a single, well-structured sentence that front-loads the main action and key differentiators. It is concise with no wasted words, while still conveying the essential purpose and use cases.

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 covers the core usage but has gaps given no output schema and no annotations. It does not explain what the response looks like (e.g., combined vs per-image analysis), nor any potential prerequisites or limitations. However, the schema is complete and the description gives enough for a simple analysis tool.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds meaningful context by explicitly stating the mixed input types (path/base64/URL) and the purpose of the analysis (comparison, differences, comprehensive understanding), which helps agents understand how to construct the 'images' parameter and use the 'prompt' parameter appropriately.

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 verb 'analyze' and the resource 'multiple images' with explicit use cases (comparison, finding differences, comprehensive understanding). It distinguishes from siblings by explicitly handling multiple images and mixed input types (path/base64/URL), which is not covered by analyze_image or analyze_image_url.

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 clear context for when to use the tool: when multiple images need joint analysis or comparison. It does not explicitly list alternative tools or exclusions, but the sibling names (analyze_image, analyze_image_url) make it obvious that this is the multi-image variant. The mention of 'mixed' input also hints at a key usage condition.

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

analyze_image_urlB

分析一张远程图片(通过 http/https URL 传入),返回视觉模型的识别结果

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes图片的远程 URL,如 https://example.com/photo.png
modelNo覆盖默认的视觉模型,如 gpt-4o、qwen-vl-max
promptNo视觉分析指令,例如:请识别图片中的文字
providerNo使用的 API 服务商名称(config.json 中配置)
max_tokensNo生成的最大 token 数(可选,不传则由服务商决定)
temperatureNo采样温度,默认 0.7

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations provided, the description must fully disclose behavioral traits. It mentions the input (URL) and the output (vision model recognition result), but fails to disclose potential side effects like network fetching of the URL, authentication requirements, rate limits, or error behaviors. This leaves significant behavioral ambiguity for a tool that involves remote resources.

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 a single, concise sentence that directly states the tool's action and result. It is front-loaded with the primary purpose ('analyze a remote image') and avoids any extraneous details. Every word contributes to understanding the tool's core function.

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

Completeness2/5

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

Given the lack of an output schema and the presence of sibling tools that suggest ambiguity, the description is underspecified. It does not explain the return format in detail, provide usage guidelines, or differentiate when to use this tool over analyze_image/analyze_images. For a six-parameter tool without annotations, this is insufficient context.

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

Parameters3/5

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

Schema description coverage is 100%, so all six parameters are already documented in the schema. The description adds no additional semantic information beyond what the schema provides, such as parameter relationships or usage examples. Baseline of 3 is appropriate since the schema carries the full parameter documentation burden.

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's function with a specific verb (analyze) and resource (remote image via URL), and explicitly mentions the input format (http/https URL). It distinguishes itself from sibling tools like analyze_image by specifying 'remote' and 'via URL', making its purpose unique and unambiguous.

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

Usage Guidelines3/5

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

The description implies usage for remote images passed via URL, but it does not explicitly state when to use this tool versus its siblings (analyze_image, analyze_images) or provide any exclusions. There is no explicit guidance on alternatives, leaving the selection partially inferred from the purpose rather than clearly documented.

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

list_modelsA

查询当前服务商支持的模型列表(调用 /v1/models)

ParametersJSON Schema
NameRequiredDescriptionDefault
providerNo使用的 API 服务商名称(config.json 中配置)

TDQS

A4/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 burden. It discloses the underlying API call (/v1/models) and implies read-only behavior via '查询'. However, it does not mention authentication, rate limits, or what happens when provider is omitted, leaving gaps for a networked operation.

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 a single concise sentence that includes both the action and the endpoint. It is front-loaded with the purpose and contains no redundant content.

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?

Given the tool's simplicity (one optional parameter, no output schema), the description is mostly complete: it names the operation and the API call. It could briefly mention whether the parameter is required or defaults to current provider, but this is a minor gap for a straightforward list operation.

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

Parameters3/5

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

The schema already fully documents the provider parameter with a description. The tool description mentions 'current provider' but doesn't add details about how provider is used or defaults. With 100% schema coverage, the baseline is 3 and the description adds minimal semantic value beyond the schema.

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 lists models supported by the current provider, with the specific API endpoint /v1/models. The verb '查询' (query) and resource '模型列表' are specific. It is obviously distinct from sibling tools that analyze images.

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 context is clear: use when you need to see which models the current provider supports. It doesn't explicitly mention when not to use or alternatives, but siblings are unrelated so no exclusion is needed. The optional provider parameter and mention of 'current provider' imply default behavior, though not explicit.

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. 4 tool updatesv1.0.0
    • First observedanalyze_image
    • First observedanalyze_image_url
    • First observedanalyze_images
    • First observedlist_models

TDQS

A4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct input type (local image, remote image, multiple images, models). No overlap between analyze tools is present.

Naming Consistency5/5

All tools follow a clear verb_noun pattern: list_models and analyze_* are consistent and predictable.

Tool Count5/5

Four tools is well-scoped for a vision analysis server, covering model listing and image analysis without unnecessary bloat.

Completeness5/5

The set covers the core workflows: listing available models, analyzing local and remote images, and multi-image analysis. No obvious gaps for the domain.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for analyzing images using multiple vision LLM providers (OpenCode, OpenAI, Anthropic, Google, and custom OpenAI-compatible endpoints). Provides tools to analyze single or multiple images, list providers, and test vision capabilities.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    An MCP server for image recognition and OCR via OpenAI-compatible vision APIs, supporting local files, URLs, and data URLs. Enables natural language image description and text extraction.
    14 npm
    2
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables image analysis via OpenAI-compatible vision APIs, supporting local files, URLs, and base64 inputs with intelligent tiling for high-resolution images. Provides a secure, configurable MCP stdio server for structured vision analysis.
    184 npm
    2
    MIT