azure-ai-agent-service-mcp-bridge
An experimental bridge for connecting MCP tools to Azure AI Agents. This project demonstrates how to discover and expose tools from an MCP server to Azure AI Agent Service using the Python SDK.
GitHub Stars
0
User Rating
Not Rated
Forks
1
Issues
0
Views
1
Favorites
0
Azure AI Agent - MCP Bridge
An experimental bridge for connecting MCP tools to Azure AI Agents. This project demonstrates how to discover and expose tools from an MCP server to Azure AI Agent Service using the Python SDK.
Features
- Stdio MCP Server Support: Connects to MCP servers using stdio transport only (HTTP/SSE is not implemented yet)
- Dynamic Tool Discovery: Automatically finds all available tools from an MCP server
- Schema Conversion: Translates MCP input schemas to Azure AI-compatible function parameters
- Azure AI Integration: Registers discovered tools with Azure AI Agent Service
- Interactive Console: Test your agent immediately with a simple chat interface
- Sample Weather Server: Includes a ready-to-use MCP weather server for experimentation
How it Works
graph LR
User(User) <--> Chat(Chat Interface)
Chat <--> Agent(Azure AI Agent)
Agent <--> Bridge(MCP Bridge)
Bridge <--> Server(MCP Server)
style User fill:#f9f9f9
style Agent fill:#0072C6,color:white
style Bridge fill:#5cb85c,color:white
style Server fill:#d9534f,color:white
- The bridge connects to an MCP server (e.g., the included weather server) via stdio
- It discovers available tools and generates wrapper functions for each
- These tools are registered with an Azure AI Agent
- When the agent needs to use a tool, the bridge:
- Receives the request from the agent
- Calls the appropriate MCP tool
- Returns the result back to the agent
For a deeper technical explanation of the bridge implementation, check out the Implementation Details document. It covers the architecture, components, and extension points for developers looking to modify or extend the bridge.
Example Usage
Here's what it looks like when you run the bridge and ask for a weather forecast:

In this example:
- The bridge connects to the weather server and discovers two tools:
get_forecastandget_alerts - When asked about NYC weather, the agent decides to use the
get_forecasttool - The bridge executes the tool with the coordinates for NYC and returns the formatted weather data
- The agent provides a human-friendly summary of the weather forecast
Setup
Clone the repository:
git clone <your-repo-url> cd azure-ai-mcp-bridgeSet up your environment:
python -m venv .venv # Windows .\.venv\Scripts\activate # MacOS/Linux source .venv/bin/activate pip install -r requirements.txtConfigure Azure AI:
- Copy the sample environment file:
copy .env.sample .env(Windows) orcp .env.sample .env(macOS/Linux) - Add your Azure AI Project Connection String to the
.envfile
- Copy the sample environment file:
Run the bridge:
python main.py
Deploying with Azure AI Agent Service
This bridge works with Azure AI Agent Service, which provides the infrastructure for your AI agents. To deploy:
Set up Azure Resources:
- Use Microsoft's Azure AI Agent Service Quickstart to create the required infrastructure
- You can use their convenient "Deploy to Azure" button which automatically provisions all needed resources
Configure the Bridge:
- Get your Project Connection String from the Azure AI Foundry portal
- Update the
.envfile with this connection string - Configure your MCP server as needed (or use the included weather server)
Deploy Your Agent:
- Run the bridge locally to register your MCP tools with the Azure AI Agent
- Applications can then connect to your agent through the Azure AI Agent Service API
Limitations
- Experimental: This is a proof-of-concept for developers to adapt and extend
- Stdio Transport Only: Currently only supports stdio MCP servers, not HTTP-based ones
- Local Testing: Designed for local development and testing, not production deployment
- Single Server: Currently connects to one MCP server at a time
Project Structure
main.py # Minimal entrypoint that invokes bridge.run_bridge_chat()
IMPLEMENTATION.md # Detailed technical documentation on the bridge implementation
azure_ai_mcp_bridge/ # Core modules
bridge.py # Orchestrates MCP & Azure AI Agent integration
chat.py # Interactive console and tool execution handling
mcp_integration.py # MCP client session and tool wrapper generation
servers/ # Example MCP server implementation
weather_server.py # MCP weather server with forecast and alerts tools
License
This project is licensed under the MIT License - see the LICENSE file for details.
Particle physicist, game designer, data scientist, team lead, cloud solution architect, dad. In that order, chronologically speaking, otherwise reverse.
6
Followers
30
Repositories
2
Gists
3
Total Contributions