Skip to main content

MCP server that lets text-only models 'see' images via configurable vision LLM providers with priority fallback

Project description

mcp-recognize-image

An MCP (Model Context Protocol) server that gives text-only models the ability to "see" images. It routes image-recognition requests through configurable multimodal (vision) LLM providers, with priority-ordered automatic fallback: if the top provider fails (auth / rate-limit / error / timeout), the next is tried.

Install (end users)

uvx mcp-recognize-image

Install uv first if needed:

curl -LsSf https://astral.sh/uv/install.sh | sh

Or with pip:

pip install mcp-recognize-image

Configure

Works out of the box with the bundled default providers (free vision endpoints pre-filled). You only need to set API keys for the providers you have:

export GEMINI_API_KEY=...         # free tier: https://aistudio.google.com
export SILICONFLOW_API_KEY=...    # free tier: https://cloud.siliconflow.cn
export OPENROUTER_API_KEY=...     # free models: https://openrouter.ai

Custom endpoint (zero config file)

Point it at any OpenAI-compatible endpoint (OpenAI, Azure OpenAI, Ollama, LM Studio, DeepSeek, Moonshot, …) with three env vars — no config file needed. The API key lives in the env (never on disk):

export VISION_BASE_URL="https://api.openai.com/v1"
export VISION_API_KEY="sk-..."
export VISION_MODEL="gpt-4o"
# optional: VISION_ADAPTER (openai_compat|gemini|anthropic, default openai_compat)
# optional: VISION_PRIORITY (default 0 = tried first)

With these set and no config file, only this custom provider is used. In an MCP client config, put the same vars in the env block.

Config path resolution (only if you customize the provider list):

  1. VISION_MCP_CONFIG env var (absolute path)
  2. ~/.config/vision-mcp/config.toml
  3. bundled config.example.toml (fallback — used by default)

To customize the provider list, copy the bundled example and edit (from a source checkout):

mkdir -p ~/.config/vision-mcp
cp src/vision_mcp/config.example.toml ~/.config/vision-mcp/config.toml

Free vision models rotate. Re-verify with (from a source checkout):

python scripts/verify_free_models.py              # OpenRouter list is public
SILICONFLOW_API_KEY=... python scripts/verify_free_models.py
GEMINI_API_KEY=... python scripts/verify_free_models.py

Use with Claude Desktop / Cursor / Cline

Add to your MCP client config (Claude Desktop: claude_desktop_config.json).

With uvx (recommended, zero install):

{
  "mcpServers": {
    "vision": {
      "command": "uvx",
      "args": ["mcp-recognize-image"],
      "env": { "GEMINI_API_KEY": "..." }
    }
  }
}

With a local install:

{
  "mcpServers": {
    "vision": {
      "command": "mcp-recognize-image",
      "env": { "GEMINI_API_KEY": "..." }
    }
  }
}

The tool

recognize_image(image, prompt="Describe this image in detail.")image is a local file path, an http(s) URL, or a data: URI. Returns the model's text answer, or an Error: ... string if every provider failed.

Adapters

adapter providers
openai_compat OpenAI, SiliconFlow, OpenRouter, any OpenAI-compatible endpoint
gemini Google Gemini (native API)
anthropic Anthropic Claude (native API)

Develop

git clone <repo>
cd mcp-recognize-image
uv venv --python 3.13 .venv
uv pip install -e ".[dev]"
pytest -q

Publish (maintainer)

uv build      # builds wheel + sdist into dist/
uv publish    # uploads to PyPI (set PYPI_TOKEN env or pass --token)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_recognize_image-0.1.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_recognize_image-0.1.1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_recognize_image-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_recognize_image-0.1.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_recognize_image-0.1.1.tar.gz
Algorithm Hash digest
SHA256 85e9278a544cc2e8ea62c4d986990a254d12b1329f55ef886e59e3349d373fc7
MD5 927166b58bf2e83adf812cff58d67e08
BLAKE2b-256 3e4e7a38f50b0617820c2ed1c9f9ed79897ddb509cb7d7373c81c632bfdec5a0

See more details on using hashes here.

File details

Details for the file mcp_recognize_image-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_recognize_image-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_recognize_image-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd64325129fe3f5e7a93f5bc7cf553d92bfb4809ad509863d750e919316024b9
MD5 2106294af5ffa7e8ce46afae2574ab09
BLAKE2b-256 b7cdc596d25dd470f909c6a220cbfd32edca3fac0bba9d974dadc77b8b91f7d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page