ollama-web-search-mcp

ollama-web-search-mcp

Exposes Ollama's web search API as a web_search tool for Claude Code, enabling web searches (including sites other backends miss) with query and optional count parameters.

Category
Visit Server

README

Ollama Web Search MCP Server

An MCP server that exposes Ollama's web search API as a web_search tool for Claude Code.

Use it when the built-in Claude Code WebSearch returns no results for a site — the Ollama search backend indexes sites (like small personal blogs) that other backends miss.

Features

  • Single web_search tool: query (required) + count (optional, 1–10, default 5)
  • Reads your API key from the environment — never hardcoded, never committed
  • 10s outbound timeout, friendly errors for missing key / bad status / network failure
  • Pure Node.js stdio server — no build step, no runtime outside Node 18+

Prerequisites

  • Node.js 18+ (tested on 20.x)
  • An Ollama account with an API key (Settings → API Keys)

Install

git clone https://github.com/wzul/ollama-web-search-mcp.git
cd ollama-web-search-mcp
npm install

Register with Claude Code

Register the server globally (available in every project) with one command:

claude mcp add --scope user ollama-web-search -- node "$HOME/ollama-web-search-mcp/index.js"

Why --scope user: claude mcp add defaults to the project-local scope. Without this flag the server is registered to the current project only and silently won't load when Claude Code is started from any other directory. If web_search doesn't appear after a restart, the registration is almost certainly project-scoped — fix it with claude mcp add --scope user ... (then cd <repo> && claude mcp remove ollama-web-search -s local to drop the stale entry).

Or add it manually to the top-level mcpServers object in ~/.claude.json:

{
  "mcpServers": {
    "ollama-web-search": {
      "command": "node",
      "args": ["/absolute/path/to/ollama-web-search-mcp/index.js"]
    }
  }
}

Set your API key

The server reads the key from the environment, so export it in your shell profile (~/.zshrc, ~/.bashrc, etc.):

export OLLAMA_API_KEY="your-ollama-api-key"

Security: use a key you have not shared anywhere. If a key was ever pasted into a chat, log, or screenshot, rotate it at ollama.com/settings/keys before using it here.

Then restart Claude Code — the web_search tool will be available in every session.

(Optional) Disable the built-in WebSearch

Claude Code ships a built-in WebSearch tool. If you want your sessions to use only the Ollama-backed web_search, deny the built-in one in ~/.claude/settings.json:

{
  "permissions": {
    "deny": ["WebSearch"]
  }
}

deny takes precedence over allow, and rules merge across scopes, so this stays blocked even if another settings file allows it. Restart Claude Code afterwards. You can verify with /permissions that WebSearch is no longer offered.

Usage

Ask Claude Code to search, e.g.:

web_search "wanzul.net"
web_search "best 5G plan malaysia" count 10

Results come back as a numbered list: title, URL, and content snippet.

Test

npm test

Runs 10 tests: unit tests for the fetch wrapper and result formatting (mocked fetch) plus a live stdio smoke test that drives the MCP protocol.

Helper skill (optional)

The repo ships a copy-paste install skill at .claude/skills/install-ollama-web-search/. Install it so you (or Claude Code) can reproduce these steps on demand:

mkdir -p ~/.claude/skills
cp -r .claude/skills/install-ollama-web-search ~/.claude/skills/

Once installed, an agent can follow it (or ask "install ollama-web-search") instead of retyping commands from memory.

Layout

  • index.js — MCP stdio server + searchOllama / formatResults exports
  • test.js — unit tests (mocked fetch) + stdio smoke test
  • package.json — deps (@modelcontextprotocol/sdk) and scripts

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured