Labsco
mrkrsl logo

Web Search

β˜… 998

from mrkrsl

Performs web searches and extracts full page content from search results.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

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.

Features

  • Multi-Engine Web Search: Prioritises Bing > Brave > DuckDuckGo for optimal reliability and performance

  • Full Page Content Extraction: Fetches and extracts complete page content from search results

  • Multiple Search Tools: Three specialised tools for different use cases

  • Smart Request Strategy: Switches between playwright browesrs and fast axios requests to ensure results are returned

  • Concurrent Processing: Extracts content from multiple pages simultaneously

How It Works

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:

  • Browser-based Bing Search - Primary method using dedicated Chromium instance

  • Browser-based Brave Search - Secondary option using dedicated Firefox instance

  • Axios DuckDuckGo Search - Final fallback using traditional HTTP

  • Dedicated browser isolation: Each search engine gets its own browser instance with automatic cleanup

  • Content extraction: Tries axios first, then falls back to browser with human behavior simulation

  • Concurrent processing: Extracts content from multiple pages simultaneously with timeout protection

  • 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:

  • Performs the same optimised multi-engine search as full-web-search

  • Returns only the search result snippets/descriptions

  • Does not follow links to extract full page content

3. get-single-web-page-content (Utility Tool)

For extracting content from a specific webpage:

  • Takes a single URL as input

  • Follows the URL and extracts the main page content

  • Removes navigation, ads, and other non-content elements

Compatibility

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

Model Compatibility

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.

  • βœ… Works well with: Qwen3

  • βœ… Works well with: Gemma 3

  • βœ… Works with: Llama 3.2

  • βœ… Works with: Recent Llama 3.1 (e.g 3.1 swallow-8B)

  • βœ… Works with: Recent Deepseek R1 (e.g 0528 works)

  • ⚠️ May have issues with: Some versions of Llama and Deepseek R1

  • ❌ May not work with: Older versions of Llama and Deepseek R1

Environment Variables

The server supports several environment variables for configuration:

  • MAX_CONTENT_LENGTH: Maximum content length in characters (default: 500000)

  • DEFAULT_TIMEOUT: Default timeout for requests in milliseconds (default: 6000)

  • MAX_BROWSERS: Maximum number of browser instances to maintain (default: 3)

  • BROWSER_TYPES: Comma-separated list of browser types to use (default: 'chromium,firefox', options: chromium, firefox, webkit)

  • BROWSER_FALLBACK_THRESHOLD: Number of axios failures before using browser fallback (default: 3)

Search Quality and Engine Selection

  • ENABLE_RELEVANCE_CHECKING: Enable/disable search result quality validation (default: true)

  • RELEVANCE_THRESHOLD: Minimum quality score for search results (0.0-1.0, default: 0.3)

  • FORCE_MULTI_ENGINE_SEARCH: Try all search engines and return best results (default: false)

  • DEBUG_BROWSER_LIFECYCLE: Enable detailed browser lifecycle logging for debugging (default: false)

For Development

Copy & paste β€” that's it
git clone https://github.com/mrkrsl/web-search-mcp.git
cd web-search-mcp
npm install
npx playwright install
npm run build

Development

Copy & paste β€” that's it
npm run dev # Development with hot reload
npm run build # Build TypeScript to JavaScript
npm run lint # Run ESLint
npm run format # Run Prettier

MCP Tools

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

1. full-web-search (Main Tool)

The most comprehensive web search tool that:

  • Takes a search query and optional number of results (1-10, default 5)

  • Performs a web search (tries Bing, then Brave, then DuckDuckGo if needed)

  • Fetches full page content from each result URL with concurrent processing

  • Returns structured data with search results and extracted content

  • Enhanced reliability: HTTP/2 error recovery, reduced timeouts, and better error handling

Example Usage:

Copy & paste β€” that's it
{
 "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:

  • Takes a search query and optional number of results (1-10, default 5)

  • Performs the same optimised multi-engine search as full-web-search

  • Returns only search result snippets/descriptions (no content extraction)

  • Faster and more efficient for quick research

Example Usage:

Copy & paste β€” that's it
{
 "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:

  • Takes a single URL as input

  • Follows the URL and extracts the main page content

  • Removes navigation, ads, and other non-content elements

  • Useful for getting detailed content from a known webpage

Example Usage:

Copy & paste β€” that's it
{
 "name": "get-single-web-page-content",
 "arguments": {
 "url": "https://example.com/article",
 "maxContentLength": 5000
 }
}

Documentation

See API.md for complete technical details.

License

MIT License - see LICENSE for details.

Feedback

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

  • Open an issue on GitHub

  • Submit a pull request