MCP server for image recognition via Kimi/Moonshot vision API. Works with Claude Code.
Project description
MCP Vision Server · 视觉识别服务
基于 Kimi/Moonshot 视觉 API 的 MCP 服务器,作为 Claude Code 全局插件使用。传入本地图片路径,返回 AI 对图片内容的详细描述、文字提取等。
MCP server for image recognition via Kimi/Moonshot vision API. Works as a global Claude Code plugin.
中文
功能
- describe_image — 识别图片内容,返回文字描述
- describe_image_to_file — 识别并保存为 UTF-8 文件(解决 Windows 终端中文乱码)
- 支持 PNG / JPG / GIF / WebP / BMP,最大 20MB
- 支持自定义提示词(如"提取所有文字""描述图表结构")
安装
pip install mcp-vision-server
或从源码安装:
git clone https://github.com/coffe-d/MCP-Vision-Server.git
cd mcp-vision-server
pip install -e .
获取 API Key
在 Moonshot 开放平台 注册并创建 API Key。
注册到 Claude Code
claude mcp add vision-server \
--env KIMI_API_KEY="sk-你的密钥" \
-- mcp-vision-server
注册后 Claude Code 即可使用 describe_image 和 describe_image_to_file 两个工具。
配置
| 环境变量 | 必填 | 默认值 | 说明 |
|---|---|---|---|
KIMI_API_KEY |
是 | — | Moonshot API 密钥 |
KIMI_BASE_URL |
否 | https://api.moonshot.cn/v1 |
API 地址 |
KIMI_MODEL |
否 | moonshot-v1-8k-vision-preview |
模型名称 |
工具说明
describe_image — 识别图片,返回文本描述。
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
image_path |
string | 是 | — | 图片绝对路径 |
prompt |
string | 否 | — | 自定义提示词 |
max_tokens |
int | 否 | 4096 | 最大输出长度 |
describe_image_to_file — 识别图片,结果保存为 UTF-8 文件。适合中文环境避免终端乱码。
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
image_path |
string | 是 | — | 图片绝对路径 |
output_path |
string | 否 | 自动(同名 .md) | 输出文件路径 |
常见问题
"KIMI_API_KEY environment variable is not set"
未设置环境变量。注册时确保使用了 --env KIMI_API_KEY="sk-..."。
终端中文乱码
使用 describe_image_to_file 代替 describe_image,结果直接写入 UTF-8 文件。
"不支持的图片格式"
仅支持 PNG、JPG、JPEG、GIF、WebP、BMP 格式。
许可
MIT — 详见 LICENSE。
English
Features
- describe_image — Recognize image content and return text description
- describe_image_to_file — Recognize and save result to a UTF-8 file
- Supports PNG / JPG / GIF / WebP / BMP up to 20MB
- Customizable prompt for targeted extraction
Install
pip install mcp-vision-server
Or from source:
git clone https://github.com/coffe-d/MCP-Vision-Server.git
cd mcp-vision-server
pip install -e .
Get an API key
Sign up at Moonshot Platform and create an API key.
Register with Claude Code
claude mcp add vision-server \
--env KIMI_API_KEY="sk-your-key-here" \
-- mcp-vision-server
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
KIMI_API_KEY |
Yes | — | Moonshot API key |
KIMI_BASE_URL |
No | https://api.moonshot.cn/v1 |
API base URL |
KIMI_MODEL |
No | moonshot-v1-8k-vision-preview |
Model name |
API Reference
describe_image — Return image description as text.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image_path |
string | Yes | — | Absolute path to image |
prompt |
string | No | — | Custom prompt |
max_tokens |
int | No | 4096 | Max output tokens |
describe_image_to_file — Save result to a UTF-8 file.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image_path |
string | Yes | — | Absolute path to image |
output_path |
string | No | auto (.md) | Output file path |
Troubleshooting
"KIMI_API_KEY environment variable is not set" — Make sure you passed --env KIMI_API_KEY="sk-..." when running claude mcp add.
Garbled Chinese in terminal — Use describe_image_to_file to write directly to UTF-8 file.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_vision_server-0.1.0.tar.gz.
File metadata
- Download URL: mcp_vision_server-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85c499758c6e383eee41e5ad2acb5ad93d1dd911471f3140cae8df3d1af3c66b
|
|
| MD5 |
a72a0a29c20cb8e6839145c8cd5f1c0b
|
|
| BLAKE2b-256 |
4c563dd31051ba27986538e16dd13cbc09e877c1f1145a886dbb0d279a2feebe
|
Provenance
The following attestation bundles were made for mcp_vision_server-0.1.0.tar.gz:
Publisher:
publish.yml on coffe-d/MCP-Vision-Server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_vision_server-0.1.0.tar.gz -
Subject digest:
85c499758c6e383eee41e5ad2acb5ad93d1dd911471f3140cae8df3d1af3c66b - Sigstore transparency entry: 1546899256
- Sigstore integration time:
-
Permalink:
coffe-d/MCP-Vision-Server@504269ca4430e915e01574e8803e119bbfd32c4b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/coffe-d
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@504269ca4430e915e01574e8803e119bbfd32c4b -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_vision_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_vision_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
812d9b3d77dce69ab3543eb394b3c8722e091d7b8ab38dff315e85a741047970
|
|
| MD5 |
e5d11b99dc155dc91ed5215843a3b0ee
|
|
| BLAKE2b-256 |
9a5167a59c954ad939c93ed72b12256db84c3ad425083b75968774a81d1b435b
|
Provenance
The following attestation bundles were made for mcp_vision_server-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on coffe-d/MCP-Vision-Server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_vision_server-0.1.0-py3-none-any.whl -
Subject digest:
812d9b3d77dce69ab3543eb394b3c8722e091d7b8ab38dff315e85a741047970 - Sigstore transparency entry: 1546899265
- Sigstore integration time:
-
Permalink:
coffe-d/MCP-Vision-Server@504269ca4430e915e01574e8803e119bbfd32c4b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/coffe-d
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@504269ca4430e915e01574e8803e119bbfd32c4b -
Trigger Event:
release
-
Statement type: