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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。