{"_id":"@0xmrk/openrouter-mcp","_rev":"2-9769d633170d31844dc06c93acd5e952","name":"@0xmrk/openrouter-mcp","dist-tags":{"latest":"2.0.1"},"versions":{"2.0.0":{"name":"@0xmrk/openrouter-mcp","version":"2.0.0","keywords":["mcp","openrouter","claude-code","ai","llm","deepseek","gemini","gpt","model-context-protocol"],"license":"MIT","_id":"@0xmrk/openrouter-mcp@2.0.0","maintainers":[{"name":"0xmrk","email":"mmrzk1995@gmail.com"}],"homepage":"https://github.com/mokarimi19/openrouter-mcp#readme","bugs":{"url":"https://github.com/mokarimi19/openrouter-mcp/issues"},"bin":{"openrouter-mcp":"index.js"},"dist":{"shasum":"c61e0f481e6ba02954d15a9d5bc291993db8a153","tarball":"https://registry.npmjs.org/@0xmrk/openrouter-mcp/-/openrouter-mcp-2.0.0.tgz","fileCount":3,"integrity":"sha512-a0dEzCKVRddhqUUjG48YlG2zWxAUABHegX3OqTCM3geBIRi9rGSujIkXLs+MoQAn5E7iCdHoJvLe+xdJNWeCVw==","signatures":[{"sig":"MEQCIBhnHAy/Sz4s0elDAAZqSLg72AxB/jjRW4+G1ya1WzruAiANbt0RnDbo6wXt3yLvwWTjlLuK8YCd76J0bSSPo1SJhg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26406},"main":"index.js","type":"module","engines":{"node":">=18.0.0"},"gitHead":"aa7df575e56e1b0510ce01fc598f39e15a6f2bff","_npmUser":{"name":"0xmrk","email":"mmrzk1995@gmail.com"},"repository":{"url":"git+https://github.com/mokarimi19/openrouter-mcp.git","type":"git"},"_npmVersion":"11.9.0","description":"Talk to 500+ AI models from inside Claude Code. One file. Zero config.","directories":{},"_nodeVersion":"25.6.1","dependencies":{"zod":"^3.24.2","@modelcontextprotocol/sdk":"^1.12.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/openrouter-mcp_2.0.0_1772147713402_0.8865974876077749","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@0xmrk/openrouter-mcp","version":"2.0.1","description":"Talk to 500+ AI models from inside Claude Code. One file. Zero config.","main":"index.js","bin":{"openrouter-mcp":"index.js"},"type":"module","keywords":["mcp","openrouter","claude-code","ai","llm","deepseek","gemini","gpt","model-context-protocol"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/0xMRK95/openrouter-mcp.git"},"engines":{"node":">=18.0.0"},"dependencies":{"@modelcontextprotocol/sdk":"^1.12.1","zod":"^3.24.2"},"gitHead":"0e96b04abc26d47947be31ad23148289caf79912","_id":"@0xmrk/openrouter-mcp@2.0.1","bugs":{"url":"https://github.com/0xMRK95/openrouter-mcp/issues"},"homepage":"https://github.com/0xMRK95/openrouter-mcp#readme","_nodeVersion":"25.6.1","_npmVersion":"11.9.0","dist":{"integrity":"sha512-DIVzSsV2m2rEc/B2WgLleOvhGh6FZdO0S/WiOGFXhezJ91zzkk60VdwzSlB8z6hx/J8Q5LIx419l78rOa+j0kw==","shasum":"7aaa35ec1ec9b3fcb253d8cf4ff4a7abd57c6b2d","tarball":"https://registry.npmjs.org/@0xmrk/openrouter-mcp/-/openrouter-mcp-2.0.1.tgz","fileCount":3,"unpackedSize":26403,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDAneqZ2OM9HFyPpwOj+ADY2CoSJ2EJwJxYFj01h0V9PgIhAN8OZcVMXYFy+WRpxSw5WQFYzF9jwhCQGMc1H4UH5MTq"}]},"_npmUser":{"name":"0xmrk","email":"mmrzk1995@gmail.com"},"directories":{},"maintainers":[{"name":"0xmrk","email":"mmrzk1995@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openrouter-mcp_2.0.1_1772223252126_0.213870776041583"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-26T23:15:13.318Z","modified":"2026-02-27T20:14:12.385Z","2.0.0":"2026-02-26T23:15:13.547Z","2.0.1":"2026-02-27T20:14:12.272Z"},"bugs":{"url":"https://github.com/0xMRK95/openrouter-mcp/issues"},"license":"MIT","homepage":"https://github.com/0xMRK95/openrouter-mcp#readme","keywords":["mcp","openrouter","claude-code","ai","llm","deepseek","gemini","gpt","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/0xMRK95/openrouter-mcp.git"},"description":"Talk to 500+ AI models from inside Claude Code. One file. Zero config.","maintainers":[{"name":"0xmrk","email":"mmrzk1995@gmail.com"}],"readme":"# 🌐 openrouter-mcp\n\n**Talk to 500+ AI models from inside Claude Code.** One file. Zero config. Just works.\n\n> _\"ask deepseek to review this code\"_ — and it does. Without leaving your session.\n\n---\n\n## 🤯 Why This Exists\n\nYou're in Claude Code. You're deep in a problem. You want a second opinion from DeepSeek. Or a quick answer from Gemini. Or you want to see how GPT handles a prompt.\n\n**Before:** Open a new tab. Copy context. Paste. Wait. Copy response. Paste back. Lose your flow.\n\n**After:**\n\n```\n❯ ask deepseek to review my auth implementation\n\n  deepseek/deepseek-r1 (142 in / 891 out · $0.0028):\n\n  \"Three issues: 1) The JWT expiry is set to 30 days which is too long...\"\n```\n\nThat's it. One sentence. The model responds inline. You never leave your session.\n\n---\n\n## ⚡ 30-Second Setup\n\n```bash\n# 1. Get an API key from https://openrouter.ai/keys\n\n# 2. Add to Claude Code\nclaude mcp add openrouter -s user \\\n  -e OPENROUTER_API_KEY=sk-or-... \\\n  -- npx openrouter-mcp\n\n# 3. Restart Claude Code. Done.\n```\n\nOr install from source:\n\n```bash\ngit clone https://github.com/anthropics/openrouter-mcp\ncd openrouter-mcp && npm install\n\nclaude mcp add openrouter -s user \\\n  -e OPENROUTER_API_KEY=sk-or-... \\\n  -- node /path/to/openrouter-mcp/index.js\n```\n\n---\n\n## 🎯 What You Can Do\n\n### 💬 Ask any model anything\n\n```\n❯ ask deepseek to explain this regex\n❯ ask gemini to find bugs in my code\n❯ ask gpt what design pattern fits here\n```\n\nJust say \"ask [model]\" and Claude routes it through OpenRouter. Token usage and cost shown on every response.\n\n### 🏷️ Use aliases instead of memorizing model IDs\n\n```\n❯ ask the fast model to summarize this file\n❯ ask the code model to optimize this function\n❯ ask the reason model why this algorithm is O(n²)\n```\n\n| Alias | Model | Best for |\n|-------|-------|----------|\n| `fast` | gemini-2.5-flash | Quick answers, summaries |\n| `cheap` | gemini-2.5-flash | Budget-friendly queries |\n| `smart` | gemini-2.5-pro | Complex analysis |\n| `powerful` | gemini-2.5-pro | Deep reasoning tasks |\n| `code` | deepseek-chat | Code gen, debugging |\n| `reason` | deepseek-r1 | Step-by-step logic |\n| `thinking` | deepseek-r1 | Chain-of-thought problems |\n| `creative` | mistral-large | Writing, brainstorming |\n\n### 🧵 Have multi-turn conversations with external models\n\n```\n❯ start a thread called \"refactor\" with deepseek — here's my database module [code]\n\n  deepseek: \"I see several issues with the connection pooling...\"\n\n❯ continue the refactor thread — what about the query builder?\n\n  deepseek: \"Building on what we discussed, the query builder should...\"\n```\n\nThe external model remembers the full conversation. Your Claude session stays clean. Delegate complex sub-tasks to a specialist model without polluting your main context.\n\n### 🎭 Save personas for instant role-switching\n\n```\n❯ save a persona called \"security_auditor\" — expert at finding vulnerabilities, uses deepseek\n\n❯ use the security_auditor persona to review my auth middleware\n\n  deepseek (as security_auditor): \"Critical: the token validation\n  doesn't check for algorithm confusion attacks...\"\n```\n\nSave a system prompt + model combo once, reuse it by name forever (within the session). Perfect for:\n- `code_reviewer` — thorough, opinionated reviews\n- `translator` — technical docs in any language\n- `explain_like_5` — simplify complex concepts\n- `devil_advocate` — challenge your assumptions\n\n### 💰 Track spending and set budgets\n\n```\n❯ set openrouter budget to $2\n\n  Budget set to $2.00. Remaining: $2.0000.\n\n❯ how much have I spent on openrouter?\n\n  Session usage:\n  - Calls: 12\n  - Spent: $0.0847\n  - Budget: $2.00\n  - Remaining: $1.9153\n```\n\nEvery response already shows inline cost: `(142 in / 891 out · $0.0028)`. Set a hard budget limit and the server blocks requests when you hit it. No surprise bills.\n\n### 🔍 Find the right model\n\n```\n❯ search openrouter models for deepseek\n❯ show me free models on openrouter\n❯ list google models sorted by cost\n❯ what openrouter models have the largest context?\n```\n\nFilter by provider, search by name, sort by cost or context length. 500+ models at your fingertips.\n\n---\n\n## 🛠️ All 9 Tools\n\n| Tool | What it does |\n|------|-------------|\n| `chat` | Send a prompt to any model. Supports aliases, personas, threads |\n| `set_model` | Set session default model |\n| `list_models` | Browse/search models with filters (provider, cost, context, free) |\n| `save_persona` | Save a system prompt + model combo |\n| `list_personas` | Show saved personas |\n| `set_budget` | Set session spending limit |\n| `get_usage` | Show calls, spend, remaining budget |\n| `show_thread` | Display a thread's conversation history |\n| `clear_thread` | Delete a thread |\n\n---\n\n## 🏗️ Architecture\n\n```\nClaude Code session\n  │\n  │  You: \"ask deepseek to review this code\"\n  │\n  ├─ Claude sees your full conversation\n  │  Composes a prompt with relevant context\n  │\n  ├─ MCP tool call → openrouter-mcp (stdio)\n  │    │\n  │    ├─ Resolves model alias/persona/default\n  │    ├─ Loads thread history if applicable\n  │    ├─ Checks budget limit\n  │    ├─ POST openrouter.ai/api/v1/chat/completions\n  │    ├─ Tracks token usage + cost\n  │    └─ Returns response with metadata\n  │\n  └─ Claude presents the response to you\n```\n\n**Key design decisions:**\n\n- **Stateless relay** — Claude handles context. The MCP server just forwards. No complex state management.\n- **Threads are opt-in** — Only when you explicitly name a thread does the server maintain state.\n- **Budget is session-scoped** — Resets on restart. No persistent config to manage.\n- **Single file** — The entire server is `index.js`. Read it in 5 minutes.\n\n---\n\n## ⚙️ Configuration\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `OPENROUTER_API_KEY` | ✅ | Your OpenRouter API key |\n| `OPENROUTER_MODEL` | ❌ | Initial default model (can also use `set_model`) |\n\nThat's it. No config files.\n\n---\n\n## 📊 What You See on Every Response\n\n```\ndeepseek/deepseek-r1 (142 in / 891 out · $0.0028):\n\nThe actual response text here...\n```\n\n- **Model name** — which model actually responded\n- **Token count** — prompt tokens in / completion tokens out\n- **Cost** — estimated cost based on OpenRouter pricing\n- **Thread info** — turn count if using a thread\n\n---\n\n## 🧩 Works With\n\n- ✅ **Claude Code** (primary target)\n- ✅ Any MCP-compatible client\n- ✅ Node.js 18+\n- ✅ macOS, Linux, Windows (WSL)\n\n---\n\n## 📦 One File\n\nThe entire server is [`index.js`](./index.js) — 617 lines, 2 dependencies, zero build step. Read it, fork it, extend it.\n\n```\nopenrouter-mcp/\n├── index.js         ← the entire server\n├── package.json\n└── README.md\n```\n\n---\n\n## 🤝 Contributing\n\nPRs welcome. The bar is simple: does it make the tool more useful without making it more complex?\n\nGood PRs:\n- New model aliases as the landscape evolves\n- Better cost estimation\n- Smarter typo correction\n\nPlease don't:\n- Add config files\n- Add a build step\n- Break the single-file design\n\n---\n\n## 📄 License\n\nMIT\n","readmeFilename":"README.md"}