Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DuckDuckGo + Filesystem Management #9

Merged
9 commits merged into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
901 changes: 899 additions & 2 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
"publish-all": "npm publish --workspaces --access public && npm publish --access public"
},
"dependencies": {
"@modelcontextprotocol/server-duckduckgo": "*",
"@modelcontextprotocol/server-everything": "*",
"@modelcontextprotocol/server-filesystem": "*",
"@modelcontextprotocol/server-gdrive": "*",
"@modelcontextprotocol/server-postgres": "*",
"@modelcontextprotocol/server-puppeteer": "*",
"@modelcontextprotocol/server-slack": "*"
"@modelcontextprotocol/server-slack": "*",
"@modelcontextprotocol/server-brave-search": "*"
}
}
94 changes: 94 additions & 0 deletions src/brave-search/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Brave Search MCP Server

An MCP server implementation that integrates the Brave Search API, providing both web and local search capabilities through the Model Context Protocol.

## Features

- **Web Search**: General queries, news, articles, with pagination and freshness controls
- **Local Search**: Find businesses, restaurants, and services with detailed information
- **Flexible Filtering**: Control result types, safety levels, and content freshness
- **Smart Fallbacks**: Local search automatically falls back to web when no results are found

## Configuration

### Client Configuration
Add this to your MCP client config:

```json
"brave-search": {
"command": "mcp-server-brave-search",
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE"
}
}
```

Alternatively, you can set the API key as an environment variable:

```bash
export BRAVE_API_KEY='your_actual_api_key_here'
```

### Getting an API Key
1. Sign up for a Brave Search API account
2. Choose a plan (Free tier available)
3. Generate your API key from the developer dashboard

## Tools

### brave_web_search
Performs general web searches:

```javascript
{
"name": "brave_web_search",
"arguments": {
"query": "latest AI developments",
"count": 10,
"freshness": "pw", // Past week
"safesearch": "moderate"
}
}
```

### brave_local_search
Finds local businesses and services:

```javascript
{
"name": "brave_local_search",
"arguments": {
"query": "pizza near Central Park",
"count": 5,
"units": "imperial"
}
}
```

## Key Implementation Details

- Rate limiting to respect API quotas (1 request/second, 15000/month)
- Parallel fetching of POI details and descriptions for local search
- Type-safe argument validation
- Comprehensive error handling and logging

## Development

```bash
# Install dependencies
npm install

# Build the server
npm run build

# Run the server
mcp-server-brave-search
```

## Contributing

Contributions welcome! Please check the issues tab or submit a PR.

## License

MIT - see [LICENSE](LICENSE) file for details.
Loading