
Openrouter Multimodal
io.github.stabganPublished by GitHub account stabganv4.5.1Updated Nov 3, 2026
Chat with 300+ LLMs via OpenRouter. Analyze and generate images, audio, and video from MCP.
Overview
Connects an assistant to OpenRouter's unified API for chat with 300+ models plus image, audio and video analysis and generation.
- What you can do
- Chat with 300+ models, including async jobs, structured output, web search and provider routing
- Analyze images, audio and video files, and generate images, speech, music and video clips
- Transcribe audio and convert text to speech with dedicated speech tools
- Create vector embeddings, rerank documents and get structured yes/no or scored decisions
- Search, inspect and validate models in the OpenRouter catalog, and check API health
- When to use it
- Useful when an assistant should reach many different LLMs through one key, or needs multimodal work such as reading a diagram, transcribing a recording, or producing an image, voice clip or short video without separate integrations.
- Requirements
- Runs locally over stdio via npx (Node.js 22+) or a Docker image; a Python launcher also needs Node installed. Requires an OpenRouter API key in OPENROUTER_API_KEY and network access to OpenRouter. Optional variables set the default model, output directory, caching, reasoning passthrough and provider routing.
Installation
In SourceWeft
- Open Openrouter Multimodal in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
[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 · 21 tools · 300+ OpenRouter models · text, vision, audio & video — analysis and generation.
[npm version] [PyPI version] [GitHub release] [Docker version] [CI status] [Apache 2.0 license] [Node.js 22+]
[npm downloads] [Docker pulls] [MCP Registry] [Smithery MCP registry]
Quick start · Tools · Examples · Security · Troubleshooting · Development · Releasing · 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:
Production hardening: input/output path sandboxes (including analyze_* local files as of v4.5.2), SSRF guards, structured errors with _meta.code, MCP 2025-11-25 structured outputs + tool icons, async video progress notifications, and 3929 automated tests (3905 unit/mock + 7 regression + 17 live integration).
Quick start
1. Get an API key (free tier works) → openrouter.ai/keys
2. Run the server
3. Add to your MCP client — copy one JSON block from Install into your client config:
Use the mcpServers object from Manual config below.
No credits required to start. Free models such as
google/gemma-4-26b-a4b-it:freework for chat and vision. Video/audio generation typically needs credits.
Install
MCP servers are distributed through several packaging models. This server is implemented in Node.js/TypeScript; the table below maps each ecosystem method to how you run it here.
uvx vs npx: In the MCP ecosystem,
npxruns npm (Node) packages anduvxruns PyPI (Python) packages. Because this server is Node-based,uvxuses a thin Python launcher that execsnpx -y @stabgan/openrouter-mcp-multimodal— you still need Node installed.
One-click
Paste your OPENROUTER_API_KEY when prompted — deeplinks use placeholders so secrets never appear in URLs.
Manual config
npx (recommended)
Pin a release: "args": ["-y", "@stabgan/[email protected]"]
uvx / pipx (Python launcher)
Install uv (includes uvx), ensure Node.js 22+ is also on your PATH, then:
pipx equivalent: pipx run mcp-server-openrouter-multimodal
Optional: OPENROUTER_MCP_NPM_VERSION=5.1.3 pins the underlying npm package.
npm global
node (local clone)
Docker
Use -i (interactive stdio). Avoid -t (TTY corrupts MCP framing on some hosts).
GHCR (GitHub Container Registry)
Smithery
Interactive install (writes config for your client):
Listing: smithery.ai/server/@stabgan/openrouter-mcp-multimodal
MCP Registry
Official name: io.github.stabgan/openrouter-multimodal
- Registry: registry.modelcontextprotocol.io
- npm package:
@stabgan/openrouter-mcp-multimodal - OCI image:
docker.io/stabgan/openrouter-mcp-multimodal
Clients that support registry-driven install will offer npm or Docker; otherwise use the JSON blocks above.
Claude Code CLI
Set OPENROUTER_API_KEY in your shell or client env before starting Claude Code.
MCP Inspector
Debug tools/list and tool calls against a live OpenRouter key:
Windows npx
When Claude Desktop or Cursor cannot find npx (GUI apps often miss shell PATH), wrap with cmd:
If still failing, use the full path from where npx as the command.
Why this server?
Tools
21 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.
Every error carries _meta.code from a closed taxonomy (13 codes). Switch on these for programmatic handling:
Errors include _meta.suggestions with agent-oriented next steps when available.
Binary tool results (v4.7.0+)
Generate tools (generate_image, generate_image_dedicated, generate_audio, text_to_speech, generate_video, generate_video_from_image, get_video_status) return image, audio, or video bytes. As of 4.7.0 the behavior is explicit:
Default inline ceilings (override per kind or globally):
If you previously relied on both a saved file and inline media in the same tool result, read the file from _meta.save_path (or omit save_path to get inline media when under the ceiling).
Examples
Chat (free model)
Chat with structured output (JSON Schema)
For simpler JSON without a schema, use
"response_format": { "type": "json_object" }. Add"response_healing": trueto auto-fix malformed JSON.
Analyze an image
Use
image_pathandquestion— notimage/prompt.
Search models (vision + free)
Generate video (async)
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.
With save_path set (as above), the result is a text pointer to the saved file once complete — not inline video. See Binary tool results.
Embed text (vector embeddings)
Returns embedding arrays for RAG, semantic search, or clustering. 37+ models supported — pass a single string or an array of up to 2048 texts.
Structured decision (System One)
Returns calibrated probabilities instead of generated text. Three question types: noul (yes/no), choice (pick one category), score (ordinal rubric). Models: typesafe/jev-1.13 (default), upstage/solar-decide, microsoft/decision-1.
More examples: docs/plans/tool-description-improvement.md
Security
- Input path sandbox — local paths on
analyze_*and reference images must stay insideOPENROUTER_INPUT_DIR(falls back toOPENROUTER_OUTPUT_DIR, thencwd) - Output path sandbox —
save_pathmust stay insideOPENROUTER_OUTPUT_DIR - Async job reads —
get_chat_completion_statusresolves disk paths only underOPENROUTER_OUTPUT_DIR/openrouter-jobs/(4.7.0+) - SSRF protection — private/reserved IPs blocked on URL fetches
- Untrusted content — analyze outputs tagged
_meta.content_is_untrusted: true - Prototype-pollution defense — all API output boundaries (model records, embeddings, decisions, rerank results, log context) recursively strip
__proto__,constructor, andprototypekeys before forwarding to MCP clients - Secret redaction — the stderr JSON logger redacts API keys and sensitive values; stdout is reserved for MCP protocol traffic
Override sandboxes only with OPENROUTER_ALLOW_UNSAFE_PATHS=1 (discouraged).
Report vulnerabilities: SECURITY.md (private disclosure — do not file public issues for exploits).
Configuration
Environment variables
See .env.example for the full list (provider routing, fetch limits, caching, video polling, async jobs, integration-test overrides).
Development
Testing
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 — 396 additional cases beyond the core suite.
Releasing
Published artifacts (npm, PyPI/uvx, Docker, GHCR) all ship from the same semver on a git tag (vX.Y.Z). Pushing to main runs tests but does not publish to npm or PyPI.
Normal flow: merge conventional commits to main → Release Please opens a Release PR → merge it → tag is created → CI publishes everywhere.
Manual flow: bump all version files → npm run version:check → npm run ci + smoke tests → commit → git tag vX.Y.Z → git push origin vX.Y.Z.
Full checklist, file list, CI secrets, and agent instructions:
docs/RELEASING.md— maintainer release guideAGENTS.md— quick reference for AI agents
Troubleshooting
Structured errors include _meta.suggestions with agent-oriented next steps when available.
FAQ
Do I need paid OpenRouter credits?
No, to get started. Free models work for chat and vision. Audio/video generation usually requires credits; analysis may return 402 on some models — the server surfaces that as a structured error.
Which MCP clients are supported?
Any MCP-compatible client over stdio: Cursor, Claude Desktop, VS Code Copilot, Windsurf, Cline, Kiro, and custom agents.
How is this different from calling OpenRouter directly?
This server adds MCP tool schemas, security sandboxes, error taxonomy, model caching, async video polling with progress notifications, and agent-oriented tool descriptions — so LLMs invoke the right capability without custom HTTP glue.
Where is the security advisory for path traversal?
Fixed in 4.5.2+ — see GHSA-3q7p-736f-x44v, SECURITY.md, and docs/solutions/security-issues/.
Compatibility
Works with any MCP client. Protocol: MCP 2025-11-25 (backwards-compatible with 2025-06-18 and earlier). Node ≥ 22 (Docker image uses Node 24).
License
Apache 2.0 — see LICENSE.
Contributing
Issues and PRs welcome. For large changes, open an issue first.
Before submitting: run npm run ci. Use Conventional Commits (fix:, feat:, etc.) so Release Please can cut the next release. See docs/RELEASING.md if you need to ship a version.
Source: README.md at commit dbc5ceb
Tools
0Version history
1- v4.5.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts