The OpenRouter Agents MCP Server provides sophisticated research capabilities through a Model Context Protocol implementation. It allows conversational LLMs to delegate research tasks to specialized agents powered by various OpenRouter models, with Claude 3.7 Sonnet orchestrating the research process.
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": {
"openrouter-research-agents": {
"command": "cmd.exe",
"args": [
"/c",
"YOUR_PROJECT_PATH_HERE/start-mcp-server.bat"
],
"env": {
"OPENROUTER_API_KEY": "YOUR_OPENROUTER_API_KEY_HERE"
},
"disabled": false,
"autoApprove": [
"conduct_research",
"research_follow_up",
"get_past_research",
"rate_research_report",
"list_research_history"
]
}
}
}
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.
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.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)",
"host": "localhost",
"port": 3002,
"streamPath": "/sse",
"messagePath": "/messages"
}
Save and restart Claude.
Once configured, you'll see the research tools available in Cline or Claude Desktop App. 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:
PGLITE_DATA_DIR=./researchAgentDB
CACHE_TTL_SECONDS=3600
API key authentication is 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
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.