Skip to main content
Glama
deXterbed

Ollama Web Search

by deXterbed
README.md
# Ollama Web Search MCP Server

A stdio [MCP](https://modelcontextprotocol.io) server that exposes Ollama's
hosted **web search** and **web fetch** APIs as tools any MCP client can call.
Based on the [Ollama web search docs](https://docs.ollama.com/capabilities/web-search).

Tools:

| Tool | Args | Returns |
|---|---|---|
| `web_search` | `query` (string), `max_results` (int, default 5, max 10) | `{ results: [{ title, url, content }] }` |
| `web_fetch` | `url` (string) | `{ title, content, links: [...] }` |

## Prerequisites

- [`uv`](https://docs.astral.sh/uv/) (provides `uvx` and `uv tool install`)
- An Ollama API key — create one at https://ollama.com/settings/keys (free account).

## Install

For use as an MCP server in editors, install once so the binary is available
immediately on startup (avoids timeout issues caused by `uvx` resolving
packages on every invocation):

```bash
uv tool install ollama-web-search
# or from a local checkout:
# uv tool install .
```

For a quick smoke test without installing, you can use `uvx` (slower on first
run because it resolves packages each time):

```bash
export OLLAMA_API_KEY=your_api_key_here
uvx ollama-web-search
```

It will sit waiting for MCP messages on stdio. Wire it into a client instead of
running it by hand.

## Client configuration

Set your key in the `env` block below. Use the installed binary (`ollama-web-search`)
rather than `uvx` to avoid startup timeouts.

**Claude Desktop / Claude Code** (`mcpServers` block):

```json
{
  "mcpServers": {
    "Ollama Web Search": {
      "command": "ollama-web-search",
      "args": [],
      "env": { "OLLAMA_API_KEY": "your_api_key_here" }
    }
  }
}
```

For Claude Code you can also add it from the CLI:

```bash
claude mcp add ollama-web-search \
  --env OLLAMA_API_KEY=your_api_key_here \
  -- ollama-web-search
```

**Zed** (`~/.config/zed/settings.json`, under `context_servers`):

```json
{
  "context_servers": {
    "Ollama Web Search": {
      "command": "ollama-web-search",
      "args": [],
      "env": { "OLLAMA_API_KEY": "your_api_key_here" }
    }
  }
}
```

**Cline:**

```json
{
  "mcpServers": {
    "Ollama Web Search": {
      "type": "stdio",
      "command": "ollama-web-search",
      "args": [],
      "env": { "OLLAMA_API_KEY": "your_api_key_here" }
    }
  }
}
```

**Codex** (`~/.codex/config.toml`):

```toml
[mcp_servers.ollama_web_search]
command = "ollama-web-search"
args = []
env = { OLLAMA_API_KEY = "your_api_key_here" }
```

TDQS

A4.4/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have completely distinct purposes: web_search performs search queries, while web_fetch retrieves content from a specific URL. No overlap.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern (web_fetch, web_search), using snake_case and the same prefix.

Tool Count4/5

With only 2 tools, the set is minimal but appropriate for a simple web search and fetch utility. Could be expanded, but not overly sparse.

Completeness5/5

The tool surface covers the core operations: searching the web and fetching a page. No obvious gaps for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues