OpenRouter Search MCP Server

OpenRouter Search MCP Server

By joaomj GitHub

MCP server for OpenRouter search functionality

Overview

What is OpenRouter Search Server?

OpenRouter Search Server is an MCP server that provides web search capabilities using OpenRouter's API with Google Gemini Pro.

How to use OpenRouter Search Server?

To use the OpenRouter Search Server, clone the repository, install the dependencies, build the project, and configure your MCP settings with your OpenRouter API key.

Key features of OpenRouter Search Server?

  • Web search via OpenRouter API
  • Utilizes the Google Gemini Pro model
  • Simple MCP interface for easy integration

Use cases of OpenRouter Search Server?

  1. Integrating web search functionality into applications.
  2. Enhancing search capabilities for data retrieval.
  3. Providing a seamless search experience using advanced AI models.

FAQ from OpenRouter Search Server?

  • How do I install OpenRouter Search Server?

Clone the repository, run npm install, and build the project with npm run build.

  • Is there a license for OpenRouter Search Server?

Yes, it is licensed under the MIT license.

  • Can I use my own API key?

Yes, you need to add your OpenRouter API key in the MCP settings file.

Content

OpenRouter Search MCP Server

This is a Model Context Protocol (MCP) server designed to provide web search capabilities by leveraging the OpenRouter API.

Features

  • Web Search via OpenRouter: Utilizes the OpenRouter API to perform web searches.
  • Specific Model: Uses the google/gemini-2.5-pro-exp-03-25:free:online model. The :online suffix enables the model's web search functionality.
  • Raw Text Output: The server returns the direct, unparsed text response generated by the AI model.
  • MCP Integration: Exposes a simple web_search tool compatible with MCP clients.

Installation

  1. Clone: Clone this repository to your local machine.
    git clone https://github.com/joaomj/openrouter-search-server.git
    cd openrouter-search-server
    
  2. Install Dependencies:
    npm install
    
  3. Build: Compile the TypeScript code.
    npm run build
    

Configuration

  1. API Key: Ensure you have an API key from OpenRouter.

  2. MCP Settings: Add the following configuration block to your MCP client's settings file (e.g., ~/.vscode-server/data/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json for VS Code Remote/Codespaces or ~/Library/Application Support/Claude/claude_desktop_config.json for Claude Desktop App):

    {
      "mcpServers": {
        "openrouter-search": {
          "command": "node",
          "args": [
            "/home/joao/Cline/MCP/openrouter-search-server/build/index.js"
          ],
          "env": {
            "OPENROUTER_API_KEY": "YOUR_OPENROUTER_API_KEY_HERE"
          },
          "disabled": false,
          "autoApprove": []
        }
        // ... other servers
      }
    }
    
    • Replace /home/joao/Cline/MCP/openrouter-search-server/build/index.js with the actual absolute path to the built index.js file on your system if you cloned it elsewhere.
    • Replace YOUR_OPENROUTER_API_KEY_HERE with your actual OpenRouter API key.

    Important: The server requires the OPENROUTER_API_KEY environment variable to be set. Never commit your API key directly into the code or the repository.

Usage

Once the server is configured and running (either manually via npm start in its directory or automatically via your MCP client), you can use the web_search tool.

Tool: web_search

Server Name: openrouter-search (or whatever key you used in the MCP settings)

Input:

  • query (string, required): The search query you want to perform.

Output:

  • A text string containing the raw response from the OpenRouter API's google/gemini-2.5-pro-exp-03-25:free:online model.

Example MCP Tool Call:

<use_mcp_tool>
<server_name>openrouter-search</server_name>
<tool_name>web_search</tool_name>
<arguments>
{
  \"query\": \"What is the latest version of the MCP SDK?\"
}
</arguments>
</use_mcp_tool>

License

MIT.

No tools information available.
No content found.