{"_id":"@dyingc/brave-search-mcp-server","_rev":"5-302b2f02f2eebe463a34a3a14b8a729d","name":"@dyingc/brave-search-mcp-server","dist-tags":{"latest":"2.1.2"},"versions":{"2.0.69":{"name":"@dyingc/brave-search-mcp-server","version":"2.0.69","keywords":["api","brave","mcp","search"],"author":{"name":"dyingc"},"license":"MIT","_id":"@dyingc/brave-search-mcp-server@2.0.69","maintainers":[{"name":"dyingc","email":"dyingc@gmail.com"}],"homepage":"https://github.com/dyingc/brave-search-mcp-server","bugs":{"url":"https://github.com/dyingc/brave-search-mcp-server/issues"},"bin":{"brave-search-mcp-server":"dist/index.js"},"dist":{"shasum":"40b2c949230eba7c6ac24a384ec0b348016edc71","tarball":"https://registry.npmjs.org/@dyingc/brave-search-mcp-server/-/brave-search-mcp-server-2.0.69.tgz","fileCount":38,"integrity":"sha512-S4dHwIENKzrM5bXJGlhgbabLnRr7xNUXI0w6uNHpFDQFbHJYH0lU/ksS0mqqDyJTOopkhdNdlz7cfImxrxXz+Q==","signatures":[{"sig":"MEUCIQC6sekFk/BPwvkis6jHZNdvWb+RHcf6bFBa+7jTgWuC4gIgAYByp2B9cnRmsUqY7mdPgneVGCG8xC+tzKJpGA8j+ns=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103245},"type":"module","module":"dist/server.js","gitHead":"8d504c7d283c7545f593d0c56ecd96417dc71d8c","mcpName":"io.github.brave/brave-search-mcp-server","private":false,"scripts":{"test":"vitest","build":"tsc && shx chmod +x dist/*.js","watch":"tsc --watch","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run format && npm run build","inspector":"npx @modelcontextprotocol/inspector","test:watch":"vitest --watch","format:check":"prettier --check \"src/**/*.ts\"","smithery:dev":"smithery dev","test:coverage":"vitest --coverage","inspector:http":"npx @modelcontextprotocol/inspector --transport http","smithery:build":"smithery build"},"_npmUser":{"name":"dyingc","email":"dyingc@gmail.com"},"overrides":{"tmp":"0.2.5","formdata-node":"6.0.3"},"repository":{"url":"git+ssh://git@github.com/dyingc/brave-search-mcp-server.git","type":"git"},"_npmVersion":"11.6.2","description":"Brave Search MCP Server: web results, images, videos, rich results, AI summaries, and more.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"zod":"4.3.5","dotenv":"17.2.3","express":"5.2.1","commander":"14.0.2","@modelcontextprotocol/sdk":"1.25.2"},"_hasShrinkwrap":false,"devDependencies":{"shx":"0.4.0","tsx":"4.21.0","vitest":"^4.0.18","prettier":"3.7.4","@vitest/ui":"^4.0.18","typescript":"5.9.3","@types/node":"24.10.4","@smithery/cli":"2.2.1","@types/express":"5.0.6","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/brave-search-mcp-server_2.0.69_1770146058221_0.8652281835145814","host":"s3://npm-registry-packages-npm-production"}},"2.0.70":{"name":"@dyingc/brave-search-mcp-server","version":"2.0.70","keywords":["api","brave","mcp","search"],"author":{"name":"dyingc"},"license":"MIT","_id":"@dyingc/brave-search-mcp-server@2.0.70","maintainers":[{"name":"dyingc","email":"dyingc@gmail.com"}],"homepage":"https://github.com/dyingc/brave-search-mcp-server","bugs":{"url":"https://github.com/dyingc/brave-search-mcp-server/issues"},"bin":{"brave-search-mcp-server":"dist/index.js"},"dist":{"shasum":"216998c028b6d5013f77b917b43b34f49d6ba1e8","tarball":"https://registry.npmjs.org/@dyingc/brave-search-mcp-server/-/brave-search-mcp-server-2.0.70.tgz","fileCount":38,"integrity":"sha512-MWLi1jnRzU4iQ8o5oAjBliHFnQqc03Qztk2d76WyGJCDfb7A4S8mM9HtBD2Idynd2PREpvzH+bwRzHmkNlG10A==","signatures":[{"sig":"MEUCIEqfVNtckDh6Rub87vUncHF72hf+HUuJ8YnYHHJD2YZeAiEAvncnCqQikUJt3lrGF7Rb4/GlJ0bfxG1sT/fjolddntQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106830},"type":"module","module":"dist/server.js","gitHead":"616463285b6b2ff1e377275bec81f86d0b5100db","mcpName":"io.github.brave/brave-search-mcp-server","private":false,"scripts":{"test":"vitest","build":"tsc && shx chmod +x dist/*.js","watch":"tsc --watch","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run format && npm run build","inspector":"npx @modelcontextprotocol/inspector","test:watch":"vitest --watch","format:check":"prettier --check \"src/**/*.ts\"","smithery:dev":"smithery dev","test:coverage":"vitest --coverage","inspector:http":"npx @modelcontextprotocol/inspector --transport http","smithery:build":"smithery build"},"_npmUser":{"name":"dyingc","email":"dyingc@gmail.com"},"overrides":{"tmp":"0.2.5","formdata-node":"6.0.3"},"repository":{"url":"git+ssh://git@github.com/dyingc/brave-search-mcp-server.git","type":"git"},"_npmVersion":"11.6.2","description":"Brave Search MCP Server: web results, images, videos, rich results, AI summaries, and more.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"zod":"4.3.5","dotenv":"17.2.3","express":"5.2.1","commander":"14.0.2","@modelcontextprotocol/sdk":"1.25.2"},"_hasShrinkwrap":false,"devDependencies":{"shx":"0.4.0","tsx":"4.21.0","vitest":"^4.0.18","prettier":"3.7.4","@vitest/ui":"^4.0.18","typescript":"5.9.3","@types/node":"24.10.4","@smithery/cli":"2.2.1","@types/express":"5.0.6","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/brave-search-mcp-server_2.0.70_1770160719720_0.6210380170866081","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@dyingc/brave-search-mcp-server","version":"2.1.0","keywords":["api","brave","mcp","search"],"author":{"name":"dyingc"},"license":"MIT","_id":"@dyingc/brave-search-mcp-server@2.1.0","maintainers":[{"name":"dyingc","email":"dyingc@gmail.com"}],"homepage":"https://github.com/dyingc/brave-search-mcp-server","bugs":{"url":"https://github.com/dyingc/brave-search-mcp-server/issues"},"bin":{"brave-search-mcp-server":"dist/index.js"},"dist":{"shasum":"425f21a4b13b5e574c9c8524c9a828b5cb5aa6dc","tarball":"https://registry.npmjs.org/@dyingc/brave-search-mcp-server/-/brave-search-mcp-server-2.1.0.tgz","fileCount":38,"integrity":"sha512-SRkTNHQVUKRwZO2PWDX62TCJzrHfvd/7Dq0yLe6jBGuFOmV1t/uI7cUDmW9Yg+UlSmjgYfL2PyROPR1teJe4pA==","signatures":[{"sig":"MEUCIQDwxhLeyHlhP56BvJSsRMIdOoKYrXzzo1rAeCTF6DFJfwIgFBRKQitCGWm2Ec7aoKGvug/Hdc2WmabJ2e3QYmIFN6Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":112118},"type":"module","module":"dist/server.js","gitHead":"3808a42d53bfb09c36a41f136c461e5d5bed12a8","mcpName":"io.github.brave/brave-search-mcp-server","private":false,"scripts":{"test":"vitest","build":"tsc && shx chmod +x dist/*.js","watch":"tsc --watch","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run format && npm run build","inspector":"npx @modelcontextprotocol/inspector","test:watch":"vitest --watch","format:check":"prettier --check \"src/**/*.ts\"","smithery:dev":"smithery dev","test:coverage":"vitest --coverage","inspector:http":"npx @modelcontextprotocol/inspector --transport http","smithery:build":"smithery build"},"_npmUser":{"name":"dyingc","email":"dyingc@gmail.com"},"overrides":{"tmp":"0.2.5","formdata-node":"6.0.3"},"repository":{"url":"git+ssh://git@github.com/dyingc/brave-search-mcp-server.git","type":"git"},"_npmVersion":"11.6.2","description":"Brave Search MCP Server: web results, images, videos, rich results, AI summaries, and more.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"zod":"4.3.5","dotenv":"17.2.3","express":"5.2.1","commander":"14.0.2","@modelcontextprotocol/sdk":"1.25.2"},"_hasShrinkwrap":false,"devDependencies":{"shx":"0.4.0","tsx":"4.21.0","vitest":"^4.0.18","prettier":"3.7.4","@vitest/ui":"^4.0.18","typescript":"5.9.3","@types/node":"24.10.4","@smithery/cli":"2.2.1","@types/express":"5.0.6","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/brave-search-mcp-server_2.1.0_1770591191224_0.9574142102710956","host":"s3://npm-registry-packages-npm-production"}},"2.1.1":{"name":"@dyingc/brave-search-mcp-server","version":"2.1.1","keywords":["api","brave","mcp","search"],"author":{"name":"dyingc"},"license":"MIT","_id":"@dyingc/brave-search-mcp-server@2.1.1","maintainers":[{"name":"dyingc","email":"dyingc@gmail.com"}],"homepage":"https://github.com/dyingc/brave-search-mcp-server","bugs":{"url":"https://github.com/dyingc/brave-search-mcp-server/issues"},"bin":{"brave-search-mcp-server":"dist/index.js"},"dist":{"shasum":"949616a66847da4e12dbf39c1d9cb95809eb992f","tarball":"https://registry.npmjs.org/@dyingc/brave-search-mcp-server/-/brave-search-mcp-server-2.1.1.tgz","fileCount":38,"integrity":"sha512-6Pm2vyXNmLA2HFJl+ktyKw+p1QGcdAX7yRcGrZHZY27eQpZLm76XWOvLYQNEk87wXe1LAoFQJRF+4SGc6vjxcQ==","signatures":[{"sig":"MEUCIQDjN5xl6+Mk/hNZSejcXsH6zUfDXf9zokbMFPiwUfQ34gIgfGjCpsjkVfMKVUCSkcF0KnL3edDNICBall7Cq+PVcgI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":113814},"type":"module","module":"dist/server.js","gitHead":"3808a42d53bfb09c36a41f136c461e5d5bed12a8","mcpName":"io.github.brave/brave-search-mcp-server","private":false,"scripts":{"test":"vitest","build":"tsc && shx chmod +x dist/*.js","watch":"tsc --watch","format":"prettier --write \"src/**/*.ts\"","prepare":"npm run format && npm run build","inspector":"npx @modelcontextprotocol/inspector","test:watch":"vitest --watch","format:check":"prettier --check \"src/**/*.ts\"","smithery:dev":"smithery dev","test:coverage":"vitest --coverage","inspector:http":"npx @modelcontextprotocol/inspector --transport http","smithery:build":"smithery build"},"_npmUser":{"name":"dyingc","email":"dyingc@gmail.com"},"overrides":{"tmp":"0.2.5","formdata-node":"6.0.3"},"repository":{"url":"git+ssh://git@github.com/dyingc/brave-search-mcp-server.git","type":"git"},"_npmVersion":"11.6.2","description":"Brave Search MCP Server: web results, images, videos, rich results, AI summaries, and more.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"zod":"4.3.5","dotenv":"17.2.3","express":"5.2.1","commander":"14.0.2","@modelcontextprotocol/sdk":"1.25.2"},"_hasShrinkwrap":false,"devDependencies":{"shx":"0.4.0","tsx":"4.21.0","vitest":"^4.0.18","prettier":"3.7.4","@vitest/ui":"^4.0.18","typescript":"5.9.3","@types/node":"24.10.4","@smithery/cli":"2.2.1","@types/express":"5.0.6","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/brave-search-mcp-server_2.1.1_1770615673297_0.8501694303333294","host":"s3://npm-registry-packages-npm-production"}},"2.1.2":{"name":"@dyingc/brave-search-mcp-server","mcpName":"io.github.brave/brave-search-mcp-server","private":false,"version":"2.1.2","description":"Brave Search MCP Server: web results, images, videos, rich results, AI summaries, and more.","keywords":["api","brave","mcp","search"],"license":"MIT","author":{"name":"dyingc"},"homepage":"https://github.com/dyingc/brave-search-mcp-server","bugs":{"url":"https://github.com/dyingc/brave-search-mcp-server/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/dyingc/brave-search-mcp-server.git"},"type":"module","module":"dist/server.js","bin":{"brave-search-mcp-server":"dist/index.js"},"scripts":{"build":"tsc && shx chmod +x dist/*.js","smithery:build":"smithery build","smithery:dev":"smithery dev","prepare":"npm run format && npm run build","watch":"tsc --watch","format":"prettier --write \"src/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\"","inspector":"npx @modelcontextprotocol/inspector","inspector:http":"npx @modelcontextprotocol/inspector --transport http","test":"vitest","test:watch":"vitest --watch","test:coverage":"vitest --coverage"},"dependencies":{"@modelcontextprotocol/sdk":"1.25.2","commander":"14.0.2","dotenv":"17.2.3","express":"5.2.1","zod":"4.3.5"},"devDependencies":{"@smithery/cli":"2.2.1","@types/express":"5.0.6","@types/node":"24.10.4","@vitest/coverage-v8":"^4.0.18","@vitest/ui":"^4.0.18","prettier":"3.7.4","shx":"0.4.0","tsx":"4.21.0","typescript":"5.9.3","vitest":"^4.0.18"},"overrides":{"formdata-node":"6.0.3","tmp":"0.2.5"},"gitHead":"d52e33c20cebab8a7017496d1460588bb561ca5e","_id":"@dyingc/brave-search-mcp-server@2.1.2","_nodeVersion":"22.16.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-rQM4RFyRhaAQzrlZEwUVuiAx6SuG9GQankRqGRPumGappD9G7wkgd7NM9vhDjA38ViNJ6Hgnfuxra9eszSA2gA==","shasum":"1e98ab3b21eb1de37d8e2a76a9de5c20b1082567","tarball":"https://registry.npmjs.org/@dyingc/brave-search-mcp-server/-/brave-search-mcp-server-2.1.2.tgz","fileCount":38,"unpackedSize":114037,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCATO0KwyNGtRb6fziqLOmLqoqgxRsdctskEYlThsQxhAIgMcBgj0anEajmgw62o9ppVqOJXRxrZuud8Od7doUNBRg="}]},"_npmUser":{"name":"dyingc","email":"dyingc@gmail.com"},"directories":{},"maintainers":[{"name":"dyingc","email":"dyingc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/brave-search-mcp-server_2.1.2_1770618208548_0.25550024936678883"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-03T19:14:18.083Z","modified":"2026-02-09T06:23:28.813Z","2.0.69":"2026-02-03T19:14:18.370Z","2.0.70":"2026-02-03T23:18:39.881Z","2.1.0":"2026-02-08T22:53:11.379Z","2.1.1":"2026-02-09T05:41:13.476Z","2.1.2":"2026-02-09T06:23:28.709Z"},"bugs":{"url":"https://github.com/dyingc/brave-search-mcp-server/issues"},"author":{"name":"dyingc"},"license":"MIT","homepage":"https://github.com/dyingc/brave-search-mcp-server","keywords":["api","brave","mcp","search"],"repository":{"type":"git","url":"git+ssh://git@github.com/dyingc/brave-search-mcp-server.git"},"description":"Brave Search MCP Server: web results, images, videos, rich results, AI summaries, and more.","maintainers":[{"name":"dyingc","email":"dyingc@gmail.com"}],"readme":"# Brave Search MCP Server\n\nAn MCP server implementation that integrates the Brave Search API, providing comprehensive search capabilities including web search, local business search, image search, video search, news search, and AI-powered summarization. This project supports both STDIO and HTTP transports, with STDIO as the default mode.\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/brave/brave-search-mcp-server)\n\n## Migration\n\n### 1.x to 2.x\n\n#### Default transport now STDIO\n\nTo follow established MCP conventions, the server now defaults to STDIO. If you would like to continue using HTTP, you will need to set the `BRAVE_MCP_TRANSPORT` environment variable to `http`, or provide the runtime argument `--transport http` when launching the server.\n\n#### Response structure of `brave_image_search`\n\nVersion 1.x of the MCP server would return base64-encoded image data along with image URLs. This dramatically slowed down the response, as well as consumed unnecessarily context in the session. Version 2.x removes the base64-encoded data, and returns a response object that more closely reflects the original Brave Search API response. The updated output schema is defined in [`src/tools/images/schemas/output.ts`](https://github.com/brave/brave-search-mcp-server/blob/main/src/tools/images/schemas/output.ts).\n\n## Tools\n\n### Web Search (`brave_web_search`)\nPerforms comprehensive web searches with rich result types and advanced filtering options.\n\n**Parameters:**\n- `query` (string, required): Search terms (max 400 chars, 50 words)\n- `country` (string, optional): Country code (default: \"US\")\n- `search_lang` (string, optional): Search language (default: \"en\")\n- `ui_lang` (string, optional): UI language (default: \"en-US\")\n- `count` (number, optional): Results per page (1-20, default: 10)\n- `offset` (number, optional): Pagination offset (max 9, default: 0)\n- `safesearch` (string, optional): Content filtering (\"off\", \"moderate\", \"strict\", default: \"moderate\")\n- `freshness` (string, optional): Time filter (\"pd\", \"pw\", \"pm\", \"py\", or date range)\n- `text_decorations` (boolean, optional): Include highlighting markers (default: true)\n- `spellcheck` (boolean, optional): Enable spell checking (default: true)\n- `result_filter` (array, optional): Filter result types (default: [\"web\", \"query\"])\n- `goggles` (array, optional): Custom re-ranking definitions\n- `units` (string, optional): Measurement units (\"metric\" or \"imperial\")\n- `extra_snippets` (boolean, optional): Get additional excerpts (Pro plans only)\n- `summary` (boolean, optional): Enable summary key generation for AI summarization\n\n### Local Search (`brave_local_search`)\nSearches for local businesses and places with detailed information including ratings, hours, and AI-generated descriptions.\n\n**Parameters:**\n- Same as `brave_web_search` with automatic location filtering\n- Automatically includes \"web\" and \"locations\" in result_filter\n\n**Note:** Requires Pro plan for full local search capabilities. Falls back to web search otherwise.\n\n### Video Search (`brave_video_search`)\nSearches for videos with comprehensive metadata and thumbnail information.\n\n**Parameters:**\n- `query` (string, required): Search terms (max 400 chars, 50 words)\n- `country` (string, optional): Country code (default: \"US\")\n- `search_lang` (string, optional): Search language (default: \"en\")\n- `ui_lang` (string, optional): UI language (default: \"en-US\")\n- `count` (number, optional): Results per page (1-50, default: 20)\n- `offset` (number, optional): Pagination offset (max 9, default: 0)\n- `spellcheck` (boolean, optional): Enable spell checking (default: true)\n- `safesearch` (string, optional): Content filtering (\"off\", \"moderate\", \"strict\", default: \"moderate\")\n- `freshness` (string, optional): Time filter (\"pd\", \"pw\", \"pm\", \"py\", or date range)\n\n### Image Search (`brave_image_search`)\nSearches for images with automatic fetching and base64 encoding for direct display.\n\n**Parameters:**\n- `query` (string, required): Search terms (max 400 chars, 50 words)\n- `country` (string, optional): Country code (default: \"US\")\n- `search_lang` (string, optional): Search language (default: \"en\")\n- `count` (number, optional): Results per page (1-200, default: 50)\n- `safesearch` (string, optional): Content filtering (\"off\", \"strict\", default: \"strict\")\n- `spellcheck` (boolean, optional): Enable spell checking (default: true)\n\n### News Search (`brave_news_search`)\nSearches for current news articles with freshness controls and breaking news indicators.\n\n**Parameters:**\n- `query` (string, required): Search terms (max 400 chars, 50 words)\n- `country` (string, optional): Country code (default: \"US\")\n- `search_lang` (string, optional): Search language (default: \"en\")\n- `ui_lang` (string, optional): UI language (default: \"en-US\")\n- `count` (number, optional): Results per page (1-50, default: 20)\n- `offset` (number, optional): Pagination offset (max 9, default: 0)\n- `spellcheck` (boolean, optional): Enable spell checking (default: true)\n- `safesearch` (string, optional): Content filtering (\"off\", \"moderate\", \"strict\", default: \"moderate\")\n- `freshness` (string, optional): Time filter (default: \"pd\" for last 24 hours)\n- `extra_snippets` (boolean, optional): Get additional excerpts (Pro plans only)\n- `goggles` (array, optional): Custom re-ranking definitions\n\n### Summarizer Search (`brave_summarizer`)\nGenerates AI-powered summaries from web search results using Brave's summarization API.\n\n**Parameters:**\n- `key` (string, required): Summary key from web search results (use `summary: true` in web search)\n- `entity_info` (boolean, optional): Include entity information (default: false)\n- `inline_references` (boolean, optional): Add source URL references (default: false)\n\n**Usage:** First perform a web search with `summary: true`, then use the returned summary key with this tool.\n\n## Configuration\n\n### Getting an API Key\n\n1. Sign up for a [Brave Search API account](https://brave.com/search/api/)\n2. Choose a plan:\n   - **Free**: 2,000 queries/month, basic web search\n   - **Pro**: Enhanced features including local search, AI summaries, extra snippets\n3. Generate your API key from the [developer dashboard](https://api-dashboard.search.brave.com/app/keys)\n\n### Environment Variables\n\nThe server supports the following environment variables:\n\n**Required:**\n- `BRAVE_API_KEY`: Your Brave Search API key (required)\n\n**Optional:**\n- `BRAVE_MCP_TRANSPORT`: Transport mode (\"http\" or \"stdio\", default: \"stdio\")\n- `BRAVE_MCP_PORT`: HTTP server port (default: 8000)\n- `BRAVE_MCP_HOST`: HTTP server host (default: \"0.0.0.0\")\n- `BRAVE_MCP_LOG_LEVEL`: Desired logging level(\"debug\", \"info\", \"notice\", \"warning\", \"error\", \"critical\", \"alert\", or \"emergency\", default: \"info\")\n- `BRAVE_MCP_ENABLED_TOOLS`: When used, specifies a whitelist for supported tools\n- `BRAVE_MCP_DISABLED_TOOLS`: When used, specifies a blacklist for supported tools\n- `BRAVE_MCP_STATELESS`: HTTP stateless mode (default: \"false\")\n\n**Retry Configuration:**\n- `BRAVE_MCP_MAX_RETRIES`: Maximum number of retry attempts for rate-limited requests (default: 5, range: 0-10)\n- `BRAVE_MCP_RETRY_BASE_DELAY`: Base delay for retry in milliseconds (default: 1000, range: 100-60000)\n- `BRAVE_MCP_RETRY_MAX_DELAY`: Maximum delay for retry in milliseconds (default: 30000, range: 1000-300000)\n\n### Multiple API Keys\n\nWhen using multiple API keys, the server automatically load balances requests across keys based on remaining monthly quota. Keys with more available quota are prioritized.\n\n**Environment Variables for Multiple Keys:**\n\n1. `BRAVE_API_KEYS`: Comma-separated list of API keys\n   ```bash\n   export BRAVE_API_KEYS=\"key1,key2,key3\"\n   ```\n\n2. Numbered variables (legacy):\n   ```bash\n   export BRAVE_API_KEY_1=\"key1\"\n   export BRAVE_API_KEY_2=\"key2\"\n   export BRAVE_API_KEY_3=\"key3\"\n   ```\n\n**State Persistence:**\n\nThe server persists API key quota state to `~/.brave-mcp/state.json` to maintain consistent load balancing across server restarts:\n\n- State is saved after each API request\n- On startup, state is loaded if the timestamp is within the current month\n- State automatically resets at the beginning of each month (matches API quota cycle)\n- If the state file is missing or corrupted, the server starts with default quota (2000 requests per key)\n\n**State File Format:**\n```json\n{\n  \"version\": 1,\n  \"keys\": {\n    \"BSKa1234\": {\n      \"remaining\": 1500,\n      \"timestamp\": \"2025-02-03T10:00:00Z\"\n    }\n  }\n}\n```\n\n**Note:** For security, only the first 8 characters of each API key are stored in the state file.\n\n### Command Line Options\n\n```bash\nnode dist/index.js [options]\n\nOptions:\n  --brave-api-key <string>         Brave API key (required)\n  --transport <stdio|http>         Transport type (default: stdio)\n  --port <number>                  HTTP server port (default: 8080)\n  --host <string>                  HTTP server host (default: 0.0.0.0)\n  --logging-level <string>         Desired logging level (one of _debug_, _info_, _notice_, _warning_, _error_, _critical_, _alert_, or _emergency_)\n  --enabled-tools                  Tools whitelist (only the specified tools will be enabled)\n  --disabled-tools                 Tools blacklist (included tools will be disabled)\n  --stateless <boolean>            HTTP Stateless flag\n  --retry-max-attempts <number>    Maximum retry attempts (default: 5, range: 0-10)\n  --retry-base-delay <number>      Base delay in milliseconds (default: 1000, range: 100-60000)\n  --retry-max-delay <number>       Maximum delay in milliseconds (default: 30000, range: 1000-300000)\n```\n\n## Installation\n\n### Installing via Smithery\n\nTo install Brave Search automatically via [Smithery](https://smithery.ai/server/brave):\n\n```bash\nnpx -y @smithery/cli install brave\n```\n\n### Usage with Claude Desktop\n\nAdd this to your `claude_desktop_config.json`:\n\n#### Docker\n\n```json\n{\n  \"mcpServers\": {\n    \"brave-search\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"-e\", \"BRAVE_API_KEY\", \"docker.io/mcp/brave-search\"],\n      \"env\": {\n        \"BRAVE_API_KEY\": \"YOUR_API_KEY_HERE\"\n      }\n    }\n  }\n}\n```\n\n#### NPX\n\n```json\n{\n  \"mcpServers\": {\n    \"brave-search\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@brave/brave-search-mcp-server\", \"--transport\", \"http\"],\n      \"env\": {\n        \"BRAVE_API_KEY\": \"YOUR_API_KEY_HERE\"\n      }\n    }\n  }\n}\n```\n\n### Usage with VS Code\n\nFor quick installation, use the one-click installation buttons below:\n\n[![Install with NPX in VS Code](https://img.shields.io/badge/VS_Code-NPM-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=brave-search&inputs=%5B%7B%22password%22%3Atrue%2C%22id%22%3A%22brave-api-key%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Brave+Search+API+Key%22%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40brave%2Fbrave-search-mcp-server%22%2C%22--transport%22%2C%22stdio%22%5D%2C%22env%22%3A%7B%22BRAVE_API_KEY%22%3A%22%24%7Binput%3Abrave-api-key%7D%22%7D%7D) [![Install with NPX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-NPM-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=brave-search&inputs=%5B%7B%22password%22%3Atrue%2C%22id%22%3A%22brave-api-key%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Brave+Search+API+Key%22%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40brave%2Fbrave-search-mcp-server%22%2C%22--transport%22%2C%22stdio%22%5D%2C%22env%22%3A%7B%22BRAVE_API_KEY%22%3A%22%24%7Binput%3Abrave-api-key%7D%22%7D%7D&quality=insiders)  \n[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Docker-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=brave-search&inputs=%5B%7B%22password%22%3Atrue%2C%22id%22%3A%22brave-api-key%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Brave+Search+API+Key%22%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22BRAVE_API_KEY%22%2C%22mcp%2Fbrave-search%22%5D%2C%22env%22%3A%7B%22BRAVE_API_KEY%22%3A%22%24%7Binput%3Abrave-api-key%7D%22%7D%7D) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Docker-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=brave-search&inputs=%5B%7B%22password%22%3Atrue%2C%22id%22%3A%22brave-api-key%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Brave+Search+API+Key%22%7D%5D&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22-e%22%2C%22BRAVE_API_KEY%22%2C%22mcp%2Fbrave-search%22%5D%2C%22env%22%3A%7B%22BRAVE_API_KEY%22%3A%22%24%7Binput%3Abrave-api-key%7D%22%7D%7D&quality=insiders)\n\nFor manual installation, add the following to your User Settings (JSON) or `.vscode/mcp.json`:\n\n#### Docker\n\n```json\n{\n  \"inputs\": [\n    {\n      \"password\": true,\n      \"id\": \"brave-api-key\",\n      \"type\": \"promptString\",\n      \"description\": \"Brave Search API Key\",\n    }\n  ],\n  \"servers\": {\n    \"brave-search\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"-e\", \"BRAVE_API_KEY\", \"mcp/brave-search\"],\n      \"env\": {\n        \"BRAVE_API_KEY\": \"${input:brave-api-key}\"\n      }\n    }\n  }\n}\n```\n\n#### NPX\n\n```json\n{\n  \"inputs\": [\n    {\n      \"password\": true,\n      \"id\": \"brave-api-key\",\n      \"type\": \"promptString\",\n      \"description\": \"Brave Search API Key\",\n    }\n  ],\n  \"servers\": {\n    \"brave-search-mcp-server\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@brave/brave-search-mcp-server\", \"--transport\", \"stdio\"],\n      \"env\": {\n        \"BRAVE_API_KEY\": \"${input:brave-api-key}\"\n      }\n    }\n  }\n}\n```\n\n## Build\n\n### Docker\n\n```bash\ndocker build -t mcp/brave-search:latest .\n```\n\n### Local Build\n\n```bash\nnpm install\nnpm run build\n```\n\n## Development\n\n### Prerequisites\n\n- Node.js 22.x or higher\n- npm\n- Brave Search API key\n\n### Setup\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/brave/brave-search-mcp-server.git\ncd brave-search-mcp-server\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Build the project:\n```bash\nnpm run build\n```\n\n### Testing via Claude Desktop\n\nAdd a reference to your local build in `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"brave-search-dev\": {\n      \"command\": \"node\",\n      \"args\": [\"C:\\\\GitHub\\\\brave-search-mcp-server\\\\dist\\\\index.js\"], // Verify your path\n      \"env\": {\n        \"BRAVE_API_KEY\": \"YOUR_API_KEY_HERE\"\n      }\n    }\n  }\n}\n```\n\n### Testing via MCP Inspector\n\n1. Build and start the server:\n```bash\nnpm run build\nnode dist/index.js\n```\n\n2. In another terminal, start the MCP Inspector:\n```bash\nnpx @modelcontextprotocol/inspector node dist/index.js\n```\n\nSTDIO is the default mode. For HTTP mode testing, add `--transport http` to the arguments in the Inspector UI.\n\n### Testing via Smithery.AI\n\n1. Establish and acquire a smithery.ai account and API key\n2. Run `npm run install`, `npm run smithery:build`, and lastly `npm run smithery:dev` to begin testing\n\n### Available Scripts\n\n- `npm run build`: Build the TypeScript project\n- `npm run watch`: Watch for changes and rebuild\n- `npm run format`: Format code with Prettier\n- `npm run format:check`: Check code formatting\n- `npm run prepare`: Format and build (runs automatically on npm install)\n\n- `npm run inspector`: Launch an instance of MCP Inspector\n- `npm run inspector:stdio`: Launch a instance of MCP Inspector, configured for STDIO\n- `npm run smithery:build`: Build the project for smithery.ai\n- `npm run smithery:dev`: Launch the development environment for smithery.ai\n\n### Docker Compose\n\nFor local development with Docker:\n\n```bash\ndocker-compose up --build\n```\n\n## License\n\nThis 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. For more details, please see the LICENSE file in the project repository.\n","readmeFilename":"README.md"}