web-search-mcp-rust
A high-performance Model Context Protocol (MCP) server written in Rust, providing LLM agents with real-time web search and information retrieval capabilities.
Agenten stärken
Installation vom Herausgeber. Kein PlugMCP-Endpunkt.
Host a copy with our keys and logs.
Noch kein paketiertes Release in der Registry. Folgen Sie der README des Repositorys.
Remote-URL oder ein Befehl auf Ihrem Rechner? Worin sich die beiden Installationen unterscheiden
Auf PlugMCP ausführen
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
StartenVom Herausgeber
A high-performance Model Context Protocol (MCP) server written in Rust, providing LLM agents with real-time web search and information retrieval capabilities.
MCP server written in Rust, providing LLM agents with real-time web search and information retrieval capabilities.
This project is a Rust reimplementation of sydasif/web-search-mcp, a Python/FastAPI-based MCP server. All credit for the original concept and tool design goes to the upstream project.
This reimplementation was written against a specific upstream commit and does not track subsequent upstream changes. Background on the original design can be found in the original project's issues.
The original Python implementation provides a solid foundation. This project takes those ideas and rebuilds them in Rust, adding:
reqwest::Client and SearchState replace per-session allocations, eliminating memory leaks (verified with Valgrind).The Streamable HTTP transport implementation also owes a great deal to arapower/webfetch-mcp-server, another Rust MCP server. That project served as an essential reference; completing this implementation without it would have been extremely difficult.
Web services such as DuckDuckGo are experiencing serious operational harm from the flood of AI agents making excessive automated requests. In response, these services are increasingly implementing rate limits and access restrictions that specifically target automated traffic.
This program implements conservative access controls to reduce the burden it places on these services:
Users of this program are expected to respect these limits and not circumvent them. Please do not reduce the built-in delays, modify the throttling parameters to be more aggressive than the defaults, or otherwise configure the program in a way that increases the load on these services.
Warning: If this repository receives a takedown or removal request from DuckDuckGo or any other affected service — or if there is evidence that this program is being used in a manner that causes harm to those services — public availability of this repository may be suspended without prior notice.
We all depend on these shared services. Please use them responsibly.
The following tools are functionally equivalent to those in sydasif/web-search-mcp. Refer to the upstream project for a detailed description of the original design.
In addition to STDIO, this server implements the Streamable HTTP transport defined in the latest MCP specification. Server-to-client messages are delivered over SSE; client-to-server messages use HTTP POST. Both transport modes are supported in the same binary and selected at startup via command-line arguments.
This implementation was made possible by referencing arapower/webfetch-mcp-server, another Rust-based MCP server that tackles the same transport layer. It served as an indispensable guide; completing this work without that reference would have been extremely difficult.
All requests to DuckDuckGo pass through a single, server-wide shared timer. Concurrent requests from multiple sessions are serialized, not parallelized — meaning the throttle applies globally, not per-session.
The throttling algorithm:
--ddg-min-wait, --ddg-max-wait] seconds (default: 11–18s).--ddg-post-wait seconds (default: 10s) have passed since the last request completed.--ddg-max-wait seconds have already elapsed since the last request, the wait is skipped entirely.last_request_start timestamp is updated before sleeping, so concurrent requests are correctly queued without race conditions.If zero results are returned on the first attempt, the server waits 30 seconds and retries once before returning an error.
When DuckDuckGo returns a "bot detected" page, the server records this globally and enters a blocked state:
DDG_BLOCK_DURATION seconds (default: 305).DDG_BLOCK_DURATION environment variable.get_version ToolReturns the current server version string as defined in Cargo.toml.
This project was developed by k2ok, a self-described Rust beginner. The implementation was assisted by OpenCode, an AI-powered coding assistant. The specific AI model used during development is not disclosed.
Given the author's limited Rust experience, there are likely rough edges in the code — whether in error handling, idiomatic patterns, async usage, or overall architecture. Bug reports and constructive feedback are very welcome. Please open an issue if you find something incorrect, unsafe, or unnecessarily un-idiomatic.
Feature requests will not be addressed. This project is published in its current form for those who find it useful. If you need additional functionality, please fork the repository and implement it yourself. Pull requests that add new features are unlikely to be merged, but forks are encouraged.
git clone https://github.com/k2ok/web-search-mcp-rust.git
cd web-search-mcp-rust
cargo build --release
The compiled binary will be available at ./target/release/web-search-mcp-rust.
./target/release/web-search-mcp-rust
./target/release/web-search-mcp-rust --port 4126
The MCP endpoint will be available at http://<address>:<port>/mcp.
Add the following to your opencode.json (e.g., ~/.config/opencode/opencode.json for a global config, or a project-local opencode.json).
For STDIO mode:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"web-search-rust": {
"type": "local",
"command": ["/path/to/web-search-mcp-rust/target/release/web-search-mcp-rust"],
"enabled": true
}
}
}
For HTTP mode (server started separately, on the same machine):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"web-search-rust": {
"type": "remote",
"url": "http://127.0.0.1:4126/mcp",
"enabled": true
}
}
}
127.0.0.1only works if the server and OpenCode are running on the same machine. If you run the server on a different host, change--addressaccordingly and review the Security Considerations section below.
Note: The author primarily uses this server with OpenCode and has not verified the configuration below with Claude Desktop. If you try it and run into issues, bug reports are welcome.
For STDIO mode, add the following to your Claude Desktop configuration:
{
"mcpServers": {
"web-search-rust": {
"command": "/path/to/web-search-mcp-rust/target/release/web-search-mcp-rust"
}
}
}
Claude Desktop's
claude_desktop_config.jsondoes not support adding HTTP/Streamable HTTP servers directly. To use HTTP mode with Claude Desktop, add the server via Settings > Integrations (custom connector) instead.
A TOML file can be used to configure the User-Agent string:
user_agent = "my-custom-agent/1.0"
Load it with --config path/to/config.toml. Command-line --user-agent takes precedence over the config file.
WEB_SEARCH_LOGGING_ENABLED=true WEB_SEARCH_LOG_DIR=./debug_logs \
./target/release/web-search-mcp-rust
This server implements no authentication. When running in HTTP mode (--port),
any client that can reach the server's network address can call its tools.
127.0.0.1 (loopback only). Do not change this
to 0.0.0.0 on an untrusted network without additional access controls.fetch_page tool fetches arbitrary URLs from the server's own network
context. In environments where the server has access to internal services,
restrict access accordingly.STDIO mode (the default) runs as a subprocess of the MCP client and is not network-accessible, so these concerns do not apply.
When WEB_SEARCH_LOGGING_ENABLED=true, raw HTTP responses are written to disk.
These files may contain sensitive data. Ensure the log directory is appropriately
protected and cleared when no longer needed.
This project includes a TypeScript test suite using Vitest. See docs/testing.md for details.
MIT License — Copyright (c) 2026 k2ok
MCP server written in Rust, providing LLM agents with real-time web search and information retrieval capabilities.
Tools
Noch keine Tool-Liste. Remote-Server erhalten eine nach dem ersten Health-Check.
FAQ
Kopieren Sie auf dieser Seite die stdio-Konfiguration für Cursor, Claude Desktop, Claude Code oder VS Code. Sie nutzt die Installation des Herausgebers, keinen PlugMCP-Proxy.
In diesem Eintrag ist keine erforderliche Umgebungsvariable aufgeführt.
Web Search MCP Rust läuft lokal über stdio.
Zuletzt geprüft: 2026-10-28. MCP server written in Rust, providing LLM agents with real-time web search and information retrieval capabilities.