brave-search-mcp
An MCP server that integrates with AI models to provide web search capabilities through a single, easy-to-use tool interface.
README
MCP Server
An MCP server implementation that integrates with AI APIs, providing web search capabilities through a single, easy-to-use tool.
Features
- AI Integration: Direct integration with AI models via API
- Web Search: AI models can search the web for current information using the built-in web search tool
- Single Tool Interface: Simple
ai_modeltool that accepts any prompt - Flexible Transport: Supports both STDIO and HTTP transports
- Production Ready: Includes Docker support and proper error handling
Tools
- ai_model
- Sends prompts to AI models with web search capabilities
- Inputs:
prompt(string): The prompt or question to send to the AI modelmaxTokens(number, optional): Maximum tokens to generate (default: 16384, max: 16384)
Configuration
Getting an API Key
- Sign up for an API account
- Generate your API key from the dashboard
- Set the
API_KEYenvironment variable
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
NPX
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-server"
],
"env": {
"API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Docker
{
"mcpServers": {
"mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"API_KEY",
"mcp-server:latest"
],
"env": {
"API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Usage with VS Code
For quick installation, use the one-click installation buttons below...
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).
Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.
Note that the
mcpkey is not needed in the.vscode/mcp.jsonfile.
NPX
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "api_key",
"description": "API Key",
"password": true
}
],
"servers": {
"mcp-server": {
"command": "npx",
"args": ["-y", "mcp-server"],
"env": {
"API_KEY": "${input:api_key}"
}
}
}
}
}
Development
Prerequisites
- Node.js 18+
- npm or yarn
- API key
Installation
# Clone the repository
git clone <repository-url>
cd mcp-server
# Install dependencies
npm install
# Set your API key
export API_KEY="your-api-key-here"
Running the Server
STDIO Mode (for development)
npm run dev:stdio
HTTP Mode
npm run dev:http
# or
npm start
Building
npm run build
Example Usage
Once the server is running, you can use the ai_model tool with any prompt:
{
"name": "ai_model",
"arguments": {
"prompt": "What are the latest developments in AI?",
"maxTokens": 4096
}
}
The AI model will automatically use web search when needed to provide up-to-date information.
API Reference
Tool: ai_model
Sends a prompt to an AI model with web search capabilities.
Parameters:
prompt(string, required): The prompt or question to send to the AI modelmaxTokens(number, optional): Maximum tokens to generate (default: 16384, max: 16384)
Returns:
- AI model's response as text, potentially including information gathered from web search
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions, please open an issue on the GitHub repository.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.