Add an MCP server
Register a Model Context Protocol server and give its tools to your agent.
About this tutorial
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.
A registered server is a RemoteMCPServer resource. kagent connects to it, reads its tool list, and lets any agent in the namespace bind those tools, without an egress policy. For how agents use tools, see About tools and Core concepts.
To bind a tool from YAML instead, see Your first MCP tool.
Time: about 10 minutes.
Before you begin
- Complete Build an agent, so that the
personal-assistantagent exists. - Make sure that your cluster can reach the internet. The weather server in this tutorial is a public demonstration server that the kagent project does not run, so it can change or go away. Any MCP server that speaks streamable HTTP or SSE works the same way.
Register the server and use it
Follow the steps in the kagent UI, or apply the same resources as YAML from the command line.
Open the kagent UI
kagent dashboardThe command forwards the UI to http://localhost:8082 and opens it in your browser. Leave it running while you work.
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. Connection timeout 60s. When the server has been idle, its first answer can take close to a minute.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
An agent does not need an egress policy to reach a model or a registered MCP server.
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?.
Verify the tool
Check that kagent accepted the weather server.
kubectl get remotemcpserver weather -n kagentThe
ACCEPTEDcolumn showsTrue.Check that the agent is ready again after the change.
kubectl get agent personal-assistant -n kagentExample output:
NAME READY AGE personal-assistant True 10mIn the kagent UI, open a New chat with
personal-assistant, and askWhat is the weather in Toronto right now?The conversation shows aget_weathertool call before the answer.
What you built
An agent that calls a tool from a remote MCP server. Along the way, you used these features:
| Feature | What you did | Read more |
|---|---|---|
| Remote MCP servers | Registered a server that speaks streamable HTTP, with a connection timeout | About tools |
| Tool bindings | Gave the agent the server’s tools, all of them or a chosen few | About tools |
Clean up
If you go on to Human in the loop, keep these resources, because that tutorial reuses them.
- Delete the agent and the weather server.
kubectl delete agent personal-assistant -n kagent kubectl delete remotemcpserver weather -n kagent