-
Notifications
You must be signed in to change notification settings - Fork 371
feat: Merge KMCP crd and controller into Kagent #939
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
Conversation
- added mcp server crd - added mcp server controller to manage mcp server deployment lifecycle - added transport adapter layer to support stdio -> http transport conversion - refactored existing mcp_server_controller iinto mcp_server_tool_controller to manage tool discovery for mcp server tools Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
… helm chart Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
- add e2e test using agent with tool from mcp server deployed using mcpServer CRD - fix issue with mcpServer deployment status not being updated after deployment becomes ready Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
|
|
||
| // +kubebuilder:rbac:groups=kagent.dev,resources=mcpservers,verbs=get;list;watch | ||
|
|
||
| func (r *MCPServerToolController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the original mcp server controller that was implemented as a part of the kmcp integration. I renamed it to mcp_server_tool_controller to better represent its responsibility of updating the tool server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need 2 controllers? Now we can re-use since all of the logic is internal
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
b374258 to
6433423
Compare
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates KMCP CRD and controller functionality into Kagent, removing the external KMCP dependency. It adds a new MCPServer CRD to Kagent with deployment lifecycle management capabilities and refactors existing MCP server handling to separate tool discovery from deployment concerns.
- Adds MCPServer CRD to Kagent with comprehensive status conditions and deployment configuration
- Introduces MCPServerController for deployment lifecycle management and MCPServerToolController for tool discovery
- Removes KMCP dependency and migrates transport adapter functionality into Kagent
Reviewed Changes
Copilot reviewed 26 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| go/api/v1alpha1/mcpserver_types.go | Defines new MCPServer CRD with transport types, status conditions, and deployment specifications |
| go/internal/controller/mcp_server_controller.go | Implements MCPServer deployment lifecycle controller with RBAC permissions |
| go/internal/controller/mcp_server_tool_controller.go | Handles tool discovery functionality for MCPServer resources |
| go/internal/controller/translator/translator_adapter.go | Provides transport adapter translation logic for MCPServer to Kubernetes resources |
| go/internal/controller/reconciler/reconciler.go | Adds MCPServer deployment reconciliation method |
| go/test/e2e/manifests/*.yaml | Test manifests for declarative agent using MCPServer tools |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
EItanya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looking great. The main themes of my review are to clean up the controllers and translation. For future work I would like us to try and unify our approach for mcp server outputs and agent outputs.
|
|
||
| // +kubebuilder:rbac:groups=kagent.dev,resources=mcpservers,verbs=get;list;watch | ||
|
|
||
| func (r *MCPServerToolController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need 2 controllers? Now we can re-use since all of the logic is internal
- partition agent and mcp translator into respective directories in the translator dir - use mock server in e2e test - reverted CI changes Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
1c37c95 to
ed296b7
Compare
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
This PR contains the following changes and is the first in two PRs to migrate KMCP into Kagent. The second PR will focus on migrating the KMCP cli functionalities into the Kagent CLI. - Added KMCP's `mcpServer` CRD to Kagent. - Added a new controller that watches for the `mcpServer` CRD and handles the deployment lifecycle of the mcp server deployment. - Refactored existing mcp server controller into `mcp_server_tool_controller` to better reflect its responsibilities of managing tool discovery. - Added new e2e test for a declarative agent using tools derived from a mcp server deployed using the `mcpServer` CRD. Manual Testing: - Interacted with agent using tools derived from the deployed mcp server. - Tested deleting mcp tool server in the UI. (This is the only portion of the UI that was using kmcp resources) --------- Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
This PR contains the following changes and is the first in two PRs to migrate KMCP into Kagent. The second PR will focus on migrating the KMCP cli functionalities into the Kagent CLI.
mcpServerCRD to Kagent.mcpServerCRD and handles the deployment lifecycle of the mcp server deployment.mcp_server_tool_controllerto better reflect its responsibilities of managing tool discovery.mcpServerCRD.Manual Testing: