1. Fragment filtering test: Added proper assertion for MCPToolWrapper call
and verified the mock tool is returned in the result list.
2. Logger patching tests: Changed from patching instance method to patching
class method to avoid Pydantic's __delattr__ restriction. This prevents
AttributeError when the patch context manager tries to restore the
original attribute.
Co-Authored-By: João <joao@crewai.com>
The test was patching 'crewai.agent.core.MCPToolWrapper' but the import
happens inside _get_external_mcp_tools as 'from crewai.tools.mcp_tool_wrapper
import MCPToolWrapper'. Updated to patch the correct import path to ensure
the test works when it actually runs.
Co-Authored-By: João <joao@crewai.com>
The project uses a custom Logger that emits via _logger.log() rather than
Python's standard logging module, so caplog won't capture the warnings.
Updated tests to monkeypatch agent._logger.log instead of using caplog.
Co-Authored-By: João <joao@crewai.com>
- Update validate_mcps() to accept http://, https://, and crewai-amp: URLs
- Update _get_mcp_tools_from_string() to route http:// URLs to _get_external_mcp_tools()
- Add warning log when http:// scheme is detected (security awareness)
- Update mcps field description to mention http:// support for local development
- Update HTTPTransport and MCPServerHTTP docstrings with http:// examples
- Add comprehensive tests for HTTP MCP support
This enables developers to use local MCP servers running on http://localhost
or other local HTTP endpoints during development, while maintaining security
awareness by logging warnings when http:// is used.
Fixes#3876
Co-Authored-By: João <joao@crewai.com>