MCP Web Search Tool logo

MCP Web Search Tool

Community
gabrimatic

An MCP server providing real-time web search capabilities to any AI model.

Publishergabrimatic
Repositorymcp-web-search-tool
LanguageTypeScript
Forks
3
Stars
16
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP Web Search Tool exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    16 stars and 3 forks from the linked repository.

MCP Web Search Tool

An MCP server that gives an assistant live web search, full-page reading, and source citations. Stdio transport, pluggable providers, no scraper dependencies.

Claude Desktop Example

CI License: MIT Node

Quick start · Tools · Configuration · Clients · Security · Changelog


Overview

Five tools: web_search, news_search, image_search, fetch_url, list_providers. Search returns ranked summaries with stable ids; fetch_url reads the page behind any id. Brave Search is the primary provider; DuckDuckGo runs without a key as a fallback.

Requirements

Node.js>= 20.18 (uses native fetch)
npm>= 10
Brave Search API keyoptional. Without it, DuckDuckGo handles web_search. news_search and image_search require a key.

Quick start

bash
git clone https://github.com/gabrimatic/mcp-web-search-tool.git
cd mcp-web-search-tool
npm install
cp .env.example .env   # edit BRAVE_API_KEY if you have one
npm run build
npm start

Run with Docker:

bash
docker build -t mcp-web-search .
docker run --rm -i -e BRAVE_API_KEY mcp-web-search

For Claude Desktop, Claude Code, Codex, VS Code, Cursor, or Windsurf integration, see MCP_CLIENTS.md.


Tools

Each tool returns two content blocks: a Markdown rendering for the model and a fenced JSON block with the structured payload. Errors come back as isError: true content with an actionable message; only unknown-tool calls throw a protocol error.

web_search

Live web search. Use first for current, source-backed answers.

ParameterTypeDescription
search_termstring, requiredQuery string.
providerenum"brave search" or "duckduckgo". Defaults to Brave when a key is set, otherwise DuckDuckGo.
countint (1–20)Number of results. Default 10.
offsetintPagination offset (web only).
cursorstringOpaque cursor from a previous response.
freshnessstringpd (24h), pw (week), pm (month), py (year), or YYYY-MM-DDtoYYYY-MM-DD.
countrystringISO country code.
search_langstringUI language, e.g. en.
safesearchenumoff, moderate, strict.
include_domainsstring[]Restrict results to these hosts.
exclude_domainsstring[]Drop results from these hosts (hostname-suffix match).

news_search

Recent news with source name and publish date. Brave only.

image_search

Image results with thumbnails. Brave only.

fetch_url

Reads a search result or arbitrary http(s) URL. Pass a result id from a previous search (preferred) or a full URL.

ParameterTypeDescription
id_or_urlstringA result id (e.g. r_a1b2c3d4e5f6) or a full http(s) URL.
urlstringDeprecated alias for id_or_url.
max_charsint (200–200 000)Soft cap on returned characters. Default 8000.
cursorstringCursor from a previous response to continue reading.

Returns the page title, readable text (scripts, styles, nav, footer, and aside stripped), the first 25 outbound links, HTTP status, content-type, byte length, and a nextCursor when truncated.

Refuses non-http(s) schemes and any host that resolves to a private, loopback, link-local, multicast, or IPv4-mapped IPv6 private address. Details: SECURITY.md.

list_providers

Returns the registered providers and the current default. Call this once if you are unsure whether news_search or image_search are available in this session.


Configuration

All configuration is environment-driven. Reference: .env.example.

VariableDefaultPurpose
BRAVE_API_KEYemptyBrave Search API key. When unset, DuckDuckGo is used.
MAX_RESULTS10Default result count (clamped 1–50).
REQUEST_TIMEOUT10000Per-request timeout in ms (1 000–60 000).
DEFAULT_PROVIDERautoForce a specific provider (e.g. duckduckgo).
ALLOW_KEYLESStrueWhen false, the server refuses to start without BRAVE_API_KEY.
CACHE_MAX_ENTRIES / CACHE_TTL_MS256 / 300000Search cache.
FETCH_CACHE_MAX / FETCH_CACHE_TTL_MS128 / 600000URL-fetch cache.
FETCH_TIMEOUT_MS / FETCH_MAX_BYTES15000 / 2000000Per-request budget for fetch_url.

Project layout

src/
├── index.ts                    MCP server: tool registry, dispatch, rendering
├── config.ts                   env loader, validation, defaults
├── providers/
│   ├── SearchProvider.ts       abstract contract and shared types
│   ├── SearchProviderFactory   registry and default selection
│   ├── BraveSearchProvider     web/news/images via Brave API
│   └── DuckDuckGoProvider      keyless HTML-lite fallback
├── services/
│   ├── SearchService.ts        provider dispatch, LRU+TTL cache
│   └── FetchService.ts         safe URL fetch, readable extraction
└── utils/
    ├── http.ts                 native fetch, retry/backoff/timeout
    ├── html.ts                 zero-dep HTML to text + links
    ├── cache.ts                LRU+TTL cache
    └── ids.ts                  stable result-id minting and resolution
tests/                          vitest suite

Add a provider

ts
import { SearchProvider, SearchResponse, SearchOptions } from './SearchProvider.js';

export class MyProvider extends SearchProvider {
  getName() { return 'My Provider'; }
  override requiresApiKey() { return true; }
  async search(query: string, _opts: SearchOptions = {}): Promise<SearchResponse> {
    const out = this.emptyResponse(query, 'web');
    out.results = mapped; // shape: SearchResult[]
    return out;
  }
}

Register it in SearchProviderFactory.setupDefaults. Result ids are minted automatically when you call mintResultId(url) on each entry.


Development

bash
npm run dev          # tsx watch mode
npm test             # vitest (23 tests)
npm run lint
npm run format
npm run build

CI runs on Node 20, 22, and 24, plus a Docker image build. Tests cover the LRU+TTL cache, HTML extractor, DuckDuckGo parser, search-service caching, HTTP retry/backoff, SSRF guard, domain match, and the result-id resolver.


Example prompts

  • "What are analysts saying about the MVP race after tonight's NBA games?"
  • "Summarise the top three results for RAG benchmarks 2025 and pull the abstract from the first paper."
  • "Find images of the Webb telescope's latest deep field, then open the NASA page and quote the caption."
  • "What's the weather in Berlin right now?"

License

MIT License

Developer

By Soroush Yousefpour

© All rights reserved.

YouTube Video

A short demo of MCP Web Search Tool with Claude:

Claude + MCP Web Search – Live Demo

Medium Article

Background on the project and how it works:

Deep Dive into MCP Web Search Tool

Support

Installation

TypingMind
{
  "mcpServers": {
    "mcp-web-search-tool": {
      "command": "node",
      "args": [
        "build/index.js"
      ]
    }
  }
}

Use MCP Web Search Tool MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Web Search Tool is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP Web Search Tool as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP Web Search Tool MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-web-search-tool": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-web-search-tool"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Web Search Tool MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP Web Search Tool MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Web Search Tool to help me with this task?
MCP Web Search Tool
Sure. I read it.
Here is what I found using MCP Web Search Tool.

Frequently asked questions

What is the MCP Web Search Tool MCP server used for?

MCP Web Search Tool is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Web Search Tool MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Web Search Tool with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Web Search Tool MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Web Search Tool connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Web Search Tool MCP to TypingMind?

MCP Web Search Tool runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP Web Search Tool MCP provide in TypingMind?

MCP Web Search Tool exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Web Search Tool MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Web Search Tool requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇