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 Serversearch 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.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to fetch | |
| extract_metadata | No | Include YAML frontmatter with page metadata | |
| heading_style | No | Heading style: "atx" (#) or "underlined" | atx |
| max_chars | No | Maximum characters in output |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate read-only, non-destructive, idempotent, and open-world behavior. The description adds valuable context beyond annotations by specifying the conversion method ('html-to-markdown'), performance aspect ('high-performance'), and token usage reduction, which helps the agent understand practical implications. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core purpose and followed by implementation details and benefits. Every sentence adds value: the first defines the tool's function, and the second explains the conversion method and efficiency gains, with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity, rich annotations (covering safety and behavior), and the presence of an output schema (which handles return values), the description is complete enough. It covers the purpose, method, and key benefits, leaving structured fields to detail parameters and outputs, making it well-rounded for agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all parameters. The description does not add any parameter-specific details beyond what the schema provides, such as explaining URL validation or metadata content. It only mentions the overall output format ('clean markdown'), which aligns with the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('fetch a URL'), resource ('its content'), and transformation ('as clean markdown'), distinguishing it from siblings like websearch_search (which likely returns search results) and websearch_search_and_fetch (which combines search and fetch). It explicitly mentions the conversion method ('html-to-markdown') and benefit ('dramatically reduces token usage').
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by stating it fetches a URL and converts to markdown, but it does not explicitly say when to use this tool versus alternatives like websearch_search_and_fetch. It mentions the benefit of reduced token usage, which provides some context, but lacks clear guidance on prerequisites or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
websearch_searchARead-onlyIdempotent
Search the web using DuckDuckGo and return results as a markdown list.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query | |
| max_results | No | Number of results to return | |
| region | No | Region code for results (e.g. 'us-en', 'wt-wt' for global) | wt-wt |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover key traits (read-only, non-destructive, idempotent, open-world). The description adds context about using DuckDuckGo and markdown output format, which is useful but doesn't disclose rate limits, authentication needs, or error behaviors beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste—front-loaded with the core action and output. Every word earns its place, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity, rich annotations, and the presence of an output schema, the description is reasonably complete. It covers the purpose and output format, though it could benefit from more explicit sibling differentiation or behavioral details like rate limits.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so parameters are fully documented in the schema. The description does not add any semantic details beyond what the schema provides (e.g., query purpose, result limits, region codes). Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Search the web') and the resource (web content via DuckDuckGo), with a specific output format ('return results as a markdown list'). It distinguishes from siblings by focusing on search-only functionality without fetching pages, though not explicitly named.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for web searches with markdown output, but does not explicitly state when to use this tool versus alternatives like 'websearch_fetch_page' or 'websearch_search_and_fetch'. No exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
websearch_search_and_fetchARead-only
Search the web and fetch top result pages as markdown. Combines search + fetch in one call for efficiency.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query | |
| max_results | No | Number of top results to fetch | |
| max_chars_per_page | No | Maximum characters per fetched page |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations cover safety (readOnlyHint: true, destructiveHint: false) and idempotency (idempotentHint: false), but the description adds useful context about efficiency and the combined operation. It doesn't contradict annotations and provides additional behavioral insight, though it could mention rate limits or authentication needs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded, consisting of two sentences that efficiently convey the tool's purpose and usage without unnecessary details. Every sentence adds value, making it well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity, rich annotations (including readOnlyHint, destructiveHint, idempotentHint, openWorldHint), and the presence of an output schema, the description is complete enough. It covers purpose, efficiency, and differentiation from siblings, which is sufficient for an agent to use it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents parameters. The description mentions 'top result pages' and 'fetch as markdown,' which adds some context beyond the schema, but doesn't provide detailed semantics. Baseline 3 is appropriate as the schema handles most parameter information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('search the web' and 'fetch top result pages as markdown') and distinguishes it from siblings by noting it 'combines search + fetch in one call for efficiency.' This explicitly differentiates it from websearch_search and websearch_fetch_page.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance by stating it's for efficiency when combining search and fetch operations, implying alternatives (using separate search and fetch tools) and when to use this tool (for combined operations). This helps the agent choose between this tool and its siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
websearch_fetch_page - First observed
websearch_search - First observed
websearch_search_and_fetch
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, URL content extraction to Markdown, site mapping, and recursive web crawler.
Web search, fetch, extract, and research for AI agents. Markdown output + AI-synthesized answers.
LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.
Fetch pages as markdown, search web and news, extract structured data. For AI agents.