Skip to main content
Glama
README.md
<div align="center">

# ๐Ÿ‘๏ธ Vision MCP Server

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-339933.svg)](https://nodejs.org/)
[![MCP](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io/)

**Give your AI agent eyes.** An MCP server providing multimodal vision capabilities โ€” image analysis, OCR, image comparison, and video analysis โ€” powered by any OpenAI-compatible vision model.

**่ฎฉไฝ ็š„ AI ไปฃ็†ๆ‹ฅๆœ‰่ง†่ง‰่ƒฝๅŠ›ใ€‚** ้€š่ฟ‡ไปปไฝ• OpenAI ๅ…ผๅฎน็š„่ง†่ง‰ๆจกๅž‹๏ผŒๆไพ›ๅ›พๅƒๅˆ†ๆžใ€OCR ๆ–‡ๅญ—่ฏ†ๅˆซใ€ๅ›พๅƒๅฏนๆฏ”ๅ’Œ่ง†้ข‘ๅˆ†ๆžใ€‚

[Features](#-features) ยท [Quick Start](#-quick-start) ยท [Tools](#๏ธ-tools-reference) ยท [Models](#-supported-models) ยท [ไธญๆ–‡่ฏดๆ˜Ž](#-ไธญๆ–‡่ฏดๆ˜Ž)

</div>

---

## โœจ Features

| Tool | Description |
|------|-------------|
| ๐Ÿ” `analyze_image` | Analyze images with natural language prompts |
| ๐Ÿ“ `ocr_image` | Extract text from images (plain text / Markdown / JSON) |
| ๐Ÿ”€ `compare_images` | Compare 2โ€“4 images side by side |
| ๐ŸŽฌ `analyze_video` | Analyze video content (requires video-capable model) |

**Plus:**
- ๐ŸŒ **OpenAI-compatible** โ€” Works with any vision model via standard API
- ๐Ÿ“ **Local files & URLs** โ€” Auto-converts local files to base64
- โš™๏ธ **Configurable** โ€” Environment variables, config files, or both

## ๐Ÿš€ Quick Start

### 1. Install

```bash
git clone https://github.com/Loveacup/vision-mcp-server.git
cd vision-mcp-server
npm install && npm run build
```

### 2. Configure

Create a `.env` file in the project root:

```bash
VISION_BASE_URL=http://your-server:port/v1/chat/completions
VISION_MODEL=Qwen3-VL-32B
VISION_API_KEY=your-api-key    # optional for local models
```

<details>
<summary>๐Ÿ“„ Or use <code>config.json</code></summary>

```json
{
  "baseUrl": "http://your-server:port/v1/chat/completions",
  "model": "Qwen3-VL-32B",
  "apiKey": "your-api-key",
  "maxTokens": 4096,
  "temperature": 0.7
}
```

</details>

### 3. Run

```bash
npm start
```

The server communicates over stdio, designed to be launched by an MCP client such as Claude Code.

## ๐Ÿ”Œ Claude Code Integration

Add to your `~/.mcp.json`:

```json
{
  "mcpServers": {
    "vision": {
      "command": "node",
      "args": ["/path/to/vision-mcp-server/dist/index.js"],
      "env": {
        "VISION_BASE_URL": "http://your-server:port/v1/chat/completions",
        "VISION_MODEL": "Qwen3-VL-32B",
        "VISION_API_KEY": "your-api-key"
      }
    }
  }
}
```

> Replace `/path/to/vision-mcp-server` with the actual install path.

## โš™๏ธ Configuration Reference

Configuration priority: **environment variables > config file > defaults**

| Variable | Config Key | Default | Description |
|---|---|---|---|
| `VISION_BASE_URL` | `baseUrl` | *(required)* | OpenAI-compatible chat completions endpoint |
| `VISION_MODEL` | `model` | `Qwen3-VL-32B` | Model name |
| `VISION_API_KEY` | `apiKey` | *(empty)* | API key (optional for local models) |
| `VISION_MAX_TOKENS` | `maxTokens` | `4096` | Max response tokens |
| `VISION_TEMPERATURE` | `temperature` | `0.7` | Sampling temperature |

## ๐Ÿ› ๏ธ Tools Reference

### `analyze_image`

Analyze an image with a vision language model.

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `image` | string | โœ… | โ€” | Local file path or URL |
| `prompt` | string | | `"Describe this image in detail."` | Analysis prompt |
| `detail` | `"low"` \| `"high"` \| `"auto"` | | `"auto"` | Detail level |

### `ocr_image`

Extract text from an image using OCR.

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `image` | string | โœ… | โ€” | Local file path or URL |
| `languages` | string | | `""` | Language hint, e.g. `"zh,en"` |
| `format` | `"plain"` \| `"markdown"` \| `"json"` | | `"plain"` | Output format |

### `compare_images`

Compare 2โ€“4 images and describe differences/similarities.

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `images` | string[] | โœ… | โ€” | 2โ€“4 image sources |
| `prompt` | string | | `"Compare these images..."` | Comparison prompt |

### `analyze_video`

Analyze video content. Requires a model with video support (e.g., Qwen3-VL).

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `video` | string | โœ… | โ€” | Local file path or URL |
| `prompt` | string | | `"Describe what happens in this video."` | Analysis prompt |

## ๐Ÿค– Supported Models

| Model | Provider | Image | Video | Notes |
|---|---|:---:|:---:|---|
| **Qwen3-VL** | Self-hosted / API | โœ… | โœ… | Recommended. Full multimodal support |
| **GPT-4o** | OpenAI | โœ… | โŒ | Strong image analysis |
| **LLaVA** | Self-hosted | โœ… | โŒ | Open-source alternative |
| **InternVL** | Self-hosted | โœ… | โš ๏ธ | Strong multilingual OCR |

Any model served via vLLM, Ollama, LMDeploy, or other OpenAI-compatible servers should work.

**Supported formats:** JPEG, PNG, GIF, WebP, BMP, SVG | MP4, AVI, MOV, MKV, WebM

## ๐Ÿ“ Project Structure

```
vision-mcp-server/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts              # MCP server entry point
โ”‚   โ”œโ”€โ”€ config.ts             # Configuration loader
โ”‚   โ”œโ”€โ”€ types.ts              # TypeScript type definitions
โ”‚   โ”œโ”€โ”€ tools/
โ”‚   โ”‚   โ”œโ”€โ”€ analyze-image.ts
โ”‚   โ”‚   โ”œโ”€โ”€ ocr-image.ts
โ”‚   โ”‚   โ”œโ”€โ”€ compare-images.ts
โ”‚   โ”‚   โ””โ”€โ”€ analyze-video.ts
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ api-client.ts     # OpenAI-compatible API client
โ”‚       โ””โ”€โ”€ file-handler.ts   # Local file โ†’ base64
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ .env.example
โ””โ”€โ”€ LICENSE
```

## ๐Ÿ“„ License

[MIT](LICENSE)

---

## ๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡่ฏดๆ˜Ž

### ๅŠŸ่ƒฝ

- **`analyze_image`** โ€” ไฝฟ็”จ่ง†่ง‰่ฏญ่จ€ๆจกๅž‹ๅˆ†ๆžๅ›พๅƒ๏ผŒๆ”ฏๆŒ่‡ช็„ถ่ฏญ่จ€ๆ้—ฎ
- **`ocr_image`** โ€” OCR ๆ–‡ๅญ—่ฏ†ๅˆซ๏ผŒๆ”ฏๆŒ็บฏๆ–‡ๆœฌใ€Markdownใ€JSON ่พ“ๅ‡บ
- **`compare_images`** โ€” ๅฏนๆฏ” 2โ€“4 ๅผ ๅ›พๅƒ๏ผŒ่ฏ†ๅˆซๅทฎๅผ‚ๅ’Œ็›ธไผผไน‹ๅค„
- **`analyze_video`** โ€” ๅˆ†ๆž่ง†้ข‘ๅ†…ๅฎน๏ผˆ้œ€่ฆ Qwen3-VL ็ญ‰ๆ”ฏๆŒ่ง†้ข‘็š„ๆจกๅž‹๏ผ‰

### ๅฟซ้€Ÿๅผ€ๅง‹

```bash
git clone https://github.com/Loveacup/vision-mcp-server.git
cd vision-mcp-server
npm install && npm run build
```

้…็ฝฎ `.env`๏ผš

```bash
VISION_BASE_URL=http://your-server:port/v1/chat/completions
VISION_MODEL=Qwen3-VL-32B
VISION_API_KEY=your-api-key
```

ๅœจ Claude Code ็š„ `~/.mcp.json` ไธญๆทปๅŠ ๏ผš

```json
{
  "mcpServers": {
    "vision": {
      "command": "node",
      "args": ["/path/to/vision-mcp-server/dist/index.js"],
      "env": {
        "VISION_BASE_URL": "http://your-server:port/v1/chat/completions",
        "VISION_MODEL": "Qwen3-VL-32B",
        "VISION_API_KEY": "your-api-key"
      }
    }
  }
}
```

ๅฐ† `/path/to/vision-mcp-server` ๆ›ฟๆขไธบๅฎž้™…ๅฎ‰่ฃ…่ทฏๅพ„ใ€‚

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct task: image content analysis, video analysis, image comparison, and text extraction. There is no overlap in purpose, making selection clear.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (analyze_image, analyze_video, compare_images, ocr_image), with no mixing of styles.

Tool Count4/5

With 4 tools, the set is focused and not overwhelming. It covers core vision tasks, though a few more (e.g., image generation) could be added for broader scope.

Completeness4/5

The tools cover image/video analysis, OCR, and comparison. Minor gaps exist (e.g., image metadata extraction), but the surface is sufficient for common vision use cases.

Maintenance

ActivityInactive
ResponsivenessUnresponsive