Fix function integration issues in MCP client and custom controller #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves critical function integration issues that were causing runtime errors and inconsistencies across the Browser Use Web UI codebase.
Issues Fixed
Function Signature Mismatch
The
setup_mcp_client_and_tools()function insrc/utils/mcp_client.pywas returning a singleOptional[MultiServerMCPClient]value, but test code was attempting to unpack it as a tuple:The function now correctly returns a single value and the test has been updated accordingly:
Pydantic Import Conflicts
The MCP client module had conflicting imports from both
pydanticandpydantic.v1, causing integration issues:Now uses consistent
pydanticimports throughout:Documentation Inconsistency
The function docstring claimed to return a tuple but the implementation returned a single value. The docstring now accurately reflects the actual behavior.
Impact
These fixes ensure:
Files Changed
src/utils/mcp_client.py- Fixed pydantic imports and updated docstringtests/test_controller.py- Updated to use correct function signatureThe changes are minimal and surgical, preserving all existing functionality while resolving the integration inconsistencies.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
eu.i.posthog.comimport sys
sys.path.append('.')
Test the main webui can be imported and initialized
from src.webui.interface import create_interface
from src.webui.webui_manager import WebuiManager
print('Testing WebUI integration...')
manager = WebuiManager()
print('✓ WebuiManager created successfully')
Test that we can create interface components
print('✓ WebUI interface components can be imported')
print('✓ Main WebUI integration validated')` (dns block)
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.