Access Teleport Kubernetes clusters over MCP
Did you know? MCP access is part of a broader Agentic Identity Framework.
The Agentic Identity Framework is a standards-driven set of designs, SDKs, and reference implementations for deploying AI agents securely.
This guide shows you how to connect to Teleport Kubernetes clusters with MCP clients.
Prerequisites
-
A running Teleport cluster accessible at a hostname with a valid TLS certificate. If you want to get started with Teleport, sign up for a free trial or set up a demo environment.
-
The
tshclient.Installing
tshclient-
Determine the version of your Teleport cluster. The
tshclient must be at most one major version behind your Teleport cluster version. Send a GET request to the Proxy Service at/v1/webapi/findand use a JSON query tool to obtain your cluster version. Replace teleport.example.com:443 with the web address of your Teleport Proxy Service:- Mac/Linux
- Windows - Powershell
TELEPORT_DOMAIN=teleport.example.com:443TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')"$TELEPORT_DOMAIN = "teleport.example.com:443"$TELEPORT_VERSION = (Invoke-RestMethod -Uri "https://${TELEPORT_DOMAIN}/v1/webapi/find").server_version -
Follow the instructions for your platform to install
tshclient:- Mac
- Windows - Powershell
- Linux
Download the signed macOS .pkg installer for Teleport, which includes the
tshclient:curl -O https://cdn.teleport.dev/teleport-${TELEPORT_VERSION?}.pkgIn Finder double-click the
pkgfile to begin installation.dangerUsing Homebrew to install Teleport is not supported. The Teleport package in Homebrew is not maintained by Teleport and we can't guarantee its reliability or security.
curl.exe -O https://cdn.teleport.dev/teleport-v$TELEPORT_VERSION-windows-amd64-bin.zipUnzip the archive and move the `tsh` client to your %PATH%
NOTE: Do not place the `tsh` client in the System32 directory, as this can cause issues when using WinSCP.
Use %SystemRoot% (C:\Windows) or %USERPROFILE% (C:\Users\<username>) instead.
All of the Teleport binaries in Linux installations include the
tshclient. For more options (including RPM/DEB packages and downloads for i386/ARM/ARM64) see our installation page.curl -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gztar -xzf teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gzcd teleportsudo ./installTeleport binaries have been copied to /usr/local/bin
Connecting with TLS routing disabled
This guide's commands assume your Teleport cluster uses TLS routing (
proxy_listener_mode: multiplex), where thetshclient reach every Teleport service through the Proxy Service's web address on port443. If you're not sure whether this applies to your cluster, check with whoever manages it.If your cluster uses separate listener ports instead, adjust ports as follows:
-
tshcommands (e.g.,tsh login --proxy=...): continue using the Proxy Service web address on port3080(or443if behind a load balancer). Do not change these to port3025. -
Direct
tctlor Auth Service API commands: use port3025for the Auth Service gRPC listener:tctl status --auth-server=teleport.example.com:3025
-
- Kubernetes Clusters enrolled with Teleport. See our guides.
This guide uses interactive tsh login. For headless environments, CI/CD
pipelines, or automation, use Machine ID
(tbot) to issue short-lived credentials without interactive authentication.
Step 1/2. List available MCP servers
First, sign in into your Teleport cluster using tsh login:
tsh login --proxy=teleport.example.com:443 --user=myuser@example.com
To list Kubernetes clusters available for you to access:
tsh kube lsKube Cluster Name Labels Selected----------------- ------- --------minikube env=dev *
Now log in to your Kubernetes cluster, replacing minikube with your Kubernetes cluster name:
tsh kube login minikubeLogged into Kubernetes cluster "minikube". Try 'kubectl version' to test the connection.
This command also updates your default Kubernetes config.
Step 2/2. Configure MCP clients
Configure your MCP clients to use the
kubernetes-mcp-server
MCP server.
- Claude Desktop
- Cursor
- VS Code / VS Code Insiders
Open your claude_desktop_config.json and add the MCP server to the list of
mcpServers:
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": [
"-y",
"kubernetes-mcp-server@latest"
]
}
}
}
You can install the extension by editing the mcp.json file:
{
"mcpServers": {
"kubernetes-mcp-server": {
"command": "npx",
"args": ["-y", "kubernetes-mcp-server@latest"]
}
}
}
You can install the extension by running the following command:
For VS Code
code --add-mcp '{"name":"kubernetes","command":"npx","args":["kubernetes-mcp-server@latest"]}'For VS Code Insiders
code-insiders --add-mcp '{"name":"kubernetes","command":"npx","args":["kubernetes-mcp-server@latest"]}'
After configuring your MCP client, you will find Kubernetes and Helm tools from
kubernetes-mcp-server.
You can now use these tools to interact with your Kubernetes clusters via Teleport in your MCP clients:
Teleport behind TLS-terminating load balancers
If your Teleport cluster is behind a TLS-terminating load balancer or reverse
proxy, you can start a local proxy with tsh:
tsh proxy kube -p 8888
Copy the KUBECONFIG path from the output of the command, and add it with the
--kubeconfig flag in your MCP client configuration. For example:
{
"mcpServers": {
"kubernetes-mcp-server": {
"command": "npx",
"args": ["-y", "kubernetes-mcp-server@latest", "--kubeconfig", "/path/to/your/tsh/localproxy-8888-kubeconfig"]
}
}
}
Alternatively, you can use Teleport Connect to run
the local proxy to your Kubernetes cluster. You can find the KUBECONFIG path
from the terminal in Teleport Connect:
echo $KUBECONFIG/path/to/your/minikube-kubeconfig