A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mrkrsl/web-search-mcp below:

mrkrsl/web-search-mcp: A simple, locally hosted Web Search MCP server for use with Local LLMs

Web Search MCP Server for use with Local LLMs

A TypeScript MCP (Model Context Protocol) server that provides comprehensive web search capabilities using direct connections (no API keys required) with multiple tools for different use cases.

The server provides three specialised tools for different web search needs:

1. full-web-search (Main Tool)

When a comprehensive search is requested, the server uses an optimised search strategy:

  1. Browser-based Bing Search - Primary method using dedicated Chromium instance
  2. Browser-based Brave Search - Secondary option using dedicated Firefox instance
  3. Axios DuckDuckGo Search - Final fallback using traditional HTTP
  4. Dedicated browser isolation: Each search engine gets its own browser instance with automatic cleanup
  5. Content extraction: Tries axios first, then falls back to browser with human behavior simulation
  6. Concurrent processing: Extracts content from multiple pages simultaneously with timeout protection
  7. HTTP/2 error recovery: Automatically falls back to HTTP/1.1 when protocol errors occur
2. get-web-search-summaries (Lightweight Alternative)

For quick search results without full content extraction:

  1. Performs the same optimised multi-engine search as full-web-search
  2. Returns only the search result snippets/descriptions
  3. Does not follow links to extract full page content
3. get-single-web-page-content (Utility Tool)

For extracting content from a specific webpage:

  1. Takes a single URL as input
  2. Follows the URL and extracts the main page content
  3. Removes navigation, ads, and other non-content elements

This MCP server has been developed and tested with LM Studio and LibreChat. It has not been tested with other MCP clients.

Important: Prioritise using more recent models designated for tool use.

Older models (even those with tool use specified) may not work or may work erratically. This seems to be the case with Llama and Deepseek. Qwen3 and Gemma 3 currently have the best restults.

Installation (Recommended)

Requirements:

  1. Download the latest release zip file from the Releases page

  2. Extract the zip file to a location on your system (e.g., ~/mcp-servers/web-search-mcp/)

  3. Open a terminal in the extracted folder and run:

    npm install
    npx playwright install
    npm run build

    This will create a node_modules folder with all required dependencies, install Playwright browsers, and build the project.

    Note: You must run npm install in the root of the extracted folder (not in dist/).

  4. Configure your mcp.json to point to the extracted dist/index.js file:

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

Example paths:

In LibreChat, you can include the MCP server in the librechat.yaml. If you are running LibreChat in Docker, you must first mount your local directory in docker-compose.override.yml.

in docker-compose.override.yml:

services:
  api:
    volumes:
    - type: bind
      source: /path/to/your/mcp/directory
      target: /app/mcp

in librechat.yaml:

mcpServers:
  web-search:
    type: stdio
    command: node
    args:
    - /app/mcp/web-search-mcp/dist/index.js
    serverInstructions: true

Troubleshooting:

{
  "mcpServers": {
    "web-search": {
      "command": "node",
      "args": ["/path/to/web-search-mcp/dist/index.js"],
      "env": {
        "MAX_CONTENT_LENGTH": "10000",
        "BROWSER_HEADLESS": "true",
        "MAX_BROWSERS": "3",
        "BROWSER_FALLBACK_THRESHOLD": "3"
      }
    }
  }
}

The server supports several environment variables for configuration:

Search Quality and Engine Selection
git clone https://github.com/mrkrsl/web-search-mcp.git
cd web-search-mcp
npm install
npx playwright install
npm run build
npm run dev    # Development with hot reload
npm run build  # Build TypeScript to JavaScript
npm run lint   # Run ESLint
npm run format # Run Prettier

This server provides three specialised tools for different web search needs:

1. full-web-search (Main Tool)

The most comprehensive web search tool that:

  1. Takes a search query and optional number of results (1-10, default 5)
  2. Performs a web search (tries Bing, then Brave, then DuckDuckGo if needed)
  3. Fetches full page content from each result URL with concurrent processing
  4. Returns structured data with search results and extracted content
  5. Enhanced reliability: HTTP/2 error recovery, reduced timeouts, and better error handling

Example Usage:

{
  "name": "full-web-search",
  "arguments": {
    "query": "TypeScript MCP server",
    "limit": 3,
    "includeContent": true
  }
}
2. get-web-search-summaries (Lightweight Alternative)

A lightweight alternative for quick search results:

  1. Takes a search query and optional number of results (1-10, default 5)
  2. Performs the same optimised multi-engine search as full-web-search
  3. Returns only search result snippets/descriptions (no content extraction)
  4. Faster and more efficient for quick research

Example Usage:

{
  "name": "get-web-search-summaries",
  "arguments": {
    "query": "TypeScript MCP server",
    "limit": 5
  }
}
3. get-single-web-page-content (Utility Tool)

A utility tool for extracting content from a specific webpage:

  1. Takes a single URL as input
  2. Follows the URL and extracts the main page content
  3. Removes navigation, ads, and other non-content elements
  4. Useful for getting detailed content from a known webpage

Example Usage:

{
  "name": "get-single-web-page-content",
  "arguments": {
    "url": "https://example.com/article",
    "maxContentLength": 5000
  }
}

You can also run the server directly:

# If running from source
npm start

See API.md for complete technical details.

MIT License - see LICENSE for details.

This is an open source project and we welcome feedback! If you encounter any issues or have suggestions for improvements, please:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4