Back to MCP directory
publicPublicdnsLocal runtime

openrouter-websearch-mcp

该项目实现了一个MCP协议服务器,提供基于OpenRouter的网页搜索工具,能够生成简洁、实时的答案。

article

README

🚀 OpenRouter 网络搜索 MCP 服务器

本项目实现了一个符合 MCP(模型上下文协议) 的服务器,并提供了 search_web 工具。该工具借助 OpenRouter 的在线模型进行网络搜索,能够生成简洁且最新的答案,为用户提供高效的信息查询服务。

🚀 快速开始

本项目实现的服务器符合 MCP 协议,通过 search_web 工具可利用 OpenRouter 在线模型进行网络搜索。使用前需确保满足系统要求并正确配置环境变量。

✨ 主要特性

  • 在标准输入输出上暴露符合 MCP 协议的服务器。
  • 提供 search_web 工具:
    • 可接受一个搜索查询字符串。
    • 利用 OpenRouter 的在线模型生成基于事实的答案。
    • 返回纯文本格式的结果。

📦 安装指南

要安装 MCP 服务器,可以使用以下命令:

go install github.com/ChristianSch/openrouter-websearch-mcp

📚 详细文档

系统要求

  • Go 1.18 或更高版本
  • OpenRouter API 密钥

环境变量

| 属性 | 详情 | |------|------| | 变量名称 | 描述 | 是否必需 | 默认值 | | OPENROUTER_API_KEY | 您的 OpenRouter API 密钥 | 是 | | | MODEL_NAME | OpenRouter 模型名称(应支持 :online 后缀) | 否 | google/gemini-2.5-pro-exp-03-25:free:online |

使用方法

运行服务器:

{
    "mcpServers": {
        "web-search": {
            "command": "openrouter-websearch-mcp",
            "env": {
                "OPENROUTER_API_KEY": "sk-or-v1-..."
            }
        }
    }
}

⚠️ 重要提示

运行服务器时,OPENROUTER_API_KEY 为必需的环境变量,请确保正确配置。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client