Skip to content

Python: MCP sample bugbash fixes#4001

Merged
giles17 merged 2 commits intomicrosoft:mainfrom
giles17:mcp_sample_fixes
Feb 17, 2026
Merged

Python: MCP sample bugbash fixes#4001
giles17 merged 2 commits intomicrosoft:mainfrom
giles17:mcp_sample_fixes

Conversation

@giles17
Copy link
Contributor

@giles17 giles17 commented Feb 17, 2026

Motivation and Context

Fixes errors from two MCP samples found during bugbash

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 February 17, 2026 16:58
@github-actions github-actions bot changed the title MCP sample bugbash fixes Python: MCP sample bugbash fixes Feb 17, 2026
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 fixes API usage errors in two MCP sample files discovered during a bugbash. The changes correct parameter names and values in the get_mcp_tool() method call to match the actual API signature, and add the standard if __name__ == "__main__" pattern to make one sample executable.

Changes:

  • Fixed get_mcp_tool() parameter names from internal dict keys (server_label, server_url, require_approval) to correct API parameters (name, url, approval_mode)
  • Fixed approval_mode value from "never" to "never_require"
  • Added if __name__ == "__main__" block to mcp_api_key_auth.py for direct execution

Reviewed changes

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

File Description
python/samples/02-agents/mcp/mcp_github_pat.py Corrects get_mcp_tool() parameters from internal dict keys to proper API parameters (server_label→name, server_url→url, require_approval→approval_mode) and fixes approval value ("never"→"never_require")
python/samples/02-agents/mcp/mcp_api_key_auth.py Adds standard if __name__ == "__main__" block with asyncio import to enable direct script execution

@giles17 giles17 enabled auto-merge February 17, 2026 17:04
@giles17 giles17 added this pull request to the merge queue Feb 17, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 17, 2026
@giles17 giles17 added this pull request to the merge queue Feb 17, 2026
Merged via the queue into microsoft:main with commit 8a2a21d Feb 17, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants