Skip to content

Python: added approval_mode and allowed_tools to local MCP - #1203

Merged
eavanvalkenburg merged 2 commits into
microsoft:mainfrom
eavanvalkenburg:local_mcp_approcals
Oct 7, 2025
Merged

Python: added approval_mode and allowed_tools to local MCP#1203
eavanvalkenburg merged 2 commits into
microsoft:mainfrom
eavanvalkenburg:local_mcp_approcals

Conversation

@eavanvalkenburg

Copy link
Copy Markdown
Member

Motivation and Context

Adds the same approval_mode and allowed_tools params to local MCP tools, leverages the AIFunction approvals.

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 October 5, 2025 09:45
@markwallace-microsoft markwallace-microsoft added the python Usage: [Issues, PRs], Target: Python label Oct 5, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 approval_mode and allowed_tools parameters to local MCP tools, bringing feature parity with hosted MCP tools by leveraging the AIFunction approval system.

  • Adds approval mode configuration to control whether tools require user approval before execution
  • Adds tool filtering capability through the allowed_tools parameter
  • Updates all MCP tool subclasses to support these new parameters

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
python/packages/core/agent_framework/_mcp.py Implements approval_mode and allowed_tools functionality in MCPTool base class and all subclasses
python/packages/core/tests/core/test_mcp.py Adds comprehensive test coverage for both new parameters with various configuration scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread python/packages/core/agent_framework/_mcp.py Outdated
Comment thread python/packages/core/agent_framework/_mcp.py
@markwallace-microsoft

markwallace-microsoft commented Oct 5, 2025

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _mcp.py32211265%132, 142–143, 164, 189, 204, 210, 214, 216, 298, 316–321, 324–325, 335–337, 340–342, 344–350, 352–354, 357–358, 380–381, 385–390, 396–397, 401–402, 406, 408, 412–413, 417, 435, 455–465, 476, 489, 492–493, 497, 521, 524–525, 529, 560, 577, 579, 586–587, 604, 606, 612–615, 632–636, 755, 760–764, 869, 872–882, 972, 975–977
TOTAL10272169483% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
1251 98 💤 0 ❌ 0 🔥 25.917s ⏱️

@eavanvalkenburg
eavanvalkenburg added this pull request to the merge queue Oct 7, 2025
Merged via the queue into microsoft:main with commit b49395f Oct 7, 2025
24 checks passed
ReubenBond pushed a commit to ReubenBond/agent-framework that referenced this pull request Oct 28, 2025
…#1203)

* added approval_mode and allowed_tools to local MCP

* updated docs
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
…#1203)

* added approval_mode and allowed_tools to local MCP

* updated docs
@eavanvalkenburg
eavanvalkenburg deleted the local_mcp_approcals branch June 30, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants