Lesson Learned #528: Arithmetic overflow error converting IDENTITY to data type int
July 12, 2025Configure the new Microsoft Intune connector for Active Directory with the least privilege principle
July 12, 2025As AI agents become more sophisticated, the need for seamless integration with powerful cloud-based tools grows. With the Azure AI Foundry SDK and MCP (Model Context Protocol) tools, creates a dynamic duo that empowers developers to build, deploy, and manage intelligent agents with ease.
Solution Overview
The AI-Foundry-Agent-MCP GitHub repository provides a hands-on solution for integrating MCP tools with the Azure AI Foundry SDK. This setup allows developers to:
- Access and deploy state-of-the-art models from Azure AI Foundry.
- Use MCP tools to manage model context, knowledge bases, and evaluation pipelines.
- Rapidly prototype and scale AI agent solutions in a cloud-native environment.
Getting Started
The repo includes a step-by-step guide to get your environment up and running:
- Clone the repo and navigate to the project directory:git clone https://github.com/ccoellomsft/AI-Foundry-Agent-MCP.git cd ai-foundry-agents-mcp/ai-foundry-agents-mcp-tools/Python
- Set up a virtual environment:python -m venv labenv source ../labenv/Scripts/activate
- Install dependencies:pip install -r requirements.txt azure-ai-projects mcp
- Configure your environment – Edit the .env file to include your Azure AI Foundry project endpoint and model deployment name.
- Authenticate with Azure and select your subscription when prompted:az login
- Run client.py:python client.py
- Run with Sample Queries:
- What exchange is MSFT listed on?
- Give me a list of Microsoft’s popular products.
- What is Microsoft’s stock price?
Creating an MCP Tool
The root of MCP tools is within the server.py file where tools(python functions) can be added as needed. The Agent will leverage the tool functions description when determining which one to use. The description or comment in the code is what the agent uses to understand the tool’s purpose.
.tool()
def get_msft_stock_info() -> dict:
“””Returns MSFT stock information.”””
return {
“symbol”: “MSFT”,
“companyName”: “Microsoft Corporation”,
“exchange”: “NASDAQ”,
“currency”: “USD”,
“currentPrice”: 442.18,
“open”: 438.50,
“high”: 445.00,
“low”: 437.20,
“previousClose”: 439.10,
“volume”: 18234000,
“marketCap”: 3280000000000,
“peRatio”: 38.2,
“eps”: 11.57,
“dividendYield”: 0.78,
“timestamp”: “2025-07-10T13:50:00Z”
}
When a user prompt includes something like “What’s the current Microsoft stock price?” or “Give me information on Microsoft’s products” the agent will match the intent of the prompt with the tool’s description. Within the MCP tool function an endpoint to another service can be called, parameters can be passed into the function, and any applicable logic can also be added here.
Conclusion
By combining the Azure AI Foundry SDK with MCP tools, you gain access to a rich ecosystem of models, data indexing, and deployment capabilities, all within a unified development workflow. Whether you’re building chatbots, copilots, or intelligent search systems, this toolkit accelerates your journey from prototype to production. Implementing MCP tools with Azure AI Foundry offers a powerful and scalable approach to building intelligent, context-aware AI solutions. This integration not only streamlines the development lifecycle of AI agents but also ensures they operate with contextual intelligence, adaptability, and enterprise-grade security. As AI continues to evolve, leveraging these tools together positions teams to deliver smarter, more responsible, and impactful AI-driven experiences.