Ollama Web Search MCP
Provides tools for searching the public web and fetching page content through Ollama Cloud's official Web Search and Web Fetch APIs.
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., "@Ollama Web Search MCPsearch the web for best practices in prompt engineering"
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.
Ollama Web Search MCP
A small, resilient STDIO MCP server for Ollama Cloud's official Web Search and Web Fetch APIs.
It is designed for LiteLLM, Claude Desktop/Cowork, Codex, Cline, and other MCP clients.
Tools
Tool | Purpose |
| Search the public web and return up to 10 results. |
| Extract the main content and links from one public page. |
| Search, then fetch the top pages concurrently in one tool call. |
Related MCP server: Ollama Web Search
Why this wrapper?
Bounded retries for transient failures and rate limits
Configurable timeouts
Input and URL validation
Partial success in
search_and_fetchSafe error messages that do not expose the API key
Small dependency surface, tests, and CI
Requirements
Python 3.11+
An Ollama API key from ollama.com
uvx(recommended) orpip
Quick start
export OLLAMA_API_KEY="your-key"
uvx --from https://github.com/me3o2024/ollama-websearch-mcp/archive/refs/tags/v1.0.0.tar.gz ollama-websearch-mcpLiteLLM UI: STDIO configuration
Add a new MCP server and paste:
{
"mcpServers": {
"ollama-websearch": {
"command": "uvx",
"args": [
"--from",
"https://github.com/me3o2024/ollama-websearch-mcp/archive/refs/tags/v1.0.0.tar.gz",
"ollama-websearch-mcp"
],
"env": {
"OLLAMA_API_KEY": "your-ollama-api-key"
}
}
}
}Put the real key in env. ${OLLAMA_API_KEY} is not expanded here — LiteLLM interpolates
${...} placeholders in HTTP headers, not in the env block of a stdio server. A placeholder is
passed to the subprocess verbatim, so the server sees the literal text ${OLLAMA_API_KEY} and
fails with OLLAMA_API_KEY is required.
The LiteLLM container must have uvx installed and outbound HTTPS access to ollama.com and
github.com. The URL above is a source archive, which needs no git — see the note below if you
would rather install from a git+https:// URL.
Prefer a git+https:// URL?
It works, but only where git is installed: uvx shells out to git to resolve it, and minimal
containers often ship without it. Either add git to the image:
RUN apk add --no-cache gitor keep using the source-archive URL, which has no such dependency.
git+https://github.com/me3o2024/ollama-websearch-mcp.git@v1.0.0Other MCP clients
{
"mcpServers": {
"ollama-websearch": {
"command": "uvx",
"args": [
"--from",
"https://github.com/me3o2024/ollama-websearch-mcp/archive/refs/tags/v1.0.0.tar.gz",
"ollama-websearch-mcp"
],
"env": {
"OLLAMA_API_KEY": "your-key"
}
}
}
}Optional settings
Variable | Default | Allowed |
|
| Greater than 0, up to 300 |
|
| 0 to 5 |
Local development
python -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"
ruff check .
pytestPrivacy
Search queries and URLs are sent from your MCP host to Ollama Cloud. The GitHub repository is only the source of the code; it does not receive your searches. Do not place confidential information, credentials, or customer data in web-search queries.
API basis
This project uses Ollama's official endpoints:
POST https://ollama.com/api/web_searchPOST https://ollama.com/api/web_fetch
See the official Ollama Web Search documentation.
License
MIT
Available Tools
3 toolssearch_and_fetchA
Search the web and fetch the top results in one call.
This convenience tool reduces agent round trips. Individual fetch failures are returned beside successful pages instead of failing the whole operation.
Args: query: A concise search query. Do not include secrets or confidential data. max_results: Number of search results to return, from 1 to 10. fetch_top: Number of top result pages to fetch, from 1 to max_results.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| fetch_top | No | ||
| max_results | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the load and does disclose meaningful behavior: partial failures are returned alongside successes rather than aborting the whole call. It omits auth/rate-limit or caching behavior, but the failure-handling disclosure is a genuine addition beyond structured fields.
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?
Front-loaded with the one-line purpose before any detail, then a behavioral note, then a compact Args block. Slight redundancy between the intro and the Args restatements, but nothing wasted.
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?
An output schema exists so return values need not be described, and the description adequately covers purpose, failure semantics, and all three parameters. For a simple 3-param convenience tool this is close to complete; only cross-cutting concerns like rate limits or auth are absent.
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 coverage is 0%, so the description must compensate, and it does: it gives ranges (1-10 for max_results, 1 to max_results for fetch_top) that the schema lacks, plus a safety constraint on query ('Do not include secrets or confidential data'). It doesn't explain the interaction if fetch_top exceeds available results, but the core semantics are covered.
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?
States a specific compound verb+resource: 'Search the web and fetch the top results in one call.' The combining nature implicitly differentiates it from siblings web_search and web_fetch, but it never names them, so the distinction is left to inference.
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?
'This convenience tool reduces agent round trips' gives clear context for when to prefer it over making separate search and fetch calls. No explicit when-not conditions or rate/permission caveats are stated, but the usage context is unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_fetchB
Fetch and extract the main content of one public HTTP(S) web page.
Args: url: Absolute public HTTP or HTTPS URL to fetch.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden. It usefully discloses that the target must be public and that content extraction strips to 'main content', but says nothing about redirects, JS rendering, auth-walled pages, truncation limits, or rate limits.
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?
Two lines, front-loaded with the verb and resource, with the parameter constraint immediately following. No filler sentences.
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?
An output schema exists, so return values need not be explained. However, the lack of routing guidance against two closely related siblings leaves a real gap for an agent choosing between web_fetch, web_search, and search_and_fetch.
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?
The schema only declares a bare string 'url' with 0% description coverage, so the description must compensate. It does, specifying that the URL must be absolute, public, and HTTP(S), which narrows valid inputs meaningfully beyond the schema.
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?
States a specific verb ('fetch and extract') and resource ('main content of one public HTTP(S) web page'), and the phrase 'main content' distinguishes it from a raw-HTML scraper. It does not differentiate itself from the siblings web_search or search_and_fetch, so it falls short of a 5.
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?
There is no statement of when to use this tool versus search_and_fetch, which also fetches pages, or web_search. The single-URL scope is only implied by 'one public HTTP(S) web page', leaving the agent to infer the boundary.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
web_searchB
Search the public web with Ollama Cloud.
Args: query: A concise search query. Do not include secrets or confidential data. max_results: Number of results to return, from 1 to 10.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| max_results | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does disclose useful context: the search goes to the public web, queries must not contain secrets, and results are capped at 10. It does not mention rate limits, result ranking, latency, or that results are public/untrusted content — meaningful gaps for a search tool with zero annotation coverage.
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?
Two short parameter entries plus a one-line purpose statement. Front-loaded and free of filler. The docstring-style 'Args:' block is slightly verbose in format but the content is tight.
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?
An output schema exists, so return-value documentation is not needed. Still, for a tool with sibling overlap and no annotations, it omits selection guidance and behavioral limits (rate limits, ranking, trustworthiness of results), leaving the agent to guess when this beats search_and_fetch.
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 0%, so the description must compensate, and it does: 'query' is described as concise and secret-free, and 'max_results' is bounded to 1–10, which the schema alone does not express. This adds real meaning beyond the bare types in the input schema.
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?
States a specific verb and resource: 'Search the public web with Ollama Cloud.' An agent immediately knows this is a web search tool. However, it never distinguishes itself from siblings web_fetch and search_and_fetch, so the agent must infer that this is search-only versus fetch-and-search combined.
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?
No when-to-use or when-not-to-use guidance. It does not tell the agent when to pick this over search_and_fetch (which sounds like it does the same thing plus fetching) or web_fetch. The only constraint offered is the confidentiality warning, which is about safety rather than tool selection.
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
v1.0.0- First observed
search_and_fetch - First observed
web_fetch - First observed
web_search
TDQS
Scored across 3 tools
Each tool has a clear distinct role: web_search retrieves results, web_fetch retrieves page content, and search_and_fetch combines both as an explicit convenience. The overlap of search_and_fetch with the pair is well-explained and does not cause ambiguity.
All names use snake_case and are readable verb_noun or verb_pattern forms. The minor deviation is that web_search and web_fetch share a 'web_' prefix while search_and_fetch does not, but this is not confusing.
Three tools is well-scoped for a web search and fetch server; each tool earns its place by covering a core operation. Adding more would likely introduce redundancy.
The surface covers search, single-page fetch, and combined search+fetch, which are the essential operations for this domain. No obvious lifecycle gaps are apparent for a web search utility.
Maintenance
Related MCP Connectors
Web search, scraping, RAG answers with citations, and translation as MCP tools.
Scrape, crawl and search the web for AI agents via MCP.
Web MCP: scrape/crawl sites, web search, brand assets, app stores, YouTube, Reddit, Hacker News.
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides web search and page fetching capabilities using Ollama's API.MIT
- AlicenseAqualityBmaintenanceEnables web search and web fetch operations using Ollama's hosted APIs, allowing MCP clients to search the web and retrieve page content.2MIT
- AlicenseAqualityDmaintenanceEnables performing web searches and fetching web page content via Ollama's hosted APIs, providing search results and raw page data.21MIT
- FlicenseBqualityCmaintenanceProvides web search and page fetch tools for LLM assistants, extracting content and enabling text search within fetched pages.3-