vinzlac/mcp-server-brave-test
If you are the rightful owner of mcp-server-brave-test and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project is a Model Context Protocol (MCP) server that integrates Brave Search for web search and Anthropic Claude for analysis and response generation.
MCP Server with Brave Search and Anthropic Claude
This project is a Model Context Protocol (MCP) server that uses Brave Search for web search and Anthropic Claude for analysis and response generation.
Features
- š Web search via Brave Search API
- š¤ Analysis and response generation with Claude 3 Sonnet
- š MCP-compliant server implementation
- š¬ Support for search and chat capabilities
Prerequisites
- Node.js (version 14 or higher)
- Brave Search API key
- Anthropic API key
Installation
- Clone the repository:
git clone <your-repo>
cd mcp-server-brave-test
- Install dependencies:
npm install
- Create a
.env
file in the root directory with your API keys:
ANTHROPIC_API_KEY=your_anthropic_api_key
BRAVE_SEARCH_API_KEY=your_brave_search_api_key
PORT=3000 # Optional, defaults to 3000
Usage
Starting the Server
To start the MCP server:
# First, build the project
npm run build
# Then start the server
npm start
The server will be available at http://localhost:3000
Using the Client
To use the MCP client:
# Make sure the server is running first
# Then in a new terminal, run:
npm run client
The client will automatically connect to the running server and start an interactive session.
MCP Endpoints
The server implements the following MCP capabilities:
Search Capability
POST /search
Content-Type: application/json
{
"query": "your search query"
}
Response:
{
"results": [
{
"title": "Result title",
"url": "https://example.com",
"description": "Result description"
}
]
}
Chat Capability
POST /chat
Content-Type: application/json
{
"message": "your question",
"context": {
"searchResults": [
{
"title": "Result title",
"url": "https://example.com",
"description": "Result description"
}
]
}
}
Response:
{
"response": "Claude's response based on the search results"
}
Development
- Build the project:
npm run build
- Start in development mode (with auto-reload):
npm run dev
Project Structure
mcp-server-brave-test/
āāā src/
ā āāā mcpServer.ts # MCP server implementation
ā āāā mcpClient.ts # MCP client implementation
āāā dist/
ā āāā mcpServer.js # Compiled server
ā āāā mcpClient.js # Compiled client
āāā .env # Environment variables
āāā package.json
āāā tsconfig.json
License
ISC
Contributing
Contributions are welcome! Feel free to:
- Fork the project
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request