Skip to main content
Glama
sawroop1242

OpenRouter Reasoning MCP

by sawroop1242

OpenRouter Reasoning MCP

A stateless remote Model Context Protocol (MCP) server running on Cloudflare Workers.

It exposes one tool, multi_step_reasoning, which sends a prompt to OpenRouter, performs a second verification pass, and returns both responses plus provider reasoning fields when available.

Architecture

MCP client
   │
   │ Streamable HTTP
   ▼
Cloudflare Worker /mcp
   │
   ├── OpenRouter request #1
   │
   └── OpenRouter request #2 (verification)
             │
             ▼
      OpenRouter model
      stealth/ox-alpha

Related MCP server: CRASH - Cascaded Reasoning with Adaptive Step Handling

Requirements

  • Node.js

  • A Cloudflare account

  • An OpenRouter API key

  • Wrangler authentication

Local development

npm install
npx wrangler login
npx wrangler secret put OPENROUTER_API_KEY
npm run dev

The MCP endpoint is /mcp.

Deploy

npm install
npx wrangler login
npx wrangler secret put OPENROUTER_API_KEY
npm run typecheck
npm run deploy

After deployment, the endpoint will be:

https://openrouter-reasoning-mcp.<your-subdomain>.workers.dev/mcp

MCP client configuration

Use the deployed /mcp URL as a remote MCP server using Streamable HTTP. Do not configure the endpoint as the deprecated HTTP+SSE transport.

Tool

multi_step_reasoning

Input:

{
  "prompt": "Explain why a binary search is O(log n).",
  "follow_up": "Verify the explanation and correct any mistakes."
}

follow_up is optional. The default is:

Are you sure? Think carefully and verify your answer.

Security

The OpenRouter key is stored as a Cloudflare Worker secret and is never committed to Git. The current server is intentionally unauthenticated, meaning anyone who can reach the /mcp endpoint can invoke the tool and consume the configured OpenRouter account. Add MCP authentication/authorization before using this publicly with a paid OpenRouter key.

License

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Facilitates two-stage reasoning processes using DeepSeek for detailed analysis and supports multiple response models such as Claude 3.5 Sonnet and OpenRouter, maintaining conversation context and enhancing AI-driven interactions.
    2
    116
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables structured, iterative reasoning for complex problem-solving with features like confidence tracking, revision mechanisms, and branching support. Provides flexible validation and multiple output formats for systematic analysis and decision-making tasks.
    1
    22 npm
    72
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides advanced AI reasoning capabilities through step-by-step thinking framework, enabling complex problem-solving with dynamic thought revision, multi-path reasoning, and adaptive planning for sophisticated analysis tasks.
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Implements Chain of Thought methodology for extended sequential thinking on complex reasoning tasks. Enables AI clients to break down and solve problems that require deep, step-by-step logical analysis.
    1
    2 npm
    1
    MIT