SearXNG MCP Bridge

SearXNG MCP Bridge

An MCP server that acts as a bridge to SearXNG instances, allowing AI models to perform web searches with privacy-focused search tools. It supports both STDIO and HTTP transports, featuring built-in rate limiting and session management.

Category
访问服务器

README

SearXNG MCP Bridge Server

Release

This is a Model Context Protocol (MCP) server that acts as a bridge to a SearXNG instance. It allows compatible clients to perform searches using a configured SearXNG instance via MCP tools.

Quick Start (Using from npm)

  1. Set up a SearXNG instance:

    # Using Docker
    docker run -d -p 8888:8080 --name searxng searxng/searxng
    
  2. Install and run the MCP bridge

    Default (STDIO, unchanged):

    # Run directly with npx (default - stdio transport)
    npx -y @nitish-raj/searxng-mcp-bridge
    

    Optional: Run as an HTTP server (new, opt-in)

     # Using env variables (recommended)
      TRANSPORT=http PORT=3002 HOST=127.0.0.1 SEARXNG_INSTANCE_URL=http://localhost:8080 npx -y @nitish-raj/searxng-mcp-bridge
    
    
    
    # Or run the built bundle
    TRANSPORT=http node build/index.js
    
  3. Configure in your MCP settings file (stdio / legacy clients) Add to your MCP settings file (e.g., ~/.vscode-server/.../mcp_settings.json):

    {
      "mcpServers": {
        "searxng-bridge": {
          "command": "npx",
          "args": [
           "-y",
           "@nitish-raj/searxng-mcp-bridge"
           ],
           "env": {
             "SEARXNG_INSTANCE_URL": "http://localhost:8080"
           },
          "disabled": false
        }
      }
    }
    

HTTP Configuration: Set TRANSPORT=http to run the bridge over HTTP instead of stdio. The transport mode can be configured via environment variables.

Features

  • Search Tool: Perform web searches using SearXNG with configurable parameters
  • Health Check: Monitor SearXNG instance connectivity and performance
  • Dual Transport: Supports both STDIO (default) and HTTP transports
  • Session Management: HTTP transport includes session-based connections
  • CORS Support: Proper cross-origin headers for web client integration
  • Rate Limiting: Built-in protection against excessive requests (HTTP mode)

Configuration

  • SEARXNG_INSTANCE_URL — REQUIRED. The full URL of the SearXNG instance (e.g., http://localhost:8080).
  • TRANSPORT — Transport protocol: stdio (default) or http
  • PORT — HTTP server port. Default: 3000 (use 3002 for development)
  • HOST — Server bind address. Default: 127.0.0.1 (use 0.0.0.0 for containers)
  • CORS_ORIGIN — Comma-separated list of allowed origins for CORS. Default: localhost:3002 (development) or * (production)
  • MCP_HTTP_BEARER — Optional bearer token for HTTP authentication HTTP Transport Features:
  • Session management with mcp-session-id headers
  • Secure CORS with origin whitelist validation
  • Rate limiting (100 requests/minute per IP)
  • Optional bearer authentication via MCP_HTTP_BEARER
  • DNS rebinding protection

Security Notes:

  • CORS uses secure whitelist in development (localhost:3002 only)
  • Production reflects specific origins for credentialed requests (CORS-compliant)
  • Set CORS_ORIGIN to customize allowed origins for your use case
  • Set TRANSPORT=stdio to revert to stdio mode

HTTP Transport

The HTTP transport implements the MCP Streamable HTTP specification (2025-03-26) with the following endpoints:

MCP Endpoints:

  • POST /mcp - Send MCP requests
  • GET /mcp - Server-Sent Events for notifications
  • DELETE /mcp - Terminate sessions
  • OPTIONS /mcp - CORS preflight requests

System Endpoints:

  • GET /healthz - Health check and status

Test HTTP endpoint:

curl -X POST http://localhost:3002/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

This returns a JSON-RPC response with the list of available tools (search and health_check).

Docker

The Dockerfile exposes port 8081 for HTTP transport. To run the container and allow HTTP access:

# Build (example)
docker build -t searxng-mcp-bridge .

# Run mapping port 8081
 docker run -d -p 8081:8081 --env SEARXNG_INSTANCE_URL=http://localhost:8080 --name searxng-mcp-bridge searxng-mcp-bridge

# To run HTTP transport inside container:
 docker run -d -p 8081:8081 -e TRANSPORT=http -e PORT=8081 -e SEARXNG_INSTANCE_URL=http://localhost:8080 searxng-mcp-bridge

Note: when containerized set HOST=0.0.0.0 or rely on the default exposed port mapping.

Usage

STDIO Clients: Use the tool unchanged - no configuration changes required.

HTTP Clients: Connect to http://localhost:3002/mcp (development port) and send MCP JSON-RPC requests.

Development

  • npm install: Install dependencies.
  • npm run build: Compile TypeScript to JavaScript.
  • npm run watch: Watch for changes and rebuild automatically.
  • npm run inspector: Run the MCP inspector to test the server.
  • npm run start:http: Start server in HTTP streaming mode on localhost:3002.

Migration & Compatibility

Backward Compatibility:

  • STDIO remains the default transport - existing users need no changes
  • All tool names, parameters, and responses remain unchanged
  • Configuration is opt-in via environment variables

Migration to HTTP:

  • Set TRANSPORT=http to enable HTTP transport
  • Configure PORT and HOST as needed
  • Update client to use HTTP endpoint instead of stdio

Rollback:

  • Set TRANSPORT=stdio or omit the variable to return to stdio

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选