GLM Vision MCP
Supports using Ollama's local vision models as a custom endpoint via VISION_BASE_URL for image analysis and visual reasoning tasks.
Provides integration with OpenAI's vision-capable models (e.g., gpt-4o) for image understanding, including image description, text extraction, chart analysis, and visual question answering.
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., "@GLM Vision MCP Extract text from this screenshot"
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.
GLM Vision MCP
How It Works
┌─────────────────────────────────────────────────────────┐
│ Your IDE / Agent │
│ │
│ Text-only model (e.g. DeepSeek-R1) │
│ │ │
│ │ "What's in this screenshot?" │
│ ▼ │
│ MCP Tool: see_image(path, question) │
│ │ │
│ ▼ (stdio / MCP protocol) │
│ ┌──────────────────────────────────────────────────┐ │
│ │ GLM Vision MCP Server │ │
│ │ │ │
│ │ Reads image → base64 → sends to vision model │ │
│ │ (GLM-4.6V-Flash / GPT-4o / any VLM) │ │
│ │ │ │
│ │ Returns: "A login error dialog showing..." │ │
│ └──────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ Text-only model continues reasoning with vision data │
└─────────────────────────────────────────────────────────┘You configure 3 things: model provider, model ID, and API key. The server handles everything else — image reading, base64 encoding, API calls, error handling.
Related MCP server: vision-mcp
Quick Start
1. Install
# From PyPI (once published) or from source:
pip install -e .Or use directly with uv / pipx without installing:
# Using uv (recommended for MCP)
uv run glm-vision-mcp2. Configure
The server reads configuration from environment variables:
Variable | Required | Default | Description |
| ✅ Yes | — | Your model provider's API key |
| ✅ Yes |
| The vision model to use |
| ✅ Yes |
| Provider name (see table below) |
| ❌ No | provider default | Custom API base URL |
| ❌ No |
| Max response tokens |
| ❌ No |
| Sampling temperature |
3. Add to Your IDE
Cursor
Add to ~/.cursor/mcp.json (or .cursor/mcp.json in your project):
{
"mcpServers": {
"glm-vision": {
"command": "python",
"args": ["-m", "glm_vision_mcp"],
"env": {
"VISION_MODEL_PROVIDER": "zhipu",
"VISION_MODEL_ID": "glm-4.6v-flash",
"VISION_API_KEY": "your-zhipu-api-key-here"
}
}
}
}Trae CN
Add to Trae's MCP settings (设置 → MCP):
{
"mcpServers": {
"glm-vision": {
"command": "python",
"args": ["-m", "glm_vision_mcp"],
"env": {
"VISION_MODEL_PROVIDER": "zhipu",
"VISION_MODEL_ID": "glm-4.6v-flash",
"VISION_API_KEY": "your-zhipu-api-key-here"
}
}
}
}Cline (VS Code)
Add to ~/.cline/mcp_settings.json:
{
"mcpServers": {
"glm-vision": {
"command": "python",
"args": ["-m", "glm_vision_mcp"],
"env": {
"VISION_MODEL_PROVIDER": "zhipu",
"VISION_MODEL_ID": "glm-4.6v-flash",
"VISION_API_KEY": "your-zhipu-api-key-here"
},
"disabled": false,
"autoApprove": []
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"glm-vision": {
"command": "python",
"args": ["-m", "glm_vision_mcp"],
"env": {
"VISION_MODEL_PROVIDER": "zhipu",
"VISION_MODEL_ID": "glm-4.6v-flash",
"VISION_API_KEY": "your-zhipu-api-key-here"
}
}
}
}Generic MCP Client (any MCP-compatible tool)
{
"mcpServers": {
"glm-vision": {
"command": "python",
"args": ["-m", "glm_vision_mcp"],
"env": {
"VISION_MODEL_PROVIDER": "zhipu",
"VISION_MODEL_ID": "glm-4.6v-flash",
"VISION_API_KEY": "your-api-key"
}
}
}
}Tip: If you installed via
uv, use"command": "uv"and"args": ["run", "glm-vision-mcp"]instead.
Supported Providers
Provider |
| Default Base URL | Example Models |
Zhipu (智谱) |
|
|
|
OpenAI |
|
|
|
DeepSeek |
|
|
|
Moonshot (Kimi) |
|
|
|
SiliconFlow |
|
|
|
Custom |
| (you set | Any OpenAI-compatible VLM |
Using a Custom Endpoint
Set VISION_BASE_URL to point to your own server (vLLM, Ollama, LM Studio, etc.):
{
"env": {
"VISION_MODEL_PROVIDER": "custom",
"VISION_MODEL_ID": "your-model-name",
"VISION_API_KEY": "any-or-empty",
"VISION_BASE_URL": "http://localhost:8000/v1"
}
}Tools
The server exposes 4 tools. Your IDE's agent will automatically call them when it needs vision:
see_image — Core Vision Tool
Ask any question about an image.
see_image(image, question="What is in this image?")image: File path, URL, or base64 string
question: What you want to know (default: "What is in this image?")
describe_image — Image Description
Generate a text description/caption.
describe_image(image, detail_level="detailed")detail_level:
"brief"|"detailed"|"exhaustive"(default:"detailed")
extract_text — OCR
Extract all visible text from an image.
extract_text(image, language_hint="Chinese")language_hint: Optional — e.g.
"Chinese","English","mixed"
analyze_chart — Chart & Diagram Analysis
Analyze charts, graphs, architecture diagrams, or UI screenshots.
analyze_chart(image, question="")question: Optional specific question (default: general analysis)
Usage Example
Once configured, just talk to your IDE's agent normally:
You: "Look at the screenshot at
/tmp/error.png— what's wrong?"
The agent will:
Call
see_image("/tmp/error.png", "What error is shown?")The MCP server sends the image to GLM-4.6V-Flash
GLM returns: "The dialog shows a 'Connection Refused' error..."
Your text-only model uses that answer to help you
Getting an API Key
Zhipu (智谱) — Free Tier Available
Visit https://open.bigmodel.cn
Sign up / log in
Go to API Keys → Create new key
Copy the key (format:
xxxxxxxx.xxxxxxxx)
GLM-4.6V-Flash offers free quota — great for testing!
OpenAI
Create a new key
Development
Project Structure
glm-vision-mcp/
├── src/glm_vision_mcp/
│ ├── __init__.py
│ ├── __main__.py # python -m glm_vision_mcp
│ ├── server.py # MCP server + tool definitions
│ ├── config.py # Env-var config loader
│ ├── utils.py # Image encoding utilities
│ └── providers/
│ ├── base.py # VisionProvider (shared HTTP logic)
│ ├── zhipu.py # Zhipu GLM provider
│ ├── openai_compat.py # Generic OpenAI-compatible provider
│ └── registry.py # Provider name → class mapping
├── examples/
│ └── quickstart.py
├── pyproject.toml
├── requirements.txt
└── README.mdRunning Tests
pip install -e ".[dev]"
pytestAdding a New Provider
Create
src/glm_vision_mcp/providers/my_provider.py:
from glm_vision_mcp.providers.base import VisionProvider
class MyProvider(VisionProvider):
def _build_headers(self):
# Custom auth if needed
return {"X-Api-Key": self.config.api_key}Register in
providers/registry.py:
_PROVIDERS["my_provider"] = MyProviderFAQ
Q: Can I use this with a non-vision model? No — the configured model must support vision input (images). If you're unsure, GLM-4.6V-Flash is a good free option.
Q: Does it work with local images? Yes. Pass a file path and the server will read and base64-encode it automatically.
Q: How fast is it? Depends on the model provider. GLM-4.6V-Flash is very fast (typically 1-3 seconds per image).
Q: Can multiple images be analyzed at once?
Currently each tool call handles one image. For multi-image comparison, call see_image multiple times or extend the tools.
License
MIT © 2026 xiayuyang750
Available Tools
4 toolsanalyze_chartA
Analyze a chart, graph, diagram, or UI screenshot.
Specialised for understanding data visualisations, technical diagrams, flowcharts, and UI screenshots where spatial layout and relationships matter.
Args: image: The chart/diagram image (file path, URL, or base64). question: Optional specific question about the chart. If empty, a general analysis is performed.
Returns: A text analysis of the chart or diagram.
Examples: >>> analyze_chart("/tmp/q1_revenue.png") >>> analyze_chart("/tmp/architecture.png", "What are the main components?")
Inputs: image (required), question. Returns: result
describe_imageA
Generate a text description of an image.
Useful when you need a caption, alt text, or a general summary of what an image contains without asking a specific question.
Args:
image: The image to describe (file path, URL, or base64).
detail_level: How detailed the description should be.
Options: "brief", "detailed", "exhaustive".
Default: "detailed".
Returns: A text description of the image.
Examples: >>> describe_image("/tmp/product.jpg") >>> describe_image("https://site.com/scene.png", "brief")
Inputs: image (required), detail_level. Returns: result
extract_textA
Extract (OCR) all visible text from an image.
Ideal for screenshots of documents, code, error messages, or any image where the text content matters more than the visual appearance.
Args:
image: The image containing text (file path, URL, or base64).
language_hint: Optional hint about the text language
(e.g. "Chinese", "English", "mixed").
Helps the model focus on the right character set.
Returns: All text found in the image, preserving layout where possible.
Examples: >>> extract_text("/tmp/error_screenshot.png") >>> extract_text("/tmp/receipt.jpg", "Chinese")
Inputs: image (required), language_hint. Returns: result
see_imageA
Look at an image and answer a question about it.
This is the core vision tool. Use it whenever you need to understand, describe, or reason about visual content that you cannot see.
Args:
image: The image to analyze. Accepts:
- A local file path (e.g. /home/user/photo.jpg)
- An HTTP(S) URL (e.g. https://example.com/img.png)
- A base64-encoded string (with or without data-URI prefix)
question: What you want to know about the image.
Default: "What is in this image?"
Returns: The vision model's answer as plain text.
Examples: >>> see_image("/tmp/screenshot.png", "What error is shown in this dialog?") >>> see_image("https://example.com/chart.png", "What's the trend?") >>> see_image("iVBORw0KGgo...", "Is this a cat or a dog?")
Inputs: image (required), question. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Most tools have distinct purposes: see_image for Q&A, extract_text for OCR, analyze_chart for charts/diagrams, and describe_image for general descriptions. However, see_image and describe_image overlap somewhat, as see_image with a default question essentially generates a description. The descriptions help clarify intent, so the ambiguity is limited.
All tool names follow a consistent verb_noun pattern in lowercase with underscores: see_image, extract_text, analyze_chart, describe_image. This makes the API predictable and easy to navigate.
With 4 tools, the server is well-scoped for a vision MCP. Each tool covers a distinct core capability (Q&A, OCR, chart analysis, description) without unnecessary bloat. The count is appropriate for the domain.
The tool surface covers the major vision use cases: answering questions, extracting text, analyzing charts, and generating descriptions. Minor gaps exist, such as no explicit image comparison or object detection, but these are not core for a generic vision server. Overall, the coverage is solid with no dead ends.
Maintenance
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models and 10 tools: up to 4 images per call, SVG vectorization, editing and more. Remote MCP with OAuth, no API keys. Pay per image, no subscription.
Stateless agentic tools over MCP: concept extraction, long-context, knowledge graph, planning.
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables non-multimodal models to see images by providing MCP tools for image understanding and OCR, backed by any OpenAI-compatible vision model.2MIT
- AlicenseNot gradedqualityNot gradedmaintenanceAdds image recognition and UI grounding capabilities to text-only LLMs through MCP tools, supporting local and cloud vision backends.MIT
- AlicenseAqualityDmaintenanceVision MCP enables text-only agents to understand images through any OpenAI-compatible vision model. It supports local images, URLs, screenshots, documents, charts, and code errors with tools like analyze_image and understand_image.2MIT
- AlicenseNot gradedqualityCmaintenanceAdds vision capabilities to text-only coding models via MCP, enabling image analysis, OCR, and visual reasoning without switching the main model.1Apache 2.0