Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Bing Search MCP ServerSearch for the latest news on recent breakthroughs in fusion energy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Bing Search MCP Server
A Model Context Protocol (MCP) server that provides AI-grounded Bing search capabilities using Azure AI Project Client. This server enables intelligent web searches with citation tracking and URL extraction.
Features
AI-Grounded Search: Leverages Azure AI agents for intelligent search results
Citation Tracking: Automatically extracts and formats citations with URLs
MCP Protocol: Compatible with MCP clients for seamless integration
HTTP Transport: Runs as HTTP server on port 8000 for remote access
Prerequisites
Python 3.8 or higher
Azure subscription with AI Project configured
Azure AD App Registration (for service principal authentication)
Bing Search resource enabled in your Azure AI Project
Installation
Using pip
Using Docker
Configuration
Create a .env file in the project root with the following variables:
See .env.example for a template.
Usage
Running the Server
HTTP Mode (default)
The server runs on http://0.0.0.0:8000 by default:
The server will be accessible at:
Local:
http://localhost:8000Network:
http://<your-ip>:8000
Stdio Mode
To use stdio transport, modify bing-search.py:
And update the run call:
Available Tools
bing_grounded_with_ai
Performs an AI-grounded Bing search with citation tracking.
Parameters:
query(str): The search query
Returns:
Response text with inline citations in Markdown format
List of extracted URLs with titles
Example:
Architecture
The server uses:
FastMCP: Simplified MCP server implementation
Azure AI Project Client: Manages AI agents and threads
Azure Identity: Handles service principal authentication
Error Handling
The server includes comprehensive error handling for:
Missing or invalid queries
Azure credential issues
Agent execution failures
Thread cleanup errors
All errors are returned as ToolError exceptions with descriptive messages.
Development
Project Structure
Transport Modes
streamable-http: HTTP server for remote access (default, port 8000)
stdio: Communicates via standard input/output (alternative mode)
Docker Support
The included Dockerfile creates a lightweight container optimized for production use:
Based on Python 3.11-slim for minimal image size
Non-root user for enhanced security
Multi-stage build process
Optimized layer caching
Build and Run
Security Considerations
Never commit
.envfile or credentials to version controlUse Azure Key Vault for production secrets management
Rotate service principal credentials regularly
Apply principle of least privilege to Azure AD app permissions
Troubleshooting
Common Issues
Authentication Errors:
Verify all Azure credentials are correct
Ensure service principal has appropriate permissions
Check if credentials have expired
Agent Not Found:
Confirm AGENT_ID exists in your Azure AI Project
Verify PROJECT_ENDPOINT is correct
Connection Issues:
Check network connectivity to Azure
Verify firewall rules allow outbound HTTPS
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions:
Create an issue in the repository
Check Azure AI Project documentation
Review MCP protocol specifications