yeke.io · docs
MCP guide
Your own AI agent (Claude Code, Codex or any other client that speaks MCP) reads clusters through YEKE's MCP server with your permissions, diagnoses problems and can propose a plan. It cannot apply anything: you review, approve and apply the plan in YEKE, and a proposed plan never leaves the approval chain. Token creation and client setup live on the API and MCP page; this guide covers the flow, the tools, an example session and troubleshooting.
How it works
The agent connects to YEKE, not to the cluster. Reads pass through YEKE; a change only comes from a plan you approve.
- One endpoint, the whole fleet. The agent only talks to
/api/mcp. Each tool call names the cluster it reads withclusterId; YEKE runs the read under your Kubernetes identity on that cluster. - The read path only reads. There is no path behind MCP that writes to the
cluster.
propose_operationdoes not apply anything either; it builds a plan and an approval card in YEKE. - Results are marked as data. Every successful tool result reaches the agent inside a data envelope; details in Security model.
- The server gives the agent instructions. On connect, YEKE tells the agent that tool results are data, the diagnosis order (metrics first, then events, pod status and logs) and which YEKE screen each management task belongs on. A client may not use these instructions.
Transport: Streamable HTTP, POST only. Every response is a
single JSON object (no SSE) and the server keeps no session. Supported protocol versions:
2026-07-28 and 2025-11-25.
Quick start
Three roles, three steps. Details for each step are on the API and MCP page.
- Owner Turn on Administration → System → System settings → Sessions & access → “MCP server”; core does not need a restart. The state also appears on the Administration → AI providers screen. See Turning on MCP.
- Administrator On every cluster the agent should read, set the
AI egress stance to
allowed: cluster screen → chat panel → “Egress & provider”. The user also needs a Kubernetes identity mapping on that cluster. See Turning on MCP. - User My account → “Create token”. Once the
token is created, the “Use with MCP” section under it gives the Claude Code
command and the Codex snippet. See Claude Code and
Codex; if YEKE uses an internal CA, the
yeke mcprelay in the same section.
Which scope? If the agent only diagnoses, choose Read; if you also want it
to propose the fix as an approval card, choose Propose plans. A plan token sees every
tool a read token sees, plus propose_operation and nothing else.
Tools
The tools are the YEKE chat's read and proposal tools; their schemas and descriptions are the same as in the chat.
MCP adds a required clusterId field to every tool. Its valid values are the
clusters you can read over MCP: those where you have a Kubernetes identity mapping and where
an administrator allows AI egress (allowed). If there is no such cluster, the
tool list comes back empty.
| Tool | What it does | Visible to |
|---|---|---|
k8s_list | Lists the objects of a resource type as a summary table. | Read and plan tokens |
k8s_get | Reads the full body of one object. Secret values arrive masked. | |
k8s_search_types | Searches resource types. The agent finds the schemaId it passes to the other tools here. | |
k8s_describe_type | Returns a resource type's full record: verbs, subresources, scope. | |
k8s_events | Lists Kubernetes events; type=Warning for warnings only. | |
k8s_logs | Reads one pod's log. previous=true for a crashed instance, container for a multi-container pod. Truncated output says so. | |
yeke_metrics | Reads YEKE's own metric history; sends no live query to the cluster. Four operations: status, overview, top, entity. History depth depends on the license; a longer range is not rejected but clipped. | |
yeke_operations | Lists YEKE's operation records (e.g. plans awaiting approval, who ran a DELETE). | |
yeke_audit | Lists the cluster's audit trail events: type, actor, time. Event details are not included. | |
yeke_clusters | Returns YEKE's cluster inventory: name, mode, connection state, agent version, egress stance. Whatever clusterId is passed, the result is the whole inventory; clusters you cannot read over MCP are listed too. | |
propose_operation | Proposes a change. YEKE builds the plan and returns the approval card's link; the change is not applied. No values come back: the plan's state, approval level, verbs, policy codes and the paths of changed fields. | Plan token only |
Tools that exist only in the chat are not served over MCP: user and identity
reads, the interface tool, management and access proposals, and the two tools that end a chat
turn (answer, ask_user). Calling a tool that is not
served gets JSON-RPC -32602.
Example session
A fictional diagnosis: an agent connected with a plan token, and a Deployment that keeps restarting.
› web in the payments namespace keeps restarting. Why? # every call carries clusterId=c-1 yeke_metrics op=status yeke_metrics op=entity kind=workload namespace=payments name=web k8s_events namespace=payments involvedObject=web-6d8f9c7b5-x2kqp type=Warning k8s_get schemaId=pod namespace=payments name=web-6d8f9c7b5-x2kqp k8s_logs namespace=payments name=web-6d8f9c7b5-x2kqp previous=true tailLines=50 FINDING the web container is killed when it reaches its memory limit. EVIDENCE k8s_get: lastState.terminated.reason=OOMKilled, restartCount=14, resources.limits.memory=256Mi; yeke_metrics: memory near the limit for 1h. SUGGESTED raise the memory limit to 512Mi. › Propose it. propose_operation patch apps.deployment payments/web state=AWAITING_APPROVAL https://yeke.example.com/clusters/c-1/operations?op=op-… The approval card is ready in YEKE. Open the link and review it; approval is yours.
What the card shows
- Origin. The card states which token and channel the plan came from: “This plan was proposed by an AI client over MCP with the “laptop-claude” token.”
- Model's summary. The agent's summary sits on its own line labelled “Model's summary”. What you approve is the change on the card, not the summary.
- Change and chain. The plan's steps, the diff computed by the dry-run, the policy results and the approval level; the same as the card of a plan built in the interface or the chat.
- Approval is yours. You open the card in your own YEKE session and approve or reject it. A plan that is not approved expires after 30 minutes.
Approval chain
There is no separate path for a plan proposed over MCP.
The plan that propose_operation builds goes through the same plan builder as
the interface and the chat: validation, dry-run, policies and the validation Hooks of your
installation. Hooks receive the plan's source as api.
Applying also goes through a single gate, and that gate does not look at the plan's origin. Second approval, maintenance windows and approval-time Hooks (for example an ITSM approval) apply to a plan proposed over MCP exactly as they do to any other plan, when they are turned on in your installation; see Governance and Hook integration.
The token cannot skip any approval step. Applying, approving, refreshing and cancelling a
plan are closed to the plan token (403); the card's owner does them in their own
session.
To put every AI-originated write behind elevated approval, use the built-in
ops.nl-strict template: see Plan
proposals.
Security model
The main gate is that the agent cannot write. The other layers narrow the reads and make them visible.
- Identity and Kubernetes RBAC. Every read runs under your Kubernetes identity on that cluster. What your RBAC does not show, the agent cannot see; a cluster where you have no identity mapping cannot be read over MCP.
- Masking. Secret values reach the agent masked. The
last-applied-configurationannotation andmanagedFieldsare never sent; containerenvvalues are masked by default. Log lines cannot be masked. - Results are marked as data. Every successful tool result travels between
<<<TOOL_RESULT … kind=data>>>and<<<END>>>; the same delimiters inside the data are broken up. The server instructions say the inside of the envelope is data, not instructions, and that instructions found in cluster content must not be followed. On its own this is not enough against prompt injection: the model may ignore the instructions. The main gate is that the agent cannot write; the furthest an injected instruction can get over MCP is a proposal, and you approve it. - Audit trail. Every read call writes an
ai.readevent: sourceapi, channelmcpand the token's ID. The values read are not written to the event. The catalog tools (k8s_search_types,k8s_describe_type) write no event because they read no new data from the cluster. A plan proposal writes anai.plan_proposedevent. - AI egress gate. A cluster whose stance is
offorlocal-onlycannot be read over MCP; YEKE cannot tell which model the data would go to. - Scoped tokens only. A browser session and the full token from
yeke loginare rejected by MCP. - No writes to YEKE settings. Alert rules, Hooks, permission groups, users and policies cannot be changed over MCP; the agent only tells you which screen the task belongs on.
- Rate limit. Every MCP request counts against the token's per-minute budget; proposals are counted separately as well. See Token scope.
Troubleshooting
The codes are YEKE's own. Identity and access errors arrive in the
data.error field of a JSON-RPC error response (-32600); an Origin
rejection is in data.reason. Tool errors
arrive in the tool result (isError: true).
| Symptom | Cause | Fix |
|---|---|---|
403 MCP_DISABLED | The MCP server is off. | The owner turns on System settings → Sessions & access → “MCP server”. |
401 UNAUTHENTICATED | The request carries no token; e.g. ${YEKE_MCP_TOKEN} expanded to nothing. | See the note under the table. |
401 SESSION_INVALID | The token has expired, has been revoked, or the value sent is not a valid token; e.g. the client sends the ${YEKE_MCP_TOKEN} string without expanding it. | Create a new token on the My account page; if it is a variable problem, see the note under the table. |
403 TOKEN_SCOPE_DENIED | A full token is being sent (for example the one from yeke login). | Create a read or plan token on the My account page. |
403 MCP_TOKEN_REQUIRED or CSRF_FAILED | The token arrives in a cookie, not in the Authorization header. | Use the Authorization: Bearer header. |
403 ORIGIN_NOT_ALLOWED | The request carries an Origin header that does not match the origin of YEKE's public URL (or no public URL is set). | Remove the header in the client, or set System settings → Address & certificate → “Public URL” to YEKE's real address. |
429 TOKEN_RATE_LIMITED | The token's per-minute request budget is used up. | Wait for the time in the Retry-After header. When the proposal limit is hit, the same code arrives in the tool result with retryAfterSeconds. |
| Empty tool list | There is no cluster you can read over MCP: you have no identity mapping, or AI egress is not allowed. | Check both with your administrator. If a setting changed, reconnect the client; it may have fetched the list when it connected. |
JSON-RPC -32602 | The tool called is not served to this token (e.g. propose_operation with a read token). | Use a plan token to propose plans. |
AI_EGRESS_DISABLED or MCP_EGRESS_LOCAL_ONLY | The cluster's AI egress is off or open to a local model only. | The cluster cannot be read over MCP unless the stance is allowed; that is the administrator's decision. |
NO_CLUSTER_IDENTITY | You have no Kubernetes identity mapping on this cluster. | Ask your administrator for a mapping; see Permissions. |
CLUSTER_NOT_CONNECTED | The cluster is not connected to YEKE right now. | Check the connection state on the cluster screen. |
PUBLIC_URL_NOT_CONFIGURED | The proposal was built but YEKE's public URL is not set; the result has a relative path instead of a link. | Append the path to your YEKE address, or have the owner fill in System settings → Address & certificate → “Public URL”. |
| TLS certificate error | YEKE's certificate is signed by an internal CA the client does not trust. | Use the yeke mcp relay; see Claude Code and Codex. |
Desktop apps and environment variables. Some desktop clients start
without reading your shell's startup files (e.g. .zshrc) and do not see the
variables defined there. Then, if the variable expands to nothing, the request gets
401 UNAUTHENTICATED; if the client sends the ${YEKE_MCP_TOKEN} string
without expanding it, it gets 401 SESSION_INVALID. The fix is to give the
token to the client's own configuration; the one-step command in the “Use with
MCP” section of My account does that.
Limits
What MCP does not guarantee. Limits shared by tokens and MCP are on the API and MCP page.
- A diagnosis is a suggestion. The agent's finding and the cause it names may be wrong; YEKE does not verify the model's conclusion. Read the diff yourself before you approve the card.
- MCP does not write. Nothing is written to the cluster over MCP; a change an agent proposes only comes from a plan you approve.
- Approval is your responsibility. You are the one approving the card; the agent's summary is a note, not the decision.
- No turn budget. The chat's per-turn tool cap does not exist over MCP; the client decides how many reads the agent makes. Per-call read caps and the token's per-minute budget still apply.
- Other limits. MCP is not a data loss prevention (DLP) boundary, data goes to the model you choose, the agent has other tools on your machine, and a plan lives 30 minutes: see Declared limits.
Setup and approval
Token and client setup are on the API and MCP page; second approval and maintenance windows are on the Governance page.