Skip to content

Updating Csharp and Python BYO samples to GA. - #1074

Merged
Mohit Pavan Kumar Gadamsetty (mohitpavan) merged 5 commits into
mainfrom
users/mohit/bat-ga-mcp
Oct 15, 2026
Merged

Mohit Pavan Kumar Gadamsetty (mohitpavan) merged 5 commits into
mainfrom
users/mohit/bat-ga-mcp

Conversation

@mohitpavan

Copy link
Copy Markdown
Contributor

Updating Csharp and Python BYO samples to GA.

[BAT-GA] Migrate C# and Python BYO browser automation samples to GA MCP.

Follow ups:
p0:
prompt agent MCP samples (wherever needed in this repo).

p1:
There are few places where the toolbox name etc are not in full sync, will add that sync in next prs (for now this can be considered as just the migration to GA pr.)
Scripts to bicep files.(next prs)
Check the postdeploy script error for the pww id given in the new project flow (pre-existing, but need to check once, could be transient too)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 05607f09-ad87-46b5-9b03-4a9f594b891d
Move the MAF migration and pending MAF infrastructure changes to users/mohit/bat-ga-mcp-csharp-maf; keep this branch scoped to BYO samples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 05607f09-ad87-46b5-9b03-4a9f594b891d

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.

🟡 Changes recommended

Process-wide browser state permits cross-user access, and the documented provisioning flow is currently incomplete.

7 open findings
What changed in this PR

Migrates the Python and C# BYO browser-automation samples from Playwright CLI and preview tooling to GA Azure Playwright MCP.

Changes:

  • Adds dynamic MCP tool discovery, forwarding, and named-session management.
  • Updates prompts, skills, connections, toolbox hooks, and documentation for GA MCP.
  • Removes Playwright CLI dependencies and generated infrastructure files.
File Description
samples/​python/​.../​utils/​toolbox.py Implements the GA MCP client.
samples/​python/​.../​utils/​constants.py Defines local tools and updated prompt.
samples/​python/​.../​utils/​browser.py Removes the Playwright CLI wrapper.
samples/​python/​.../​skills/​web-scraper.md Adapts scraping guidance to discovered tools.
samples/​python/​.../​skills/​form-filler.md Adapts form guidance to discovered tools.
samples/​python/​.../​main.py Reworks agent loop and session handling.
samples/​python/​.../​Dockerfile Removes Node and Playwright CLI installation.
samples/​python/​.../​.env.example Updates runtime configuration.
samples/​python/​.../​README.md Rewrites usage and deployment guidance.
samples/​python/​.../​infra/​modules/​subnet.bicep Deletes synthesized subnet infrastructure.
samples/​python/​.../​infra/​modules/​resources.bicep Deletes synthesized Foundry resources.
samples/​python/​.../​infra/​modules/​private-endpoint-dns.bicep Deletes private endpoint infrastructure.
samples/​python/​.../​infra/​modules/​network.bicep Deletes network infrastructure.
samples/​python/​.../​infra/​modules/​connections.bicep Deletes connection infrastructure.
samples/​python/​.../​infra/​modules/​acr.bicep Deletes registry infrastructure.
samples/​python/​.../​infra/​main.parameters.json Deletes generated parameters.
samples/​python/​.../​infra/​main.bicep Deletes the Bicep entry point.
samples/​python/​.../​infra/​abbreviations.json Deletes resource abbreviations.
samples/​python/​.../​infra-modules/​playwright-connection.bicep Targets the GA MCP endpoint and audience.
samples/​python/​.../​hooks/​setup-toolbox.sh Publishes the GA browser tool.
samples/​python/​.../​hooks/​setup-toolbox.ps1 Publishes the GA browser tool on Windows.
samples/​python/​.../​azure.yaml Updates model defaults and provisioning configuration.
samples/​csharp/​.../​utils/​ToolboxClient.cs Implements the GA MCP client.
samples/​csharp/​.../​utils/​Constants.cs Defines local tools and updated prompt.
samples/​csharp/​.../​utils/​BrowserSession.cs Removes the Playwright CLI wrapper.
samples/​csharp/​.../​skills/​web-scraper.md Adapts scraping guidance to discovered tools.
samples/​csharp/​.../​skills/​form-filler.md Adapts form guidance to discovered tools.
samples/​csharp/​.../​Program.cs Reworks agent loop and session handling.
samples/​csharp/​.../​Dockerfile Removes Node and Playwright CLI installation.
samples/​csharp/​.../​.env.example Updates runtime configuration.
samples/​csharp/​.../​README.md Rewrites usage and deployment guidance.
samples/​csharp/​.../​infra/​modules/​subnet.bicep Deletes synthesized subnet infrastructure.
samples/​csharp/​.../​infra/​modules/​resources.bicep Deletes synthesized Foundry resources.
samples/​csharp/​.../​infra/​modules/​private-endpoint-dns.bicep Deletes private endpoint infrastructure.
samples/​csharp/​.../​infra/​modules/​network.bicep Deletes network infrastructure.
samples/​csharp/​.../​infra/​modules/​connections.bicep Deletes connection infrastructure.
samples/​csharp/​.../​infra/​modules/​acr.bicep Deletes registry infrastructure.
samples/​csharp/​.../​infra/​main.parameters.json Deletes generated parameters.
samples/​csharp/​.../​infra/​main.bicep Deletes the Bicep entry point.
samples/​csharp/​.../​infra/​abbreviations.json Deletes resource abbreviations.
samples/​csharp/​.../​infra-modules/​playwright-connection.bicep Targets the GA MCP endpoint and audience.
samples/​csharp/​.../​hooks/​setup-toolbox.sh Publishes the GA browser tool.
samples/​csharp/​.../​hooks/​setup-toolbox.ps1 Publishes the GA browser tool on Windows.
samples/​csharp/​.../​azure.yaml Updates model defaults and provisioning configuration.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

🟡 Changes recommended

Provisioning is disabled, the MCP clients omit required transport handling, and sensitive tool arguments are logged.

3 open findings
6 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity MCP client lacks Streamable HTTP negotiation and SSE handling

samples/​csharp/​hosted-agents/​bring-your-own/​responses/​browser-automation/​src/​bat-csharp-byo/​utils/​ToolboxClient.cs:45

The client advertises MCP 2025-03-26, but the Streamable HTTP transport requires POST requests to accept both application/json and text/event-stream. This pipeline sets no Accept header and later assumes the response is a single JSON document, so a compliant GA endpoint may reject the call or return SSE that cannot be parsed. Add both response formats or use an MCP transport client.

Medium severity MCP client lacks Streamable HTTP negotiation and SSE handling

samples/​python/​hosted-agents/​bring-your-own/​responses/​browser-automation/​src/​bat-python-byo/​utils/​toolbox.py:44

This client now advertises MCP 2025-03-26, whose Streamable HTTP transport requires every POST to accept both application/json and text/event-stream. These headers omit Accept, and _post unconditionally parses a JSON body, so a compliant GA endpoint may reject the request or return SSE that this client cannot consume. Add protocol-compliant content negotiation and handle both response formats, or use an MCP transport client.

🧠 Review effort: Balanced

@mohitpavan
Mohit Pavan Kumar Gadamsetty (mohitpavan) merged commit f5874ec into main Oct 15, 2026
18 checks passed
@mohitpavan
Mohit Pavan Kumar Gadamsetty (mohitpavan) deleted the users/mohit/bat-ga-mcp branch October 15, 2026 12:12

This branch was successfully deployed

1 active deployment
L4-validation — 56e33b16 Deployed Oct 14, 2026 by mohitpavan via trusted #543
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants