OpenRouter Research Agents
STDIOMCP server implementing research agent capabilities with Claude orchestrating specialized OpenRouter models.
MCP server implementing research agent capabilities with Claude orchestrating specialized OpenRouter models.
A Model Context Protocol (MCP) server implementation for OpenRouter that provides sophisticated research agent capabilities. This server allows your conversational LLM to delegate research to a Claude research orchestrator that uses different specialized agents powered by various OpenRouter models.
The OpenRouter Agents MCP Server implements a sophisticated orchestration system for AI-powered research. This summary highlights the key technical components and capabilities in the latest beta (03-29-2025).
The beta improves both reliability and research quality through architectural enhancements while maintaining the plug-and-play simplicity of the original implementation. The system seamlessly integrates with Cline in VS Code and Claude Desktop App, providing enterprise-grade research capabilities in a self-contained package.
These improvements deliver a more reliable and powerful research experience while maintaining the server's ease of use. To try the beta version:
git clone https://github.com/wheattoast11/openrouter-deep-research-mcp.git cd openrouter-agents git checkout beta npm install
If you find this project helpful, please consider giving it a star on GitHub! Your support helps make this project better.
Your feedback and contributions are always welcome!
This is the recommended method for integrating with MCP clients like Cline in VS Code.
Clone this repository:
git clone https://github.com/wheattoast11/openrouter-deep-research-mcp.git cd openrouter-agents
Install dependencies:
npm install
Create your .env
file from the example:
cp .env.example .env
(On Windows, you might use copy .env.example .env
)
Edit the .env
file and add your OpenRouter API key:
OPENROUTER_API_KEY=your_api_key_here
(Ensure this file is saved in the root directory of the project)
To use this server with Cline in VS Code, you need to add it to your MCP settings file.
Locate your Cline MCP settings file:
c:\Users\YOUR_USERNAME\AppData\Roaming\Cursor\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
(Windows) or ~/Library/Application Support/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
(macOS). Replace YOUR_USERNAME
accordingly.Edit the cline_mcp_settings.json
file: Add the following configuration object within the main mcpServers
object. Make sure to replace "YOUR_PROJECT_PATH_HERE"
with the absolute path to where you cloned this repository and "YOUR_OPENROUTER_API_KEY_HERE"
with your actual API key.
{ "mcpServers": { // ... potentially other existing servers ... "openrouter-research-agents": { "command": "cmd.exe", "args": [ "/c", "YOUR_PROJECT_PATH_HERE/start-mcp-server.bat" ], "env": { // IMPORTANT: Replace with your actual OpenRouter API Key "OPENROUTER_API_KEY": "YOUR_OPENROUTER_API_KEY_HERE" }, "disabled": false, // Ensure the server is enabled "autoApprove": [ "conduct_research", "research_follow_up", "get_past_research", "rate_research_report", "list_research_history" ] } // ... potentially other existing servers ... } }
env
? While the server uses dotenv
to load the .env
file, providing the key in the env
block ensures the server process always has access to it.Save the settings file. Cline should automatically detect the new server configuration. You might need to restart VS Code or the Cline extension if it doesn't appear immediately.
Once configured, you'll see the conduct_research
and other research tools available in Cline. You can use them like this:
Can you research the latest advancements in quantum computing?
Or specify a cost preference:
Can you conduct a high-cost research on climate change mitigation strategies?
You can customize the available models by editing the .env
file:
HIGH_COST_MODELS=perplexity/sonar-deep-research,perplexity/sonar-pro,other-model
LOW_COST_MODELS=perplexity/sonar-reasoning,openai/gpt-4o-mini-search-preview,other-model
You can also customize the database and cache settings in the .env
file:
PGLITE_DATA_DIR=./researchAgentDB
CACHE_TTL_SECONDS=3600
The server can also be run as a standalone HTTP/SSE service for integration with the Claude Desktop App.
git clone https://github.com/wheattoast11/openrouter-deep-research-mcp.git cd openrouter-agents
.env
file as described in the standard installation (Steps 3 & 4).npm start
http://localhost:3002
(or the port specified in your .env
).Open Claude desktop app.
Go to Settings > Developer.
Click "Edit Config".
Add the following to the mcpServers
array in the configuration:
{ "type": "sse", "name": "OpenRouter Research Agents (HTTP)", // Differentiate if also using STDIO "host": "localhost", "port": 3002, // Or your configured port "streamPath": "/sse", "messagePath": "/messages" }
Save and restart Claude.
This server uses:
The server configuration can be modified in config.js
. You can adjust:
As of the latest update, API key authentication is now mandatory by default for HTTP/SSE transport:
Set the SERVER_API_KEY
environment variable in your .env
file for production:
SERVER_API_KEY=your_secure_api_key_here
For development/testing only, you can disable authentication by setting:
ALLOW_NO_API_KEY=true
This provides enhanced security for production deployments while maintaining flexibility for development and testing.
The repository includes several testing tools to verify the implementation:
Basic Tool Testing:
test-all-tools.bat
This script tests all five MCP tools in isolation to verify they are working correctly.
MCP Server Testing:
test-mcp-server.js
Tests the MCP server implementation including all transport options.
Research Agent Testing:
test-research-agent.js
Tests the core research agent functionality with actual OpenRouter API calls.
These tools help ensure that all components are functioning correctly after any modifications.
MIT