-
Notifications
You must be signed in to change notification settings - Fork 372
Official KMCP Support #683
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
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@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 brings official KMCP (Kubernetes Model Control Protocol) support to KAGENT by refactoring the Agent API to support multiple server types including Service, MCPServer, and the new RemoteMCPServer. The major change is replacing the legacy ToolServer with RemoteMCPServer while adding support for MCP service discovery.
- Introduces new
RemoteMCPServerCRD (v1alpha2) to replace legacyToolServer - Updates
AgentAPI to reference tools using typed object references instead of string references - Adds support for MCP service auto-discovery through Kubernetes Services
Reviewed Changes
Copilot reviewed 91 out of 94 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/types/index.ts | Updates TypeScript interfaces for tool references from string refs to typed references |
| ui/src/lib/toolUtils.ts | Refactors tool utility functions to use new typed reference structure |
| ui/src/components/*/tsx | Updates UI components to handle new tool reference format |
| ui/src/app/actions/agents.ts | Modifies agent actions to work with typed tool references |
| helm/*/yaml | Migrates Helm charts from v1alpha1 to v1alpha2 API versions |
| go/pkg/client/api/types.go | Updates API types to use v1alpha2 versions |
| go/internal/*/go | Refactors Go code to support new KMCP architecture |
| go/controller/*/go | Implements new controllers for RemoteMCPServer and MCP service discovery |
| break | ||
| } | ||
| } | ||
| return nil, fmt.Errorf("no port found for service %s with protocol %s", svc.Name, protocol) |
Copilot
AI
Aug 4, 2025
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 error is returned even when a port is found (port != 0). The return statement should be moved outside the for loop or the logic should be restructured to only return this error when no matching port is found.
| return nil, fmt.Errorf("no port found for service %s with protocol %s", svc.Name, protocol) | |
| if port == 0 { | |
| return nil, fmt.Errorf("no port found for service %s with protocol %s", svc.Name, protocol) | |
| } |
| if state.isVisited(toolRef) { | ||
| return nil, nil, fmt.Errorf("cycle detected in agent tool chain: %s -> %s", agentRef, toolRef) | ||
| if state.isVisited(agentRef.String()) { | ||
| return nil, nil, fmt.Errorf("cycle detected in agent tool chain: %s -> %s", agentRef, agentRef.String()) |
Copilot
AI
Aug 4, 2025
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.
The error message shows the same reference twice (agentRef and agentRef.String()). It should show the current agent and the tool reference that creates the cycle.
| return nil, nil, fmt.Errorf("cycle detected in agent tool chain: %s -> %s", agentRef, agentRef.String()) | |
| currentAgentRef := types.NamespacedName{Name: agent.Name, Namespace: agent.Namespace} | |
| return nil, nil, fmt.Errorf("cycle detected in agent tool chain: %s -> %s", currentAgentRef, agentRef) |
|
|
||
| if state.depth > MAX_DEPTH { | ||
| return nil, nil, fmt.Errorf("recursion limit reached in agent tool chain: %s -> %s", agentRef, toolRef) | ||
| return nil, nil, fmt.Errorf("recursion limit reached in agent tool chain: %s -> %s", agentRef, agentRef.String()) |
Copilot
AI
Aug 4, 2025
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.
Same issue as above - the error message shows the same reference twice instead of showing the chain that caused the recursion limit.
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
…ent into eitanya/kmcp
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
…nya/kmcp * 'eitanya/kmcp' of github.com:kagent-dev/kagent: fix(ui): display description for agent tools when editing an agent (#692) fix(ui): correct link to switch agent from within chat (#667) EP-685-kmcp (#686) eitanya/fix-python-release (#698) feat: make streaming buffer size configurable (#696)
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Peter Jausovec <peterj@users.noreply.github.com>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
…state Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
|
@EItanya did we remove the ability to attach Memory to Agents for a reason? |
* feat(all): Add support for kmcp to kagent Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * fixed schema issues Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * make ui compile, but it needs to take into account kinds Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * fix up the charts to deploy using kmcp by default Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * run kmcp code inside of kagent Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * fixes helm unit tests Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * make kagent.dev default group Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * switch over to services and MCPService Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * update CR Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * fix service problem Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * local Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * remove failing test Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> * fix the selected tool removal Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> * Refactor tool handling and server integration Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> * fix and add more ui tests Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> * add support for creating MCPServers Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> * update UI to allow creating MCPServer CRDs (stdio) Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> * fix build break Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> * sort namespace alphabetically Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> * only show available models (from the same ns as agent) + fix loading state Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> * fix go unit tests Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> --------- Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io> Signed-off-by: Peter Jausovec <peter.jausovec@solo.io> Signed-off-by: Peter Jausovec <peterj@users.noreply.github.com> Co-authored-by: Peter Jausovec <peter.jausovec@solo.io> Co-authored-by: Peter Jausovec <peterj@users.noreply.github.com> Signed-off-by: Sara Qasmi <saraqasmi@Saras-MacBook-Pro.local>
This PR bring official KMCP support to KAGENT 🎉
AgentAPI to allow pointing toService,MCPServeror newRemoteMCPServerToolServerin favor of newRemoteMCPServer