Labsco
mnhlt logo

WebSearch-MCP

β˜… 38

from mnhlt

Self-hosted Websearch API

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

WebSearch-MCP

smithery badge

A Model Context Protocol (MCP) server implementation that provides a web search capability over stdio transport. This server integrates with a WebSearch Crawler API to retrieve search results.

Table of Contents

About

WebSearch-MCP is a Model Context Protocol server that provides web search capabilities to AI assistants that support MCP. It allows AI models like Claude to search the web in real-time, retrieving up-to-date information about any topic.

The server integrates with a Crawler API service that handles the actual web searches, and communicates with AI assistants using the standardized Model Context Protocol.

Integrating with MCP Clients

Quick Reference: MCP Configuration

Here's a quick reference for MCP configuration across different clients:

{
    "mcpServers": {
        "websearch": {
            "command": "npx",
            "args": [
                "websearch-mcp"
            ],
            "environment": {
                "API_URL": "http://localhost:3001",
                "MAX_SEARCH_RESULT": "5" // reduce to save your tokens, increase for wider information gain
            }
        }
    }
}

Workaround for Windows, due to Issue

{
	"mcpServers": {
	  "websearch": {
            "command": "cmd",
            "args": [
				"/c",
				"npx",
                "websearch-mcp"
            ],
            "environment": {
                "API_URL": "http://localhost:3001",
                "MAX_SEARCH_RESULT": "1"
            }
        }
	}
  }

Development

To work on this project:

  1. Clone the repository
  2. Install dependencies: npm install
  3. Build the project: npm run build
  4. Run in development mode: npm run dev

The server expects a WebSearch Crawler API as defined in the included swagger.json file. Make sure the API is running at the configured API_URL.

Project Structure

  • .gitignore: Specifies files that Git should ignore (node_modules, dist, logs, etc.)
  • .npmignore: Specifies files that shouldn't be included when publishing to npm
  • package.json: Project metadata and dependencies
  • src/: Source TypeScript files
  • dist/: Compiled JavaScript files (generated when building)

Publishing to npm

To publish this package to npm:

  1. Make sure you have an npm account and are logged in (npm login)
  2. Update the version in package.json (npm version patch|minor|major)
  3. Run npm publish

The .npmignore file ensures that only the necessary files are included in the published package:

  • The compiled code in dist/
  • README.md and LICENSE files
  • package.json