For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Add an MCP server
Register a Model Context Protocol server in the kagent UI and give its tools to your agent.
A system prompt tells an agent how to behave. Tools tell it what it can do. In this tutorial, you register a weather Model Context ProtocolModel Context ProtocolAn open protocol for exposing tools and resources to a model. kagent reaches an MCP server through a RemoteMCPServer resource, and an AgentTemplate binds individual tools from it.Learn more (MCP) server in the kagent UI, and give its tool to the personal assistant from Build an Agent.
To bind a tool from YAML instead, see Your first MCP tool.
Before you begin
- Complete Build an Agent, so that the
personal-assistantagent exists. - Make sure that your cluster can reach the internet. The servers in this tutorial are public endpoints.
Note
The weather server in this tutorial is a public demonstration server that the kagent project does not run. It can be slow to answer its first request, and it can change or go away. Any MCP server that speaks streamable HTTP or SSE works the same way.
Register the MCP server

In the sidebar, click MCP Servers, and then click New Server.
Fill in the form.
Field Value Name weatherNamespace kagentServer URL mcp-weather-1cyg.onrender.com/mcpTLS HTTPS. The scheme in front of the URL changes to https://.Use streamable HTTP instead of SSE Selected, which is the default. Click Create server. kagent connects to the server and reads its list of tools.
On the MCP servers page, click Refresh until the
weatherserver shows1in the Tools column. Expand the row to see the tool,get_weather, which returns the current weather for a pair of GPS coordinates.
Give the tool to your agent
In the sidebar, click Agents. In the row of the
personal-assistantagent, click the edit icon.Under Tools from MCP servers, click Add an MCP server, and choose
kagent/weatherfrom the MCP server list.Leave the tool list on All tools to expose every tool from the server. To expose only some tools, choose them from that list. To make the agent pause for your approval before it runs a tool, select Require approval.
Click Save agent. The agent shows the Updating status while kagent prepares a new revision, and then returns to Ready.
Click the agent name to open its chat page, and ask about the weather, such as
What is the weather in Toronto right now?.
An agent does not need an egress policy to reach a model or a registered MCP server.
Try another server
Register a second server the same way. The Solo.io documentation search server is a public server that needs no API key.
| Field | Value |
|---|---|
| Name | solo-docs |
| Server URL | search.solo.io/mcp |
| TLS | HTTPS |
The server offers three tools: search, get_chunks, and get_full_page. Add it to the personal assistant to let the agent answer questions from the Solo.io product documentation.
YAML version
Everything that you did in the UI is stored as Kubernetes resources. To create the same resources from the command line, or to keep them in a Git repository, apply this YAML.
The weather MCP server
kubectl apply -f - <<EOF
apiVersion: api.kagent.dev/v1alpha3
kind: RemoteMCPServer
metadata:
name: weather
namespace: kagent
spec:
protocol: STREAMABLE_HTTP
url: https://mcp-weather-1cyg.onrender.com/mcp
timeout: 5s
terminateOnClose: true
EOFThe personal-assistant agent, with the weather tools
kubectl apply -f - <<EOF
apiVersion: api.kagent.dev/v1alpha3
kind: Agent
metadata:
name: personal-assistant
namespace: kagent
spec:
harnessRef:
name: kagent-default
template:
inline:
description: My personal assistant
modelConfig:
name: default-model-config
systemPrompt: |-
You are my personal assistant. Be friendly and concise. Help me plan my day, draft messages, and answer questions.
tools:
- mcp:
server:
kind: RemoteMCPServer
name: weather
EOF