-
Notifications
You must be signed in to change notification settings - Fork 77
Feature/mcp integration #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Sakalya100
wants to merge
39
commits into
main
Choose a base branch
from
feature/mcp_integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ **Implemented MCP integration in Cortexon using `pydantic-ai-mcp`** - The **Orchestrator Agent** now acts as the **MCP client**, while the other agents function as **MCP servers**. - This enables seamless coordination and communication between distributed agents.⚠️ **Current Blocker:** Encountering a `ModuleNotFoundError` for `pydantic_ai.mcp`, which seems to be a dependency issue. > cc @AryanGurav106 — need help resolving this import issue.
- Updated `anthropic`, `groq`, and `openai` dependencies to their latest versions. - Refactored agent initialization to use `provider` instead of `anthropic_client` for better clarity.
…alization - Updated pydantic-ai dependencies to version 0.1.2. - Initialized AnthropicProvider with API key in code, planner, and orchestrator agents as per new updates - Added MCP server initialization and proper client call to server
1. Changed MCP Server initialisation using MCPServerHTTP 2. Updated cortex_on Dockerfile to run server on 3001 port
- Updated `anthropic`, `groq`, and `openai` dependencies to their latest versions. - Refactored agent initialization to use `provider` instead of `anthropic_client` for better clarity.
…alization - Updated pydantic-ai dependencies to version 0.1.2. - Initialized AnthropicProvider with API key in code, planner, and orchestrator agents as per new updates - Added MCP server initialization and proper client call to server
1. Changed MCP Server initialisation using MCPServerHTTP 2. Updated cortex_on Dockerfile to run server on 3001 port
- Updated Dockerfile to run only the main API, with the MCP server started programmatically in a separate thread. - Refactored instructor.py to dynamically register MCP server tools and manage their execution, improving modularity and reducing direct dependencies in the MCP server. - Added threading support for MCP server initialization to enhance responsiveness.
- Moved the ask_human function from instructor.py to orchestrator_agent.py, attached to client directly to avoid future event loops
- Added a unique message_id to responses in instructor.py and orchestrator_agent.py to improve message tracking. - Updated StreamResponse format to include message_id for better identification of messages. - Modified ChatList component to handle message_id for updating and rendering messages, ensuring accurate message updates and preventing duplicates.
- Introduced a ServerManager class to handle multiple MCP server instances, allowing for dynamic server startup and management. - Updated the start_mcp_server function for better server initialization and registration of tools. - Enhanced the register_tools function to target specific server instances, improving modularity. - Modified the SystemInstructor class to support multiple server configurations, ensuring flexibility in orchestration. - Added backward compatibility for legacy server startup methods.
- Refactored code and added ServerManager class and tool registration to mcp_server.py for server related functionalities - Removed print statements - Removed unused dependencies imported in files - Restructured instructor.py with SystemInstructor class only
- Added support for GitHub and Server Time mcp servers - Added dynamic prompts and server initialisation in runtime
- Dynamic Prompts Update with respect to servers and tools associated in the config
- Streaming of status update for external server to UI through websocket
- Handling proper server reset and shutdown on New Chat to overcome duplicate tool name issue when re-attaching servers and tools in runtime
- Added GET and POST APIs for MCP UI - Added request models for POST API for standaridzed request
… error handling to backend - Added concise success/error messages for enable/disable actions in MCP service components - Removed all detailed frontend error parsing and validation logic - Now rely on backend for all error handling and validation, reducing frontend complexity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Model Context Protocol (MCP) Integration Feature PR
Features
Fixes
Technical Details
This PR introduces MCP integration with all existing capabilities supported by agent through a MCP Server