vision-mcp-worker
MCP server deployed on Cloudflare Worker that provides AI with image understanding via the describe_image tool, plus an Apple-style model status dashboard.
README
vision-mcp-worker
部署在 Cloudflare Worker 上的 MCP 服务器,给 AI 提供"看图"能力(describe_image 工具),附带一个果味模型状态展示页。
- MCP 端点:
https://<your-domain>/mcp(Streamable HTTP,建议用 Cloudflare Access Service Auth 保护) - 状态页:
https://<your-domain>/(模型与健康状态一览) - 详细接入文档:见 MCP_SETUP.md
- 部署配置模板:见 wrangler.toml.example(真实
wrangler.toml不提交)
模型配置与切换(环境变量)
模型完全通过环境变量配置,不用改代码。 修改后 pnpm run deploy 生效。
1. Workers AI 模型(默认,免费额度)
在 wrangler.toml 的 [vars] 里设置 VISION_MODEL:
[vars]
VISION_MODEL = "@cf/meta/llama-3.2-11b-vision-instruct"
默认回退模型为 Meta Llama 3.2 11B Vision(稳定、抠文字/数字细节强、便宜)。
2. 第三方 OpenAI 兼容模型(可选,优先于 Workers AI)
任意 OpenAI 兼容的视觉模型提供商(OpenAI / DeepSeek / 智谱 / 中转站 / Ollama 等):
[vars]
OPENAI_API_BASE = "https://api.example.com/v1" # 提供商 OpenAI 兼容端点
OPENAI_API_MODEL = "gpt-4o-mini" # 第三方模型名(不填则复用 VISION_MODEL)
# API Key 用 secret 存,不要写进仓库:
npx wrangler secret put OPENAI_API_KEY
优先级:配置了 OPENAI_API_BASE + OPENAI_API_KEY → 走第三方(chat/completions,图片以 image_url 传入);否则走 Workers AI 的 VISION_MODEL。
3. 切换示例
| 想要的效果 | 配置 |
|---|---|
| 用 Workers AI 的 llama(回退默认) | VISION_MODEL 设为 llama,注释掉 OPENAI_API_BASE |
| 用第三方模型 | 设置 OPENAI_API_BASE + OPENAI_API_MODEL + OPENAI_API_KEY |
| 换其他第三方模型 | 改 OPENAI_API_MODEL 即可,不用动代码 |
注意事项
OPENAI_API_KEY是 secret,存于 Cloudflare(wrangler secret),状态页只显示"已配置/未配置"- 第三方中转若不稳定,健康检查会如实显示
DEGRADED,属正常现象 - 多模态模型才能做图片识别;纯文本模型(如
kimi-k2系列)不能用于describe_image
开发
pnpm install # 依赖
pnpm run deploy # 部署到 Cloudflare
pnpm test # 测试
目录
| 文件 | 说明 |
|---|---|
src/index.js |
Worker 入口:MCP 端点 / 状态页 / 健康检查 / 模型路由 |
wrangler.toml.example |
部署配置模板(真实配置见本地 wrangler.toml) |
tools/vision.js |
本地截图识别脚本 |
tools/dashboard-demo.html |
测试页(仪表盘) |
MCP_SETUP.md |
完整接入与排障文档 |
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.