mcp-web-search-tool
A MCP server providing real-time web search capabilities to any AI model.
claude mcp add --transport stdio gabrimatic-mcp-web-search-tool node build/index.js \ --env MAX_RESULTS="10" \ --env BRAVE_API_KEY="your_api_key_here" \ --env REQUEST_TIMEOUT="10000"
How to use
The MCP Web Search Tool provides a real-time web search capability to AI assistants via the Model Context Protocol (MCP). It exposes a pluggable web_search tool that queries the Brave Web Search API (and can be extended to other providers in the future). The server returns structured JSON results suitable for consumption by downstream agents, allowing AI to fetch up-to-date information such as current events, weather, sports scores, and market data. Use it by running the MCP server and invoking the web_search tool through your MCP-enabled client or integrations like Claude Desktop, which can be configured to route queries to this server for real-time information.
To start, ensure you have a running MCP server instance with the mcp-web-search capability. The primary tool exposed is web_search, which accepts a search_term and an optional provider parameter (defaults to Brave). Queries are categorized automatically to provide context-aware guidance for downstream AI tasks, enabling weather lookups, current events, and other time-sensitive information. If you’re integrating with Claude Desktop, you can point Claude’s configuration to the MCP server and prompt Claude to delegate real-time information requests to the web search tool.
How to install
Prerequisites:
- Node.js v16.x or newer
- npm v7.x or newer
- Brave Search API Key (BRAVE_API_KEY) from https:// Brave
Installation steps:
- Clone the repository and install dependencies
git clone https://github.com/gabrimatic/mcp-web-search-tool.git
cd mcp-web-search-tool
npm install
- Configure environment variables Create a .env file in the project root with your Brave API key and optional defaults:
BRAVE_API_KEY=your_api_key_here
MAX_RESULTS=10 # Optional: Default is 10
REQUEST_TIMEOUT=10000 # Optional: Default is 10000ms
- Build the project
npm run build
- Run the server
npm start
- (Optional) Test the server locally
node test-server.js
Additional notes
Notes and tips:
- Ensure BRAVE_API_KEY is kept secret; use environment management solutions for deployment.
- The mcp-web-search server exposes the web_search tool. You can extend or swap providers by adjusting the configuration of the underlying provider in the codebase.
- If you’re integrating with Claude Desktop, update claude_desktop_config.json with the mcpServers entry similar to:
{
"mcpServers": {
"mcp-web-search": {
"command": "node",
"args": [
"/path/to/your/mcp-web-search-tool/build/index.js"
]
}
}
}
- Common issues: ensure your API key has permission for Brave Web Search, and verify network access from the host running the server. If results are empty or slow, check REQUEST_TIMEOUT and MAX_RESULTS values.
Related MCP Servers
ghost
A Model Context Protocol (MCP) server for interacting with Ghost CMS through LLM interfaces like Claude. Allow you to control your Ghost blog by simply asking Claude etc.
MCPNotes
A simple note-taking MCP server for recording and managing notes with AI models.
mongo
MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB
vscode-context
MCP Server to Connect with VS Code IDE
plex
Plex MCP Server
mcp-context-template
🪱 MCP Context Template is a repository designed to centrally manage AI tools (MCP) to reduce context sharing costs and improve development productivity.