MCP Tools¶
Tools extend what agents can do. Every tool the operator manages speaks MCP — the Model Context Protocol — a JSON-RPC interface that lets agents discover and call tools at runtime.
This guide adds a Kubernetes tool to the agent you deployed in Quick Start.
Prerequisites¶
A cluster with a running agent from the Quick Start.
Step 1: Create a LanguageTool¶
A LanguageTool describes a tool server. The operator creates and manages its Deployment, Service, and NetworkPolicy.
kubectl apply -f - <<EOF
apiVersion: langop.io/v1alpha1
kind: LanguageTool
metadata:
name: k8s
spec:
image: ghcr.io/language-operator/k8s-tool:latest
port: 80
EOF
Wait for the tool to be ready:
Once ready, the operator has queried the tool and catalogued its capabilities:
[
{
"name": "kubectl_get",
"description": "Get Kubernetes resources",
"inputSchema": { ... }
},
{
"name": "kubectl_apply",
"description": "Apply a Kubernetes manifest",
"inputSchema": { ... }
}
]
Step 2: Attach the Tool to Your Agent¶
Add spec.tools to your agent and re-apply:
Watch the agent pod restart with the updated configuration:
Step 3: Verify¶
OpenClaw reads its tool config from openclaw.json, which the openclaw-adapter init
container writes on every pod start from the operator-injected config.yaml. Confirm
the k8s server was registered:
OpenCode reads its tool config from /etc/opencode/opencode.jsonc, which the
opencode-adapter init container writes on every pod start from the
operator-injected config.yaml. Confirm the k8s server was registered:
Your agent now has access to Kubernetes operations. Ask it to list the pods in your namespace.
What Just Happened?¶
When the LanguageTool was created, the operator:
- Deployed the tool image as a
Deploymentnamedk8s - Created a
Servicenamedk8son port 80 - Created a
NetworkPolicypermitting egress to the Kubernetes API server (auto-detected from the cluster CNI) - Queried
POST /mcp→tools/liston the service, and stored the discovered schemas instatus.toolSchemas
When the agent was updated, the operator:
- Resolved the
k8sLanguageTool to its in-cluster DNS address - Updated
config.yaml(mounted at/etc/agent/config.yaml) with the tool endpoint - Rolled the agent pod to pick up the new configuration
On pod start, each runtime's adapter init container reads config.yaml and writes the tool endpoints into the runtime's native config before the agent starts — no agent code changes required.
What's Next?¶
- Tools reference — sidecar mode, network policies, and writing your own tool server
- LanguageTool API reference — full spec field documentation