mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 16:48:30 +00:00
* mcp server proposal * Refactor MCP server implementation: rename MCPServer to MCPServerAdapter and update usage examples. Adjust error message for optional dependencies installation. * Update MCPServerAdapter usage examples to remove unnecessary parameters in context manager instantiation. * Refactor MCPServerAdapter to move optional dependency imports inside the class constructor, improving error handling for missing dependencies. * Enhance MCPServerAdapter by adding type hinting for server parameters and improving error handling during server startup. Optional dependency imports are now conditionally loaded, ensuring clearer error messages for missing packages. * Refactor MCPServerAdapter to improve error handling for missing 'mcp' package. Conditional imports are now used, prompting users to install the package if not found, enhancing user experience during server initialization. * Refactor MCPServerAdapter to ensure proper cleanup after usage. Removed redundant exception handling and ensured that the server stops in a finally block, improving resource management. * add documentation * fix typo close -> stop * add tests and fix double call with context manager * Enhance MCPServerAdapter with logging capabilities and improved error handling during initialization. Added logging for cleanup errors and refined the structure for handling missing 'mcp' package dependencies. --------- Co-authored-by: lorenzejay <lorenzejaytech@gmail.com>