Using Kagent agents via MCP#
Kagent exposes all running agents via a Model Context Protocol (MCP) server embedded in the control plane HTTP server. This allows you to interact with your Kagent agents using any MCP-compliant client at http://<IP_ADDRESS>/mcp.
Setting up#
Connect your MCP client to the Kagent MCP endpoint using the Streamable HTTP transport.
Local Development#
If you are running Kagent locally, you can port-forward the control plane service:
kubectl port-forward -n kagent svc/kagent-controller 8083:8083
Then use http://localhost:8080/mcp as your MCP endpoint. Otherwise, use the IP address of your kagent control plane.
Example: Cursor Configuration#
Add the following to your Cursor MCP settings:
{"mcpServers": {"kagent-agents": {"url": "http://localhost:8083/mcp"}}}
Note: Ensure the port matches your local setup (e.g., 8083).
Example: Claude Code#
To add Kagent to Claude Code:
claude mcp add --transport http kagent http://localhost:8083/mcp
Add --scope project to limit the configuration to the current project.
SSE (Server-Sent Events) is currently not supported. You must use Streamable HTTP. Future updates will include stdio support via the CLI.
Using the MCP Server#
The MCP server exposes two core tools:
list_agents: Lists all available agents.invoke_agent: Runs a specific agent by name with a given input. SupportssessionIDfor continuing conversations.
This architecture enables MCP clients (like Cursor or other agents) to discover and orchestrate Kagent agents as "sub-agents," delegating specialized tasks or cluster actions securely.
Tools Overview#

Example Usage#
Here is an example of asking Claude about a Kubernetes cluster:

In this workflow, the client first calls list_agents to discover capabilities, then calls invoke_agent to execute the k8s-agent with the user's query.
Try it out and see what you can do! Feel free to open issues for feedback or suggestions.