Skip to content

Python: AzureAI Local MCP Sample#2616

Merged
giles17 merged 4 commits intomicrosoft:mainfrom
giles17:azure_ai_local_mcp
Dec 4, 2025
Merged

Python: AzureAI Local MCP Sample#2616
giles17 merged 4 commits intomicrosoft:mainfrom
giles17:azure_ai_local_mcp

Conversation

@giles17
Copy link
Contributor

@giles17 giles17 commented Dec 3, 2025

Motivation and Context

Adds AzureAI V2 Local MCP sample

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings December 3, 2025 22:32
@github-actions github-actions bot changed the title AzureAI Local MCP Sample Python: AzureAI Local MCP Sample Dec 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Python sample demonstrating how to integrate Azure AI Agents with local Model Context Protocol (MCP) servers using the MCPStreamableHTTPTool. The sample illustrates two distinct patterns for tool configuration: defining tools at agent creation time versus providing them at runtime.

Key Changes:

  • Adds azure_ai_with_local_mcp.py sample showing agent-level and run-level MCP tool configuration
  • Demonstrates async context manager usage for both credential and MCP server lifecycle management
  • Provides code examples for connecting to Microsoft Learn MCP server

@markwallace-microsoft markwallace-microsoft added the documentation Improvements or additions to documentation label Dec 4, 2025
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/openai
   _responses_client.py4689180%99, 145, 152–153, 156–157, 162–163, 166, 173, 192, 199, 202–209, 211, 216, 222, 225, 240, 243–244, 246, 273, 303, 344–345, 372, 376, 393, 398, 412, 448, 510, 585, 590, 594–596, 616, 631–632, 636–638, 686, 706–707, 720–721, 737–738, 776, 778, 816, 818, 827–828, 844, 846, 919–925, 942–947, 966, 984, 994, 996, 1014–1015, 1017–1019, 1030–1031, 1034, 1036
TOTAL15911241984% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2292 130 💤 0 ❌ 0 🔥 58.286s ⏱️

@giles17 giles17 added this pull request to the merge queue Dec 4, 2025
Merged via the queue into microsoft:main with commit 365e438 Dec 4, 2025
23 checks passed
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
* added azure ai local mcp sample

* small fix

* handling for local mcp

* remove redundant local mcp handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants