---
title: "Deploy SearXNG MCP"
description: "Web search for AI agents over MCP, with a private SearXNG and no API key"
category: "AI/ML"
url: https://railway.com/deploy/searxng-mcp
---

# Deploy SearXNG MCP

Web search for AI agents over MCP, with a private SearXNG and no API key

**[Deploy SearXNG MCP on Railway](https://railway.com/template/searxng-mcp)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/searxng-mcp/manifest.json

- **Creator:** Dektion Studio
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### SearXNG MCP https://raw.githubusercontent.com/searxng/searxng/12f8b6515ca77c3c3bc1498584950ef5daca1433/searx/static/themes/simple/img/favicon.png

- **Image:** isokoliuk/mcp-searxng:2.4.0
- **Health check:** /health
- **Public domain:** Yes

### SearXNG https://raw.githubusercontent.com/searxng/searxng/12f8b6515ca77c3c3bc1498584950ef5daca1433/searx/static/themes/simple/img/favicon.png

- **Source:** dektionstudio/railway-template-images
- **Health check:** /healthz

## Documentation

# Deploy and Host SearXNG MCP on Railway

[mcp-searxng](https://github.com/ihor-sokoliuk/mcp-searxng) is an MCP server that gives AI assistants and agents web search and page reading through [SearXNG](https://github.com/searxng/searxng), a self-hosted metasearch engine. There is no search API key and no per-query bill.

This template runs both: mcp-searxng 2.4.0 on a public HTTPS address behind a bearer token, and SearXNG on Railway's private network only.

## About Hosting SearXNG MCP

SearXNG has no public domain here. Only the MCP service can reach it, so your instance can't be found and used as a free search proxy by strangers. A small settings file turns on SearXNG's JSON API, which MCP servers need, and turns off the public-instance features.

The MCP server runs upstream's hardened HTTP mode. Every request needs the token in `MCP_HTTP_AUTH_TOKEN` (generated at deploy), and the host and origin allowlists are set to your Railway domain. The page reader (`web_url_read`) refuses private addresses. Without that, anyone with the token could use it to look at other services in your Railway project.

Search engines treat Railway's datacenter IPs differently, so I tested them from a deployment. Google, Bing and Yahoo returned results. DuckDuckGo answered with a CAPTCHA, and Brave, Startpage, Qwant, Mojeek, Presearch and Ecosia returned nothing. SearXNG here keeps only the engines that answered, plus Wikipedia, their news engines and a few developer sources (GitHub, Stack Overflow, PyPI, npm, MDN, arXiv). Otherwise every search would wait for engines that time out.

Before publishing I tested the final version on a fresh deploy as an MCP client. A request without the token got 401. With the token, the server listed its four tools, searches returned results, `web_url_read` read a public page, and reading the SearXNG service's private address was refused by the security policy. After restarting both services everything still worked.

## Common Use Cases

- Web search for agents such as Hermes, OpenClaw, n8n AI agents, LibreChat or Open WebUI, without a search API subscription
- Search and page reading in Claude Code, Cursor or other coding tools that accept an MCP URL with a header
- One shared search endpoint for several agents, with results cached for a day

## Dependencies for SearXNG MCP Hosting

Nothing beyond the template. Your MCP client needs to support Streamable HTTP with a custom `Authorization` header. Claude Code, Cursor, n8n and most agent frameworks do. The Claude.ai and ChatGPT web connectors only offer OAuth or no authentication, so they can't use this token setup.

### Deployment Dependencies

- mcp-searxng: https://github.com/ihor-sokoliuk/mcp-searxng
- SearXNG: https://github.com/searxng/searxng
- Images: `isokoliuk/mcp-searxng:2.4.0`, `searxng/searxng:2026.9.25-12f8b6515`
- The SearXNG settings this template builds: https://github.com/dektionstudio/railway-template-images/tree/main/searxng

### Implementation Details

Add the server to Claude Code:

```
claude mcp add --transport http searxng  --header "Authorization: Bearer "
```

```
MCP_URL                  # https:///mcp
MCP_HTTP_AUTH_TOKEN      # generated; send as Authorization: Bearer 
MCP_HTTP_ALLOWED_HOSTS   # your Railway domain; add a custom domain here, comma-separated
SEARXNG_MAX_RESULTS=10   # results per search
```

Tools: `searxng_web_search`, `searxng_search_suggestions`, `searxng_instance_info` and `web_url_read`.

Idle, the MCP server used 0.09 GB of RAM and SearXNG 0.11 GB, which is about $2 a month on Railway's usage pricing.

## Why Deploy SearXNG MCP on Railway?

Agents need search, and paid search APIs charge per query. Here search runs on your own instance for the cost of about 0.2 GB of RAM. The tradeoff is that results depend on engines that accept datacenter traffic, which can change; if one stops answering, SearXNG suspends it and uses the others.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/searxng-mcp
