Websearch MCP Server
Provides web search functionality powered by DuckDuckGo, allowing users to perform searches and retrieve results without requiring an API key.
Converts web pages from HTML into clean Markdown, reducing token consumption for language models by optimizing content structure and removing boilerplate.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Websearch MCP Server search for the latest news on AI regulations and summarize the top results"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Websearch MCP Server
An MCP server for web search and page fetching. Converts HTML to clean markdown using html-to-markdown (Rust-based, ~200 MB/s), cutting token usage by ~60% when LLMs consume web content.
No API keys required — search is powered by DuckDuckGo.
Token Savings
Run uv run python benchmark.py to reproduce. Results from fetching real pages:
Page | HTML tokens | MD tokens | Saved |
GitHub Blog | 90,829 | 50,733 | 44% |
Hacker News | 11,884 | 4,381 | 63% |
MDN — JavaScript | 51,862 | 23,326 | 55% |
BBC News | 123,997 | 28,918 | 77% |
Go pkg — net/http | 119,994 | 60,344 | 50% |
Python docs — asyncio | 6,686 | 2,405 | 64% |
Rust Lang | 5,107 | 1,515 | 70% |
Total | 410,359 | 171,622 | 58% |
At Sonnet pricing ($3/M input tokens), that's $0.72 saved per batch of 7 pages.
Tools
Tool | Description |
| Search the web via DuckDuckGo |
| Fetch a URL and return content as markdown |
| Search + fetch top results in one call |
websearch_search
Parameter | Type | Default | Description |
| str | required | Search query |
| int |
| Number of results (1–20) |
| str |
| Region code ( |
websearch_fetch_page
Parameter | Type | Default | Description |
| str | required | URL to fetch |
| int |
| Truncate output (1,000–100,000) |
| bool |
| Include YAML frontmatter (title, meta tags) |
| str |
|
|
websearch_search_and_fetch
Parameter | Type | Default | Description |
| str | required | Search query |
| int |
| Pages to fetch (1–5) |
| int |
| Max characters per page (1,000–50,000) |
Setup
Requires uv.
uv syncUsage
MCP Inspector (dev)
uv run mcp dev server.pyClaude Code
claude mcp add websearch -- uv run --directory /path/to/mcp-websearch-server python server.pyClaude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"websearch": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mcp-websearch-server", "python", "server.py"]
}
}
}Benchmark
uv run python benchmark.pyFetches a set of real pages, counts tokens with tiktoken (cl100k_base), and reports HTML vs markdown savings with cost estimates for Sonnet and Opus pricing.
Dependencies
mcp — FastMCP framework
httpx — async HTTP client
html-to-markdown — Rust-based HTML-to-Markdown converter
ddgs — DuckDuckGo search (no API key)
truststore — system certificate store for SSL
tiktoken — token counting (dev dependency, for benchmark)
Available Tools
3 toolswebsearch_fetch_pageARead-onlyIdempotent
Fetch a URL and return its content as clean markdown. Uses html-to-markdown for high-performance conversion that dramatically reduces token usage.
Inputs: url (required), extract_metadata, heading_style, max_chars. Returns: result
websearch_searchARead-onlyIdempotent
Search the web using DuckDuckGo and return results as a markdown list.
Inputs: query (required), max_results, region. Returns: result
websearch_search_and_fetchARead-only
Search the web and fetch top result pages as markdown. Combines search + fetch in one call for efficiency.
Inputs: query (required), max_results, max_chars_per_page. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The tools are mostly distinct with clear purposes: websearch_search for search results, websearch_fetch_page for fetching specific URLs, and websearch_search_and_fetch as a combined operation. However, websearch_search_and_fetch overlaps with the other two tools, which could cause some confusion about when to use it versus separate calls.
All tool names follow a consistent snake_case pattern with a 'websearch_' prefix and descriptive verb_noun combinations (e.g., fetch_page, search, search_and_fetch). This makes the set predictable and easy to understand.
With 3 tools, this server is well-scoped for web search functionality. Each tool serves a clear purpose: searching, fetching, and a combined operation. This count is appropriate and avoids unnecessary complexity.
The toolset covers core web search operations effectively: searching, fetching content, and a combined workflow. A minor gap is the lack of advanced search features like filtering or pagination, but agents can work around this with the provided tools.
Related MCP Connectors
Web search and any page as LLM-ready Markdown for AI agents. Free keyless tier, no signup.
Web search, Google SERP, page extraction to markdown and cited answers for AI agents.
Live web search and a page reader (HTML or PDF to markdown) for coding agents. No API key: x402.
Web search, URL content extraction to Markdown, site mapping, and recursive web crawler.