SearxNG MCP Server for Cline¶
Build your own SearxNG¶
- Install docker & docker-compose on your linux
- Clone https://github.com/searxng/searxng-docker
- Edit .env
- Edit searxng/settings.yml
# see https://docs.searxng.org/admin/settings/settings.html#settings-use-default-settings use_default_settings: true server: # base_url is defined in the SEARXNG_BASE_URL environment variable, see .env and docker-compose.yml secret_key: "xxxx" # change this! limiter: false # can be disabled for a private instance image_proxy: true ui: static_use_hash: true redis: url: redis://redis:6379/0 search: # remove format to deny access, use lower case. # formats: [html, csv, json, rss] formats: - html - json # <-- MCP need this format
- First time to start containers, need change docker-compose.yaml
- Start docker for searxng, caddy, redis, etc.
- Add A record in route53 to point the public ip of EC2
- Open 80, 443 port for this EC2
- Access your www.hostname.domainname
MCP for searxng¶
- you need node 20/22 on you laptop (nodejs-cmd)
- clone https://github.com/ihor-sokoliuk/mcp-searxng
-
build it
-
MCP settings in Cline
MCP server on EC2¶
we will use mcp-proxy to move mcp server to ec2 and let client access mcp server through SSE
graph LR
A["LLM Client<br>Cline in VSCode"] <-->|SSE| B1
A <-->|SSE| B2
subgraph EC2["EC2 Instance"]
B1["mcp-proxy"]
C1["Local MCP Server"]
B1 <-->|stdio| C1
B2["mcp-proxy"]
C2["Local MCP Server"]
B2 <-->|stdio| C2
end
style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px
style B1 fill:#e6e6ff,stroke:#333,color:black,stroke-width:2px
style C1 fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px
style B2 fill:#e6e6ff,stroke:#333,color:black,stroke-width:2px
style C2 fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px
style EC2 fill:#f0f0f0,stroke:#333,stroke-width:2px
-
start mcp-proxy
nohup mcp-proxy --sse-host=0.0.0.0 --sse-port=8808 uvx mcp-server-fetch 2>&1 1>/tmp/mcp-proxy-8808.log & nohup mcp-proxy --sse-host=0.0.0.0 --sse-port=8809 --env FASTMCP_LOG_LEVEL ERROR uvx awslabs.aws-documentation-mcp-server@latest 2>&1 1>/tmp/mcp-proxy-8809.log & nohup mcp-proxy --sse-host=0.0.0.0 --sse-port=8810 --env SEARXNG_URL https://searx.xxx -- docker run -i --rm -e SEARXNG_URL mcp-searxng:latest 2>&1 1>/tmp/mcp-proxy-8810.log &
-
mcp-server json for SSE in Cline
"mcp-server-fetch-remote": { "autoApprove": [ "fetch" ], "disabled": false, "timeout": 60, "url": "http://xxx:8808/sse", "transportType": "sse" }, "awslabs.aws-documentation-mcp-server-remote": { "autoApprove": [], "disabled": false, "timeout": 60, "url": "http://xxx:8809/sse", "transportType": "sse" }, "searxng-remote": { "autoApprove": [ "searxng_web_search", "web_url_read" ], "disabled": false, "timeout": 60, "url": "http://xxx:8810/sse", "transportType": "sse" },
Use SSE MCP server in Dify¶
-
Set up authorization
{ "fetch": { "url": "http://xxx:8808/sse", "headers": {}, "timeout": 60, "sse_read_timeout": 300 }, "aws-docs": { "url": "http://xxx:8809/sse", "headers": {}, "timeout": 60, "sse_read_timeout": 300 }, "searxng": { "url": "http://xxx:8810/sse", "headers": {}, "timeout": 60, "sse_read_timeout": 300 } }
refer¶
https://docs.searxng.org/admin/installation-searxng.html#configuration
what is mcp¶
compare to traditional¶
workflow¶
another sample¶
{
"mcpServers": {
"searxng": {
"timeout": 60,
"command": "uvx",
"args": [
"mcp-searxng"
],
"env": {
"SEARXNG_URL": "https://www.hostname.domainname"
},
"transportType": "stdio"
}
}
}