Bing Search MCP Server
A Model Context Protocol (MCP) server for Microsoft Bing Search API integration, allowing AI assistants to perform web, news, and image searches.
Features
- Web search for general information
- News search for recent events and timely information
- Image search for visual content
- Rate limiting to prevent API abuse
- Comprehensive error handling
Requirements
- Python 3.10 or higher
- Microsoft Bing Search API key
- MCP-compatible client (e.g., Claude Desktop, Cursor)
Installation
- Clone this repository
- Install dependencies:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e .
Configuration
Set the required environment variables:
1export BING_API_KEY="your-bing-api-key" 2export BING_API_URL="https://api.bing.microsoft.com/" # Optional
For Windows:
1set BING_API_KEY=your-bing-api-key 2set BING_API_URL=https://api.bing.microsoft.com/
Usage
Running the server
uv run -m mcp_server_bin_search
Configuring with Claude for Desktop
Add the following to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS or %APPDATA%\Claude\claude_desktop_config.json
on Windows):
1{ 2 "mcpServers": { 3 "bing-search": { 4 "command": "uv", 5 "args": [ 6 "--directory", 7 "/path/to/your/folder", 8 "run", 9 "-m", 10 "mcp_server_bin_search" 11 ], 12 "env": { 13 "BING_API_KEY": "your-bing-api-key" 14 } 15 } 16 } 17}
Available Tools
1. bing_web_search
General web search for information, websites, and content.
1bing_web_search(query: str, count: int = 10, offset: int = 0, market: str = "en-US")
2. bing_news_search
Search for news articles and current events.
1bing_news_search(query: str, count: int = 10, market: str = "en-US", freshness: str = "Day")
3. bing_image_search
Search for images.
1bing_image_search(query: str, count: int = 10, market: str = "en-US")
Getting a Bing API Key
- Visit Microsoft Azure Portal
- Create or sign in to your Azure account
- Create a new Bing Search resource
- Go to the resource and find your API key in the "Keys and Endpoint" section