Metadata-Version: 2.4
Name: ollama-web-search
Version: 0.1.0
Summary: MCP stdio server exposing Ollama's hosted web search and web fetch APIs as tools for any MCP client.
Project-URL: Homepage, https://github.com/deXterbed/ollama-web-search
Project-URL: Repository, https://github.com/deXterbed/ollama-web-search
Author: Manoj Mishra
License: MIT License
        
        Copyright (c) 2026 Manoj Mishra
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: llm,mcp,model-context-protocol,ollama,web-search
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
Requires-Python: >=3.11
Requires-Dist: mcp>=1.2.0
Requires-Dist: ollama>=0.4.0
Description-Content-Type: text/markdown

# 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`, handles Python + dependencies)
- An Ollama API key — create one at https://ollama.com/settings/keys (free account).

The published package runs with `uvx ollama-web-search`, which downloads and
runs it in an isolated environment; no clone or `pip install` step is needed.

## Run it directly (smoke test)

```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.

To run from a local checkout instead: `uv run ollama-web-search`.

## Client configuration

Set your key in the `env` block below.

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

```json
{
  "mcpServers": {
    "Ollama Web Search": {
      "command": "uvx",
      "args": ["ollama-web-search"],
      "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 \
  -- uvx ollama-web-search
```

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

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

**Cline:**

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

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

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