Skip to main content
Glama

openrouter-mcp

Remote MCP server that lets Claude invoke third-party models (Grok, GPT, Gemini, DeepSeek — anything OpenRouter carries) as tools mid-conversation. The OpenRouter API key never leaves this server.

Tools exposed

  • ask_model{ model, prompt, system?, temperature?, max_tokens?, chat_id? } → model reply + token/cost footer. Pass chat_id (any string you invent) to make the conversation sticky: the server keeps the transcript and replays it on every call, so the model remembers earlier turns. Different calls on one chat may use different models — they share the transcript.

  • list_models{ search?, limit? } → matching OpenRouter model IDs with context length and pricing

  • list_chats — active sticky chats with turn count, last model, total cost, last activity

  • get_chat{ chat_id } → full transcript of one sticky chat

Related MCP server: MCP OpenAI Server

Deploy (Render)

  1. Push this repo to GitHub, create a Web Service on Render pointing at it.

    • Build: npm install · Start: npm start (Render injects PORT)

  2. Environment variables:

    • OPENROUTER_API_KEY — from https://openrouter.ai/keys (set a spend limit on the key)

    • AUTH_TOKEN — generate one: node -e "console.log(require('crypto').randomBytes(24).toString('base64url'))"

    • APP_URL — optional, your Render URL (OpenRouter attribution header)

  3. Sanity check: GET https://your-app.onrender.com/healthz{"ok":true}

Also runs fine on the SOCKS5-proxy VPS with pm2 + a reverse proxy for TLS — claude.ai requires HTTPS for connectors.

Connect to claude.ai

Settings → Connectors → Add custom connector → URL:

https://your-app.onrender.com/mcp/<AUTH_TOKEN>

No OAuth config needed — the token in the path is the auth. Then in any chat, enable the connector and ask Claude to ask_model with e.g. x-ai/grok-4.

Notes

  • Stateless transport: every request builds a fresh server instance. No sessions to lose when Render cold-starts or Starlink blips.

  • Sticky chats are in-memory only: they survive across requests but are lost on restart/redeploy (and Render free-tier sleep). Capped at 100 chats / 200 messages each, LRU-evicted. A failed model call never creates or grows a chat.

  • The secret lives in the URL path, so treat the connector URL itself as a credential. Rotate AUTH_TOKEN if it leaks.

  • Free-tier Render sleeps after idle; first call after a nap takes ~30s. Fine for this use case.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Gives Claude access to multiple AI models (Gemini, OpenAI, OpenRouter, Ollama) for enhanced development capabilities including extended reasoning, collaborative development, code review, and advanced debugging.
  • A
    license
    A
    quality
    D
    maintenance
    Enables Claude to directly invoke OpenAI's chat models (GPT-4o, GPT-4o-mini, o1-preview, o1-mini) through a Model Context Protocol integration, allowing users to query and compare responses from different AI models within Claude Desktop.
    1
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sclarke500/ask-agent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server