Commit Graph

4 Commits

Author SHA1 Message Date
Devin AI
db4cb93770 fix: inject MCP tools in standalone agent execution (fixes #4133)
The LLM was not seeing MCP tools when using standalone agent execution
(without Crew) because the prepare_tools function in agent/utils.py
did not inject MCP tools.

Changes:
- Modified prepare_tools() in agent/utils.py to inject MCP tools when
  agent.mcps is configured, with graceful error handling
- Fixed Agent.kickoff_async() to inject MCP tools like kickoff() does
- Added comprehensive tests for MCP tool injection in prepare_tools

The fix ensures MCP tools are visible to the LLM in both:
1. Standalone agent execution via execute_task/aexecute_task
2. Async agent execution via kickoff_async

Co-Authored-By: João <joao@crewai.com>
2025-12-20 13:00:47 +00:00
Greyson LaLonde
bed9a3847a fix: remove invalid param from sse client (#3980) 2025-11-26 21:37:55 -08:00
Lorenze Jay
b2c278ed22 refactor: improve MCP tool execution handling with concurrent futures (#3854)
- Enhanced the MCP tool execution in both synchronous and asynchronous contexts by utilizing  for better event loop management.
- Updated error handling to provide clearer messages for connection issues and task cancellations.
- Added tests to validate MCP tool execution in both sync and async scenarios, ensuring robust functionality across different contexts.
2025-11-06 19:28:08 -08:00
Lorenze Jay
6f36d7003b Lorenze/feat mcp first class support (#3850)
* WIP transport support mcp

* refactor: streamline MCP tool loading and error handling

* linted

* Self type from typing with typing_extensions in MCP transport modules

* added tests for mcp setup

* added tests for mcp setup

* docs: enhance MCP overview with detailed integration examples and structured configurations

* feat: implement MCP event handling and logging in event listener and client

- Added MCP event types and handlers for connection and tool execution events.
- Enhanced MCPClient to emit events on connection status and tool execution.
- Updated ConsoleFormatter to handle MCP event logging.
- Introduced new MCP event types for better integration and monitoring.
2025-11-06 17:45:16 -08:00