vlm-mcp-server
Enables vision and video analysis tasks using locally hosted models via Ollama's OpenAI-compatible API.
Enables vision and video analysis tasks such as UI-to-code conversion, OCR, error diagnosis, diagram analysis, data visualization insights, and video content analysis using OpenAI's Chat Completions or Responses API.
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., "@vlm-mcp-server Analyze this error screenshot and suggest fixes"
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.
VLM MCP Server
中文文档 | English

A Model Context Protocol (MCP) server providing vision & video analysis tools, configurable with any model provider.
This is a reverse-engineered and extended reimplementation of @z_ai/mcp-server (Apache-2.0, credit to Chao Gong, Lei Yuan / Z.AI). It introduces a provider abstraction layer so the same set of tools can run against any of three API families:
Chat Completions — OpenAI-compatible
POST {base}/chat/completions(OpenAI, Z.AI, Zhipu, OpenRouter, Together, Groq, DeepSeek, Moonshot, local Ollama / LM Studio, …)Responses — OpenAI
POST {base}/responses(gpt-4o, o-series reasoning models)Anthropic Messages —
POST {base}/v1/messages(Claude, and Anthropic-compatible gateways)
Quick Start
npx -y @syntx-ai/vlm-mcp-serverThat's it for the server side — it speaks MCP over stdio. You need to configure it in your MCP client. Pick your provider and set three environment variables:
Provider | Environment variables |
Chat Completions |
|
Responses |
|
Anthropic |
|
Claude Code one-liner (Chat Completions example — replace with your values):
claude mcp add -s user vlm-mcp-server \
--env OPENAI_CHAT_COMPLETIONS_API_KEY=sk-... \
OPENAI_CHAT_COMPLETIONS_BASE_URL=https://api.openai.com/v1/ \
OPENAI_CHAT_COMPLETIONS_MODEL=gpt-4o \
-- npx -y @syntx-ai/vlm-mcp-serverFor other clients (Cline, OpenCode, Crush, Roo Code, …), see Client Configuration.
Related MCP server: mcp-see
Available Tools
Image Analysis
Tool | Description |
| Convert UI screenshots to code, prompts, specs, or descriptions |
| OCR — extract code, terminal output, or text from screenshots |
| Analyze error messages and stack traces, suggest fixes |
| Analyze architecture, flowchart, UML, ER, and sequence diagrams |
| Extract insights, trends, and anomalies from charts |
| Visual regression — compare expected vs actual UI, prioritize issues |
| General-purpose image analysis (fallback) |
Video Analysis
Tool | Description |
| Video content analysis (local files or URLs, ≤8MB, MP4/MOV/M4V) |
Configuration
The server loads variables from a .env file at startup (real environment variables take precedence). Three layers are supported; precedence is per-provider groups > generic > legacy.
Per-provider groups
Configure each API family independently. auto picks the first group with both a key and a base URL set.
Variable group | API family |
| Chat Completions |
| Responses |
| Anthropic Messages |
Generic variables
Variable | Description | Default |
| API key | (required) |
| Provider API root | Zhipu default |
| Model name |
|
| Provider family: |
|
| Sampling temperature |
|
| Top-p |
|
| Max output tokens |
|
| Request timeout (ms) |
|
| Retry attempts |
|
| Enable provider-specific reasoning / thinking request fields. Off by default for broad OpenAI-compatible Chat Completions support. |
|
|
|
|
| Custom log file path |
|
Provider auto-detection
In auto mode (when no OPENAI_* group is set), the provider is inferred as follows:
Base URL contains
anthropic, or key starts withsk-ant→anthropicOtherwise →
chat-completions(the most broadly compatible default)
Usage Examples
Once the server is installed in your client, you can use it through conversation. For example, in Claude Code, type describe this demo.png — the MCP Server will process the image and return a description (the image must exist in the current directory).
Outside Claude Code, pasting an image directly into the client will NOT invoke this MCP Server — the client encodes the image and calls the model API itself. Best practice: place images in a local directory and refer to them by name or path in conversation, e.g.
What does demo.png describe?
Troubleshooting
Run the server directly from the command line to verify it starts, isolating environment / permission issues:
# Linux / macOS
OPENAI_CHAT_COMPLETIONS_API_KEY=sk-... \
OPENAI_CHAT_COMPLETIONS_BASE_URL=https://api.openai.com/v1/ \
OPENAI_CHAT_COMPLETIONS_MODEL=gpt-4o \
npx -y @syntx-ai/vlm-mcp-server
# Windows CMD
set OPENAI_CHAT_COMPLETIONS_API_KEY=sk-... && set OPENAI_CHAT_COMPLETIONS_BASE_URL=https://api.openai.com/v1/ && set OPENAI_CHAT_COMPLETIONS_MODEL=gpt-4o && npx -y @syntx-ai/vlm-mcp-server
# Windows PowerShell
$env:OPENAI_CHAT_COMPLETIONS_API_KEY="sk-..."; $env:OPENAI_CHAT_COMPLETIONS_BASE_URL="https://api.openai.com/v1/"; $env:OPENAI_CHAT_COMPLETIONS_MODEL="gpt-4o"; npx -y @syntx-ai/vlm-mcp-serverIf it starts successfully, the environment is correct — the issue is likely in the client's MCP config; double-check it.
If it fails, investigate the error message (pasting it to an LLM for analysis is recommended).
Common issues
Connection failure
Ensure Node.js 18 or newer is installed.
Run
node -vandnpx -vto confirm the runtime is available.Verify the environment variables (
OPENAI_*triple orVLM_*) are set correctly.
Invalid API Key
Confirm the API Key was copied correctly.
Check that the API Key is activated.
Ensure the selected provider family matches the API Key (Chat Completions / Responses / Anthropic).
Check that the API Key has sufficient balance.
Connection timeout
Check your network connection.
Check firewall settings.
Try switching to a different provider family or base URL.
Increase the timeout (
VLM_TIMEOUT, default 300000ms).
Architecture
src/
├── index.ts # Entry point: starts the MCP server, registers all tools
├── types/ # Error types (McpError, ApiError, ValidationError, …)
├── core/
│ ├── environment.ts # Env config (VLM_* + OPENAI_* groups), URL resolution
│ ├── chat-service.ts # Delegates to the active VisionProvider
│ ├── file-service.ts # File validation + base64 encoding (image/video)
│ ├── base-image-service.ts # Shared image-processing logic for all image tools
│ ├── api-common.ts # Message builders, response helpers, retry wrapper
│ ├── error-handler.ts # Error hierarchy + handling/recovery strategies
│ └── logger.ts # stderr + file logger (keeps stdout JSON-clean)
├── providers/ # Pluggable model-provider abstraction
│ ├── types.ts # VisionProvider interface, ChatMessage, postJson helper
│ ├── chat-completions.ts # OpenAI-compatible Chat Completions
│ ├── responses.ts # OpenAI Responses API
│ ├── anthropic.ts # Anthropic Messages API
│ └── index.ts # Provider selection (VLM_PROVIDER / auto-infer)
├── prompts/ # System prompts for each specialized tool
└── tools/ # 8 tool registrations (7 image + 1 video)The provider layer (src/providers/) is the key extension. Each provider implements a VisionProvider interface that takes normalized ChatMessage[] (the OpenAI Chat Completions content-part format as internal lingua franca) and translates it to the provider's wire format. chat-service.ts simply delegates to the resolved provider, so none of the tool code needed to change.
License
Apache-2.0
Available Tools
8 toolsanalyze_data_visualizationA
Analyze data visualizations, charts, graphs, and dashboards to extract insights and trends.
Use this tool ONLY when the user has a data visualization image and wants to understand the data patterns or metrics. This tool specializes in interpreting visual data representations.
Do NOT use for: UI mockups, error messages, or technical architecture diagrams.
Inputs: prompt (required), image_source (required), analysis_focus.
analyze_imageA
General-purpose image analysis for scenarios not covered by specialized tools.
Use this tool as a FALLBACK when none of the other specialized tools (ui_to_artifact, extract_text_from_screenshot, diagnose_error_screenshot, understand_technical_diagram, analyze_data_visualization, ui_diff_check) fit the user's need.
This tool provides flexible image understanding for any visual content.
Inputs: prompt (required), image_source (required).
analyze_videoA
Analyze video content using advanced AI vision models.
Use this tool when the user wants to:
Understand what happens in a video
Extract key moments or actions from video
Analyze video content, scenes, or sequences
Get descriptions of video footage
Identify objects, people, or activities in video
Supports both local files and remote URL. Maximum file size: 8MB. Supports MP4, MOV, M4V formats.
Inputs: prompt (required), video_source (required).
diagnose_error_screenshotA
Diagnose and analyze error messages, stack traces, and exception screenshots.
Use this tool ONLY when the user has an error screenshot and needs help understanding or fixing it. This tool specializes in error analysis and provides actionable solutions.
Do NOT use for: code extraction, UI analysis, or diagram understanding.
Inputs: prompt (required), image_source (required), context.
extract_text_from_screenshotA
Extract and recognize text from screenshots using advanced OCR capabilities.
Use this tool ONLY when the user has a screenshot containing text and wants to extract it. This tool specializes in OCR for code, terminal output, documentation, and general text extraction.
Do NOT use for: UI design conversion, error diagnosis, or diagram understanding.
Inputs: prompt (required), image_source (required), programming_language.
ui_diff_checkA
Compare two UI screenshots to identify visual differences and implementation discrepancies.
Use this tool ONLY when the user wants to compare an expected/reference UI with an actual implementation. This tool is specialized for UI quality assurance and design-to-implementation verification.
Do NOT use for: general image comparison, error diagnosis, or analyzing single UIs.
Inputs: prompt (required), actual_image_source (required), expected_image_source (required).
ui_to_artifactA
Convert UI screenshots into various artifacts: code, prompts, design specifications, or descriptions.
Use this tool ONLY when the user wants to:
Generate frontend code from UI design (output_type='code')
Create AI prompts for UI generation (output_type='prompt')
Extract design specifications (output_type='spec')
Get natural language description of the UI (output_type='description')
Do NOT use for: screenshots containing text/code to extract, error messages, diagrams, or data visualizations.
Inputs: prompt (required), output_type (required), image_source (required).
understand_technical_diagramA
Analyze and explain technical diagrams including architecture diagrams, flowcharts, UML, ER diagrams, and system design diagrams.
Use this tool ONLY when the user has a technical diagram and wants to understand its structure or components. This tool specializes in interpreting visual technical documentation.
Do NOT use for: UI screenshots, error messages, or data visualizations/charts.
Inputs: prompt (required), image_source (required), diagram_type.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each specialized tool targets a distinct visual content type (UI, text, errors, diagrams, charts, UI comparison), and the general analyze_image explicitly serves as a fallback for anything not covered. The routing guidelines in the descriptions prevent overlap and misselection.
All tools follow a consistent snake_case convention with action-oriented verbs (extract, diagnose, understand, analyze) followed by their target. Minor deviations: ui_to_artifact and ui_diff_check use compound phrases rather than a strict verb_noun form, but the pattern remains readable.
Eight tools provide a well-scoped set for a vision-language server: five specialized analyzers, one comparison tool, one general fallback, and one video tool. This falls comfortably within the ideal range and every tool addresses a meaningful use case.
The tool set covers the full spectrum of VLM analysis needs: UI, text, errors, diagrams, data visualizations, UI differences, general images, and videos. The fallback analyze_image ensures no input type falls through, making the surface complete.
Maintenance
Related MCP Connectors
MCP server for Wan AI video generation
MCP server for Google Veo AI video generation
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for analyzing images using OpenRouter vision models, offering capabilities like automatic image resizing, model configuration, and handling custom queries about images.11MIT
- AlicenseAqualityDmaintenanceAn MCP server that gives AI agents the ability to observe and understand images via multi-provider vision, object detection, hierarchical analysis, and color extraction.416 npm2MIT
- AlicenseAqualityCmaintenanceAn MCP server that provides image analysis capabilities using vision-capable AI models, including object detection, OCR, scene description, and image comparison.4MIT
- AlicenseAqualityCmaintenanceMCP server that analyzes images, reads code and ZIP archives, and provides text context for non-vision models.312 npm2MIT