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:
get-web-search-summaries
(Lightweight Alternative)
For quick search results without full content extraction:
full-web-search
get-single-web-page-content
(Utility Tool)
For extracting content from a specific webpage:
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.
Requirements:
Download the latest release zip file from the Releases page
Extract the zip file to a location on your system (e.g., ~/mcp-servers/web-search-mcp/
)
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/
).
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:
~/mcp-servers/web-search-mcp/dist/index.js
C:\\mcp-servers\\web-search-mcp\\dist\\index.js
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:
npm install
fails, try updating Node.js to version 18+ and npm to version 8+npm run build
fails, ensure you have the latest Node.js version installed"MAX_CONTENT_LENGTH": "10000"
, or another value, in your mcp.json
environment variables:{ "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:
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)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)DEFAULT_TIMEOUT=4000
for even faster responses (may reduce success rate)MAX_BROWSERS=1
to reduce memory usagenpx playwright install
to ensure browsers are availableBROWSER_HEADLESS=true
(default) for server environmentsENABLE_RELEVANCE_CHECKING=true
(enabled by default)RELEVANCE_THRESHOLD=0.5
for stricter quality requirementsFORCE_MULTI_ENGINE_SEARCH=true
to try all engines and return the best resultsMAX_BROWSERS
(default: 3)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:
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:
full-web-search
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:
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