Labsco
stabgan logo

openrouter-mcp-multimodal

โ˜… 52

from stabgan

MCP server for OpenRouter: 300+ LLMs with vision, image gen, audio in/out, and video analysis + generation (Veo 3.1 / Sora 2 Pro / Seedance / Wan). Structured errors, IPv6 SSRF guards, path sandbox.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredNeeds API keys

OpenRouter MCP Multimodal โ€” MCP server for chat, vision, audio, and video AI tools

OpenRouter MCP Multimodal

The MCP server for multimodal AI agents.
One install ยท 14 tools ยท 300+ OpenRouter models ยท text, vision, audio & video โ€” analysis and generation.

npm downloads

Smithery MCP registry

Quick start ยท Tools ยท Examples ยท Security ยท Development ยท FAQ


What is this?

OpenRouter MCP Multimodal is a production-grade Model Context Protocol (MCP) server โ€” listed on the official MCP Registry as io.github.stabgan/openrouter-multimodal. It connects AI coding agents (Cursor, Claude Desktop, VS Code, Windsurf, Cline, and others) to OpenRouter's unified LLM API over stdio.

Unlike text-only MCP servers, one install covers the full multimodal surface:

CapabilityToolsHighlights
Chatchat_completion300+ models, :nitro / :exacto suffixes, provider routing, web search, response caching, reasoning tokens
Visionanalyze_image, generate_imageOCR, captioning, VQA, image generation with reference inputs
Audioanalyze_audio, generate_audioTranscription, speech/music generation
Videoanalyze_video, generate_video, generate_video_from_image, get_video_statusClip understanding, Veo / Sora / Seedance / Wan generation with progress notifications
Catalogsearch_models, get_model_info, validate_model, rerank_documents, health_checkModel discovery, validation, reranking, ops health

Production hardening: input/output path sandboxes (including analyze_* local files as of v4.5.2), SSRF guards, structured errors with _meta.code, MCP 2025-06-18 structured outputs, async video progress notifications, and 650+ automated tests (unit, mock, regression, and live integration).

Why this server?

CapabilityThis serverTypical MCP LLM servers
Text chat (300+ models)โœ…โœ…
Image analysis + generationโœ…partial
Audio analysis + TTSโœ…โŒ
Video analysis + generationโœ…โŒ
Model search / validate / rerankโœ…โŒ
Path sandbox + SSRF protectionโœ…rare
MCP 2025 structured outputsโœ…rare
Async video + progress notificationsโœ…โŒ

Tools

14 MCP tools. Each description includes Use when, Good/Bad examples, Fails when, and Works with so agents pick the right tool and recover from errors.

ToolPurpose
chat_completionText chat, web search, provider routing, caching, reasoning
analyze_imageVision โ€” local path, URL, or data URL + question
analyze_audioTranscribe / analyze audio files
analyze_videoDescribe / Q&A over video files
generate_imageText-to-image with optional reference images
generate_audioText-to-speech / music
generate_videoText-to-video (async, resumable)
generate_video_from_imageImage-to-video (narrower schema)
get_video_statusPoll / resume video jobs
search_modelsPaginated model catalog search
get_model_infoPricing, context, modalities
validate_modelCheap model ID existence check
rerank_documentsRelevance ranking for RAG
health_checkAPI key + reachability probe

Errors use a closed _meta.code taxonomy: INVALID_INPUT ยท UNSAFE_PATH ยท UPSTREAM_* ยท MODEL_NOT_FOUND ยท JOB_STILL_RUNNING ยท and more.

Examples

Chat (free model)

{
  "tool": "chat_completion",
  "arguments": {
    "model": "google/gemma-4-26b-a4b-it:free",
    "messages": [{ "role": "user", "content": "Summarize MCP in one sentence." }]
  }
}

Analyze an image

{
  "tool": "analyze_image",
  "arguments": {
    "image_path": "diagram.png",
    "question": "List every label in this diagram."
  }
}

Use image_path and question โ€” not image / prompt.

Search models (vision + free)

{
  "tool": "search_models",
  "arguments": {
    "query": "gemma",
    "capabilities": { "vision": true },
    "limit": 10,
    "offset": 0
  }
}

Generate video (async)

{
  "tool": "generate_video",
  "arguments": {
    "model": "google/veo-3.1",
    "prompt": "Ocean waves at sunrise, cinematic drone shot",
    "duration": 4,
    "save_path": "river.mp4"
  }
}

If the job is still running when max_wait_ms elapses, the response succeeds with _meta.code: JOB_STILL_RUNNING and a video_id โ€” call get_video_status to resume. This is not an error.

More examples: docs/plans/tool-description-improvement.md

Security

  • Input path sandbox โ€” analyze_* and reference images must stay inside OPENROUTER_INPUT_DIR
  • Output path sandbox โ€” save_path must stay inside OPENROUTER_OUTPUT_DIR
  • SSRF protection โ€” private/reserved IPs blocked on URL fetches
  • Untrusted content โ€” analyze outputs tagged _meta.content_is_untrusted: true

Override sandboxes only with OPENROUTER_ALLOW_UNSAFE_PATHS=1 (discouraged).

Development

git clone https://github.com/stabgan/openrouter-mcp-multimodal.git
cd openrouter-mcp-multimodal
npm install
cp .env.example .env   # add OPENROUTER_API_KEY
npm run build

Testing

CommandWhat it runs
npm test652 unit + mock tests (no API key, <2s)
npm run test:regressionSecurity + schema regression guards
npm run test:integration16 live OpenRouter scenarios (requires .env key)
npm run test:e2eFull MCP stdio smoke (scripts/live-e2e.mjs)
npm run cilint + format + build + all of the above except e2e

Free models for CI / zero-credit accounts: integration tests default to google/gemma-4-26b-a4b-it:free (override with OPENROUTER_INTEGRATION_MODEL). GitHub Actions requires the OPENROUTER_API_KEY repository secret.

Mock tests live under src/__tests__/mock/ and cover handlers, path sandboxes, SSRF blocks, model-cache pagination, tool descriptions, and structured outputs โ€” 330+ additional cases beyond the core suite.

npm run lint
npm run format:check

Compatibility

Works with any MCP client. Protocol: MCP 2025-06-18. Node โ‰ฅ 20 (Docker image uses Node 22).