OpenRouteraiSAFE
MCP server for OpenRouter.ai integration
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://github.com/heltonteixeira/openrouterai) [](CHANGELOG.md) [](https://www.typescriptlang.org/) [](LICENSE)
A Model Context Protocol (MCP) server providing seamless integration with OpenRouter.ai's diverse model ecosystem. Access various AI models through a unified, type-safe interface with built-in caching, rate limiting, and error handling.
Features
- Model Access
- Direct access to all OpenRouter.ai models
- Automatic model validation and capability checking
- Default model configuration support
- Performance Optimization
- Smart model information caching (1-hour expiry)
- Automatic rate limit management
- Exponential backoff for failed requests
- Unified Response Format
- Consistent
ToolResultstructure for all responses - Clear error identification with
isErrorflag - Structured error messages with context
Installation
pnpm install @mcpservers/openrouterai
Configuration
Prerequisites
- Get your OpenRouter API key from OpenRouter Keys
- Choose a default model (optional)
Environment Variables
OPENROUTER_API_KEY: Required. Your OpenRouter API key.OPENROUTER_DEFAULT_MODEL: Optional. The default model to use if not specified in the request (e.g.,openrouter/auto).OPENROUTER_MAX_TOKENS: Optional. Default maximum number of tokens to generate ifmax_tokensis not provided in the request.OPENROUTER_PROVIDER_QUANTIZATIONS: Optional. Comma-separated list of default quantiz
ee7f6b667ca6OBSERVED · 2026-10-07Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add openrouterai --env OPENROUTER_API_KEY=${OPENROUTER_API_KEY} --env OPENROUTER_MAX_TOKENS=${OPENROUTER_MAX_TOKENS} -- npx -y @mcpservers/[email protected]{
"mcpServers": {
"openrouterai": {
"command": "npx",
"args": [
"-y",
"@mcpservers/[email protected]"
],
"env": {
"OPENROUTER_API_KEY": "${OPENROUTER_API_KEY}",
"OPENROUTER_MAX_TOKENS": "${OPENROUTER_MAX_TOKENS}"
}
}
}
}Exposed tools (4)
4 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
chat_completion | read | Sends conversational context (messages) to OpenRouter.ai for completion using a specified model. Use this for dialogue, text generation, or instruction-following tasks. Supports advanced provider routing and parameter overrides. Returns the generated text response. |
get_model_info | read | Retrieves the complete metadata for a single OpenRouter.ai model specified by its unique ID. Use this when you know the model ID and need its full details (pricing, context limits, capabilities, etc.). Returns a model information object. |
search_models | read | Queries the OpenRouter.ai model registry, filtering by various criteria like capabilities, pricing, or provider. Use this to discover models suitable for specific needs. Returns a list of matching model metadata objects. |
validate_model | read | Verifies if a given model ID exists within the OpenRouter.ai registry. Use this for a quick check of model ID validity before making other API calls. Returns a boolean value ( |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (1 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (2)
.dxtignore
axios, openai, typescript, @types/node, shx
Gates applied: no_behavioural_pass.
ee7f6b667ca6full audit observations/trust-audit/mcp-server/heltonteixeira__openrouterai.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-07 | ee7f6b667ca6 | SAFE | B | 89 | first audit |
Questions
What is the OpenRouterai MCP server?
MCP server for OpenRouter.ai integration
What tools does OpenRouterai expose?
4 in total: 4 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is OpenRouterai safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does OpenRouterai need?
It reads OPENROUTER_API_KEY and OPENROUTER_MAX_TOKENS from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does OpenRouterai run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as @mcpservers/openrouterai at 2.3.0.
How current is this page?
The grade is for one exact copy of the source (ee7f6b667ca6), read on 2026-10-07. The repository is watched and re-audited when it changes.