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.

Your agent Claude Code · Codex or another MCP client cannot apply the plan; hands you the link YEKE · /api/mcp identity and Kubernetes RBAC Secret masking audit trail · ai.read AI egress: allowed Cluster under your Kubernetes identity tool call scoped token result, as data read only GET propose_operation plan token only Plan validation · dry-run policies · Hooks card built card link Approval card you approve it in your own YEKE session apply only with your approval Your agent Claude Code · Codex · another MCP client tool call · scoped token YEKE · /api/mcp identity and Kubernetes RBAC Secret masking audit trail · ai.read AI egress: allowed read only GET propose_operation Plan validation · dry-run policies · Hooks plan token only Approval card you approve it in your own session apply Cluster under your Kubernetes identity
  • One endpoint, the whole fleet. The agent only talks to /api/mcp. Each tool call names the cluster it reads with clusterId; 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_operation does 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.

  1. 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.
  2. 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.
  3. 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 mcp relay 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.

ToolWhat it doesVisible to
k8s_listLists the objects of a resource type as a summary table.Read and plan tokens
k8s_getReads the full body of one object. Secret values arrive masked.
k8s_search_typesSearches resource types. The agent finds the schemaId it passes to the other tools here.
k8s_describe_typeReturns a resource type's full record: verbs, subresources, scope.
k8s_eventsLists Kubernetes events; type=Warning for warnings only.
k8s_logsReads one pod's log. previous=true for a crashed instance, container for a multi-container pod. Truncated output says so.
yeke_metricsReads 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_operationsLists YEKE's operation records (e.g. plans awaiting approval, who ran a DELETE).
yeke_auditLists the cluster's audit trail events: type, actor, time. Event details are not included.
yeke_clustersReturns 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_operationProposes 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-configuration annotation and managedFields are never sent; container env values 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.read event: source api, channel mcp and 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 an ai.plan_proposed event.
  • AI egress gate. A cluster whose stance is off or local-only cannot 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 login are 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).

SymptomCauseFix
403 MCP_DISABLEDThe MCP server is off.The owner turns on System settings → Sessions & access → “MCP server”.
401 UNAUTHENTICATEDThe request carries no token; e.g. ${YEKE_MCP_TOKEN} expanded to nothing.See the note under the table.
401 SESSION_INVALIDThe 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_DENIEDA 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_FAILEDThe token arrives in a cookie, not in the Authorization header.Use the Authorization: Bearer header.
403 ORIGIN_NOT_ALLOWEDThe 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_LIMITEDThe 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 listThere 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 -32602The 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_ONLYThe 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_IDENTITYYou have no Kubernetes identity mapping on this cluster.Ask your administrator for a mapping; see Permissions.
CLUSTER_NOT_CONNECTEDThe cluster is not connected to YEKE right now.Check the connection state on the cluster screen.
PUBLIC_URL_NOT_CONFIGUREDThe 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 errorYEKE'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.