Skip to content

Bugfix: Fix MCP integration by ignoring proxy environment variables#3014

Open
xuyaqist wants to merge 1 commit into
developfrom
xyq/bugfix_tianzhou
Open

Bugfix: Fix MCP integration by ignoring proxy environment variables#3014
xuyaqist wants to merge 1 commit into
developfrom
xyq/bugfix_tianzhou

Conversation

@xuyaqist
Copy link
Copy Markdown
Contributor

Bugfix: Fix MCP integration by ignoring proxy environment variables

@xuyaqist xuyaqist requested review from Dallas98 and WMC001 as code owners May 21, 2026 11:28
Copilot AI review requested due to automatic review settings May 21, 2026 11:28
Copy link
Copy Markdown
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 aims to fix MCP connectivity issues caused by proxy environment variables by ensuring MCP HTTP(S) requests do not inherit proxy settings from the runtime environment.

Changes:

  • Added a shared httpx.AsyncClient factory with trust_env=False for MCP transports.
  • Wired the factory into FastMCP SSETransport and StreamableHttpTransport usage in both tool configuration and remote MCP health checks.

Reviewed changes

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

File Description
backend/services/tool_configuration_service.py Injects a custom httpx_client_factory into MCP transports created for tool discovery/execution.
backend/services/remote_mcp_service.py Adds create_httpx_client and uses it in MCP health-check transport construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

timeout=timeout,
auth=auth,
trust_env=False,
verify=False,
Comment on lines +33 to +37
return AsyncClient(
headers=headers,
timeout=timeout,
auth=auth,
trust_env=False,
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.

2 participants