Commit Graph

4 Commits

Author SHA1 Message Date
Devin AI
d25bea781d fix: Resolve test failures in HTTP MCP support tests
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>
2025-11-10 15:22:50 +00:00
Devin AI
6063677c01 fix: Correct MCPToolWrapper patch path in fragment filtering test
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>
2025-11-10 15:17:30 +00:00
Devin AI
cfaa44012f fix: Update warning log tests to use custom Logger monkeypatch
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>
2025-11-10 15:10:59 +00:00
Devin AI
697182b0ef feat: Add HTTP support for local MCP servers (#3876)
- 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>
2025-11-10 15:05:30 +00:00