Skip to main content
Glama

OpenRouter Agents MCP Server

by wheattoast11

OpenRouter Agents MCP Server

[MAJOR UPDATE – August 12, 2025] An intelligent MCP server that orchestrates GPT‑5 / Gemini / Claude agents to research in parallel, indexing as it goes (PGlite + vectors), then synthesizes consensus with strict, URL‑backed citations.

  • Killer features
    • Plan → parallelize → synthesize workflow with bounded parallelism
    • Dynamic model catalog; supports Anthropic Sonnet‑4 and OpenAI GPT‑5 family
    • Built‑in semantic KB (PGlite + pgvector) with backup, export/import, health, and reindex tools
    • Lightweight web helpers: quick search and page fetch for context
    • Robust streaming (SSE), per‑connection auth, clean logs

What’s new (v1.2)

  • Local hybrid indexer (BM25 + optional vector rerank) with MCP tools: index_texts, index_url, search_index.
  • Auto‑indexing during research: every saved report and fetched page can be indexed on the fly.
  • Prompt/resource registration (MCP): planning_prompt, synthesis_prompt, and mcp_spec_links.
  • Compact prompts option: minimize tokens while enforcing explicit URL citations and confidence scoring.
  • Planning model fallbacks and simplified routing per strategy.

Changelog →

Quick start

  1. Prereqs
  • Node 18+ (20 LTS recommended), npm, Git, OpenRouter API key
  1. Install
npm install
  1. Configure (.env)
OPENROUTER_API_KEY=your_openrouter_key SERVER_API_KEY=your_http_transport_key SERVER_PORT=3002 # Orchestration ENSEMBLE_SIZE=2 PARALLELISM=4 # Models (override as needed) PLANNING_MODEL=openai/gpt-5-chat PLANNING_CANDIDATES=openai/gpt-5-chat,google/gemini-2.5-pro,anthropic/claude-sonnet-4 HIGH_COST_MODELS=openai/gpt-5-chat,google/gemini-2.5-pro,anthropic/claude-sonnet-4 LOW_COST_MODELS=openai/gpt-5-mini,google/gemini-2.5-flash,google/gemini-2.5-flash-lite VERY_LOW_COST_MODELS=openai/gpt-5-nano # Storage PGLITE_DATA_DIR=./researchAgentDB PGLITE_RELAXED_DURABILITY=true REPORT_OUTPUT_PATH=./research_outputs/ # Indexer INDEXER_ENABLED=true INDEXER_AUTO_INDEX_REPORTS=true INDEXER_AUTO_INDEX_FETCHED=true # MCP features MCP_ENABLE_PROMPTS=true MCP_ENABLE_RESOURCES=true # Prompt strategy PROMPTS_COMPACT=true PROMPTS_REQUIRE_URLS=true PROMPTS_CONFIDENCE=true
  1. Run
  • STDIO (for Cursor/VS Code MCP):
node src/server/mcpServer.js --stdio
  • HTTP/SSE (local daemon):
SERVER_API_KEY=$SERVER_API_KEY node src/server/mcpServer.js

Tools (high‑value)

  • Research: conduct_research, research_follow_up
  • Knowledge base: get_past_research, list_research_history, get_report_content
  • DB ops: backup_db (tar.gz), export_reports, import_reports, db_health, reindex_vectors
  • Models: list_models
  • Web: search_web, fetch_url
  • Indexer (new): index_texts, index_url, search_index, index_status

Notes

  • Data lives locally under PGLITE_DATA_DIR (default ./researchAgentDB). Backups are tarballs in ./backups.
  • Use list_models to discover current provider capabilities and ids.

Architecture at a glance

See docs/diagram-architecture.mmd (Mermaid). Render to SVG with Mermaid CLI if installed:

npx @mermaid-js/mermaid-cli -i docs/diagram-architecture.mmd -o docs/diagram-architecture.svg

How it differs from typical “agent chains”:

  • Not just hardcoded handoffs; the plan is computed, then parallel agents search, then a synthesis step reasons over consensus, contradictions, and gaps.
  • The system indexes what it reads during research, so subsequent queries get faster/smarter.
  • Guardrails shape attention: explicit URL citations, [Unverified] labelling, and confidence scoring.

Minimal‑token prompt strategy

  • Compact mode strips preambles to essential constraints; everything else is inferred.
  • Enforced rules: explicit URL citations, no guessing IDs/URLs, confidence labels.
  • Short tool specs: use concise param names and rely on server defaults.

Common user journeys

  • “Give me an executive briefing on MCP status as of July 2025.”
    • Server plans sub‑queries, fetches authoritative sources, synthesizes with citations.
    • Indexed outputs make related follow‑ups faster.
  • “Find vision‑capable models and route images gracefully.”
    • /models discovered and filtered, router template generated, fallback to text models.
  • “Compare orchestration patterns for bounded parallelism.”
    • Pulls OTel/Airflow/Temporal docs, produces a MECE synthesis and code pointers.

Cursor IDE usage

  • Add this server in Cursor MCP settings pointing to node src/server/mcpServer.js --stdio.
  • Use the new prompts (planning_prompt, synthesis_prompt) directly in Cursor to scaffold tasks.

FAQ (quick glance)

  • How does it avoid hallucinations?
    • Strict citation rules, [Unverified] labels, retrieval of past work, on‑the‑fly indexing.
  • Can I disable features?
    • Yes, via env flags listed above.
  • Does it support streaming?
    • Yes, SSE for HTTP; stdio for MCP.

Command Map (quick reference)

  • Start (stdio): npm run stdio
  • Start (HTTP/SSE): npm start
  • Generate examples: npm run gen:examples
  • List models: MCP list_models { refresh:false }
  • Research (compact): conduct_research { q:"<query>", cost:"low", aud:"intermediate", fmt:"report", src:true }
  • Get past research: get_past_research { query:"<query>", limit:5 }
  • Index URL (if enabled): index_url { url:"https://..." }
  • Search index (if enabled): search_index { query:"<q>", limit:10 }
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A Model Context Protocol server that enables conversational LLMs to delegate complex research tasks to specialized AI agents powered by various OpenRouter models, coordinated by a Claude orchestrator.

  1. 🚀 New Beta Branch (03-29-2025)
    1. OpenRouter Agents MCP Server Technical Overview
  2. 🌟 Support This Project
    1. Prerequisites
      1. Features
        1. How It Works
          1. Installation (Node.js / Standard)
            1. Cline / VS Code MCP Integration (Recommended)
              1. Available Models
                1. High-Cost Models
                2. Low-Cost Models
              2. Customization
                1. Alternative Installation: HTTP/SSE for Claude Desktop App
                  1. HTTP/SSE Installation Steps
                  2. Claude Desktop App Integration (HTTP/SSE)
                2. Persistence & Data Storage
                  1. Troubleshooting
                    1. Advanced Configuration
                      1. Authentication Security
                    2. Testing Tools
                      1. License

                        Related MCP Servers

                        • -
                          security
                          F
                          license
                          -
                          quality
                          A Model Context Protocol server that enables Claude users to access specialized OpenAI agents (web search, file search, computer actions) and a multi-agent orchestrator through the MCP protocol.
                          Last updated -
                          9
                          Python
                          • Linux
                          • Apple
                        • -
                          security
                          -
                          license
                          -
                          quality
                          A Model Context Protocol server that enables intelligent task delegation from advanced AI agents like Claude 3.7 to cost-effective LLMs, providing a comprehensive suite of tools spanning cognitive memory, browser automation, Excel manipulation, database interactions, and document processing.
                          Last updated -
                          98
                          Python
                          MIT License
                        • A
                          security
                          A
                          license
                          A
                          quality
                          A Model Context Protocol server that scans and exposes AI-related dotfiles and configuration files to LLM agents, helping them understand project context and guidelines.
                          Last updated -
                          JavaScript
                          MIT License
                        • -
                          security
                          A
                          license
                          -
                          quality
                          A sophisticated server that coordinates multiple LLMs (Claude, Gemini, etc.) using the Model Context Protocol to enhance reasoning capabilities through strategies like progressive deep dive and consensus-based approaches.
                          Last updated -
                          Python
                          MIT License
                          • Linux
                          • Apple

                        View all related MCP servers

                        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/wheattoast11/openrouter-deep-research-mcp'

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