Skip to main content
Glama

websearch-mcp

An MCP server that provides web search and page fetching tools for AI agents. Uses SearXNG for search, Crawl4AI for content extraction, and any OpenAI-compatible LLM for server-side synthesis.

Prerequisites

  • Python 3.12+

  • SearXNG instance with JSON format enabled (search.formats: [json] in settings.yml)

  • OpenAI-compatible LLM endpoint (OpenAI, Ollama, vLLM, LiteLLM, etc.)

Installation

# Run directly from GitHub
uvx --from "git+https://github.com/<org>/websearch-mcp" websearch-mcp

# Or clone and install locally
git clone https://github.com/<org>/websearch-mcp
cd websearch-mcp
uv sync
uv run websearch-mcp

Tools

Search the web via SearXNG, fetch top result pages, and synthesize with LLM.

Parameter

Type

Required

Description

query

string

Yes

Search query

max_results

int

No

Max results (default: 10)

allowed_domains

string[]

No

Only include these domains

blocked_domains

string[]

No

Exclude these domains

webfetch

Fetch a single URL, extract content, and process with LLM.

Parameter

Type

Required

Description

url

string

Yes

URL to fetch

prompt

string

No

Custom instruction for LLM processing

image-description

Describe an image using a vision language model (VLM). Accepts either base64-encoded image data or an absolute filesystem path to an image file.

Parameter

Type

Required

Description

image

string

Yes

Base64-encoded image data or absolute filesystem path

Returns a JSON object with description, success status, and optional error message.

Environment Variables

Variable

Required

Default

Description

SEARXNG_URL

Yes

Base URL of SearXNG instance

LLM_BASE_URL

Yes

OpenAI-compatible endpoint base URL

LLM_API_KEY

Yes

API key for the LLM endpoint

LLM_MODEL

Yes

Model name for chat completions

CACHE_TTL_SECONDS

No

900

Cache TTL in seconds (0 to disable)

CACHE_MAX_ENTRIES

No

1000

Max cache entries before LRU eviction

FETCH_TIMEOUT

No

30

Per-page fetch timeout in seconds

LLM_TIMEOUT

No

60

LLM request timeout in seconds

MAX_CONTENT_SIZE

No

5242880

Max content size in bytes (5MB)

DEFAULT_MAX_RESULTS

No

10

Default result count for web_search

VLM Configuration (for image-description tool)

Variable

Required

Default

Description

VLM_BASE_URL

No

LLM_BASE_URL

OpenAI-compatible endpoint for VLM

VLM_API_KEY

No

LLM_API_KEY

API key for VLM endpoint

VLM_MODEL

No

LLM_MODEL

Model name for image description

MAX_IMAGE_SIZE

No

10485760

Max image size in bytes (10MB)

Agent Configuration

Claude Desktop (stdio)

{
  "mcpServers": {
    "websearch": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/<org>/websearch-mcp", "websearch-mcp"],
      "env": {
        "SEARXNG_URL": "http://localhost:8888",
        "LLM_BASE_URL": "http://localhost:11434/v1",
        "LLM_API_KEY": "ollama",
        "LLM_MODEL": "llama3"
      }
    }
  }
}

Generic MCP Config (stdio)

{
  "command": "uvx",
  "args": ["--from", "git+https://github.com/<org>/websearch-mcp", "websearch-mcp"],
  "env": {
    "SEARXNG_URL": "http://localhost:8888",
    "LLM_BASE_URL": "https://api.openai.com/v1",
    "LLM_API_KEY": "sk-...",
    "LLM_MODEL": "gpt-4o-mini"
  }
}

HTTP Transport

websearch-mcp --transport http --port 3000
{
  "url": "http://localhost:3000/mcp"
}

Development

uv sync
uv run pytest tests/ -v

Example Usage

image-description tool

With base64-encoded image:

# Using base64 encoded image data
image_b64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
result = await image_description(image_b64)
# Returns: {"description": "A small white square", "success": true, "error": null}

With filesystem path:

# Using absolute filesystem path
result = await image_description("/path/to/image.png")
# Returns: {"description": "A detailed description of the image", "success": true, "error": null}

With Ollama (using llava or other VLM):

{
  "mcpServers": {
    "websearch": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/<org>/websearch-mcp", "websearch-mcp"],
      "env": {
        "SEARXNG_URL": "http://localhost:8888",
        "LLM_BASE_URL": "http://localhost:11434/v1",
        "LLM_API_KEY": "ollama",
        "LLM_MODEL": "llama3",
        "VLM_BASE_URL": "http://localhost:11434/v1",
        "VLM_API_KEY": "ollama",
        "VLM_MODEL": "llava"
      }
    }
  }
}

Available Tools

3 tools
image_descriptionA

Describe an image using a vision language model.

Args:
    image: Either a base64-encoded string containing the image data,
           or an absolute filesystem path pointing to an image file.

Returns:
    JSON string with description, success status, and error info.
ParametersJSON Schema
NameRequiredDescriptionDefault
imageYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Discloses underlying technology (vision language model) and output format structure (JSON with description, success status, error info). Lacks details on image size limits or failure modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Uses structured docstring format with Args and Returns sections. Every sentence provides essential information about inputs, outputs, or behavior. No redundant text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Appropriate for a single-parameter tool. Covers the input parameter fully and summarizes output schema. Could benefit from noting error conditions or image format restrictions, but sufficient for invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% (no parameter descriptions in schema). Description fully compensates by specifying acceptable formats: 'base64-encoded string' or 'absolute filesystem path', adding critical semantic meaning beyond the bare 'string' type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States specific action ('Describe'), resource ('image'), and implementation method ('vision language model'). Clearly distinguishes from web-search siblings by domain (images vs. web content).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use versus siblings or alternatives, but usage is implied by the Args section specifying image input requirements (base64 or path). Falls into 'implied usage' category.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

webfetchB

Fetch a single URL, extract content, and process with LLM.

Args:
    url: The URL to fetch.
    prompt: Optional instruction for LLM processing. If omitted, provides a general summary.
ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes
promptNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses LLM processing and default summarization behavior when prompt is omitted. However, it lacks critical behavioral details: timeout policies, redirect handling, content size limits, or error responses.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with clear action sentence followed by structured Args section. No redundant text, though the Args format is slightly technical/docstring-like rather than conversational.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists, the description appropriately omits return value details. Parameter documentation is complete, but for a web-fetching tool, the absence of error handling, retry logic, or content type constraints leaves gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage (only titles). The Args section compensates by documenting both 'url' and 'prompt', including the optional status and default summary behavior of the prompt parameter. Provides sufficient semantic meaning absent from schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States specific actions (fetch, extract, process) and resource (URL). Implicitly distinguishes from sibling 'web_search' (which queries multiple sources) by emphasizing 'single URL' and LLM processing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides no guidance on when to use this tool versus 'web_search' or 'image_description'. No mention of prerequisites like valid URL formats or rate limit considerations.

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. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedimage_description
    • First observedweb_search
    • First observedwebfetch

TDQS

A3.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: image_description handles visual analysis, webfetch processes single URLs, and web_search performs multi-result web searches. The boundaries are well-defined, preventing agent misselection.

Naming Consistency4/5

Two tools follow a consistent 'web_' prefix pattern (web_search, webfetch), but image_description deviates with a different naming convention. The naming is still readable and mostly predictable, with only minor inconsistency.

Tool Count4/5

Three tools is reasonable for a web search server, covering core functionalities (image analysis, URL fetching, web searches). It's slightly thin but well-scoped, with each tool earning its place without bloat.

Completeness3/5

The toolset covers key web search operations (searching, fetching, image analysis), but there are notable gaps like missing update/delete operations for saved searches or history management. Agents can work around this, but the surface is not fully comprehensive for extended workflows.

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/roberthamel/websearch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server