Skip to main content

Connect a client

Setup
One endpoint, one login

The MCP server is published by your gateway on its own subdomain and authenticates against your stack's identity provider. Any MCP-capable client can connect.

The endpoint​

The gateway → MCP server link creates the public route. The MCP endpoint is the /mcp path on that host:

https://<mcp-subdomain>.<your-domain>/mcp

The subdomain comes from the link's attributes and the domain from the stack configuration, so the exact URL is a property of your stack. Ask the model, read it from the generated route, or take it from the component documentation the build writes into your stack repository.

The transport is streamable HTTP. There is no separate SSE endpoint to configure.

Authentication​

The server fronts your stack's identity provider with an OAuth proxy. Connecting a client is a standard authorization-code login: the client opens the login page, you sign in as a user of the stack, and the client receives a session token.

Two details matter, and both are handled by the generated configuration rather than by you:

  • The authorization response carries the iss parameter, which strict OAuth 2.1 clients require. Without it a client rejects an otherwise valid callback and the login fails silently after the code is issued.
  • The token signing key is derived deterministically from the OIDC client secret rather than generated per process, so tokens stay valid across restarts.
Turn on persistent OAuth state before you rely on the connector

OAuth session state is held in memory unless you give the MCP server a cache. Without it, every pod restart — a node drain, a new image, a config change — invalidates every connected client, and each one has to be removed and added again. The fix is one link and one toggle: link the MCP server to a cache component and set its client_storage attribute on that link. The state is encrypted at rest with a key derived from the OIDC client secret.

AI clientgatewayMCP serveridentity providercacheTLS · routeOAuth proxyconnect to /mcp401 · where to sign insend the user to sign inauthorization codecode + issexchange code for tokensession state, encryptedsession token · stable signing keystrict OAuth 2.1 clients require isswithout the cache: state lives in memory — every restart drops every connector
The connection handshake. The MCP server fronts your identity provider, adds the iss parameter strict clients require, signs tokens with a key derived from the client secret, and keeps sessions in the cache so a restart disconnects nobody.

Who may use the server​

Logging in is the identity provider's business; who may then call tools is the MCP component's. The allowed_groups attribute on the MCP server component lists the identity groups whose members may use it, one group per line. Leave it empty and every user of the realm who can log in gets every tool, which is the default and the behaviour of every stack built before this attribute existed.

The groups themselves are declared on the identity component's groups attribute, one line per group in the form name:address:members. That declaration creates the group, adds the members and attaches the claim that carries group names inside the tokens, so set both attributes together, then build and deploy. Two things to know:

  • A client that was connected before you enabled groups still holds a token without them. Reconnect it once.
  • The value is the bare group name. A line such as allowed_groups = admins is read literally as a group called allowed_groups = admins, and nobody is a member of that.

A refused call returns the message "not a member of a group allowed to use this MCP server" together with the name of the caller.

The oauth_consent attribute decides whether the server shows its own "Allow Access" page before sending the browser to the identity provider. off, the default, keeps the flow that AI connectors complete without a visible page. remember shows the page once per client and browser, then approves silently. always shows it every time. The page is the defence against a malicious MCP server that bounces your browser into this proxy to obtain a token in your name, so turn it on once you have confirmed that your clients complete it.

Which clients may register​

AI clients register themselves with the server before the login and tell it where to send the authorization code. The server only accepts callback addresses listed in the identity client's redirect attribute, plus loopback addresses on any port for clients that run on your own machine. The generated configuration already lists the server's own host and the callbacks of the common connectors; add a new connector's callback there before anyone connects it. An unknown address is accepted at registration but refused at authorization, so a stranger's client never receives a code.

Picking the user you log in as​

The browser that runs the login keeps a session with the identity provider. Reconnecting a client reuses it, so you cannot choose a different user from the client. Sign out of the identity provider first, or run the login in a private window.

Who the model is, and who you are​

There are two identities in play. Confusing them is the most common support question.

IdentityWhat it isWhere it is proven
The connector sessionThe OAuth login between your AI client and the MCP serverYour stack's identity provider
The platform accountThe account the write tools use to change the graph and trigger buildsThe platform's own identity

A permission error from a write tool is about the platform account, not about the connector. The server resolves its platform credentials itself, in order, and only asks a human as a last resort.

Clients differ​

Clients do not all see the same parts of the server. Some never show its prompts or resources, and some ignore its instructions; a client running on your own machine may also read local files the server never sends. So everything a model needs to work correctly also comes back in tool descriptions and tool results — workflow, server_info and knowledge — which every client passes to the model. If a client behaves differently from another, ask it to call workflow first.

Clients that cap their tools​

Some clients pass only a limited number of tools to the model: Cursor sends 40, Visual Studio Code 128 across every server. A capped client silently drops the rest, and the model then improvises. The server recognises the client when it connects and serves it a profile:

ProfileServed toWhat the model sees
fullClaude Code, claude.ai, Claude Desktop, ChatGPT, OpenAI Codex, and any client the server does not recogniseEvery tool the stack mounts, exactly as registered
compactCursor, Visual Studio Code with GitHub Copilot, GitHub Copilot in JetBrains, Xcode and the CLIAt most 40 tools: every tool the guided journey names, the design write tools, and the gateway tool more_tools

more_tools lists, describes and calls any mounted tool with the same arguments and the same result, so nothing is out of reach; its description names the tool families that are not in the list, so the model knows they exist. A request header X-Stacktic-Profile overrides the choice, and server_info reports the client and the profile it got. A profile fits the client's limit; it is never an authorization — allowed_groups still decides who may call what, through the gateway too.

Troubleshooting​

SymptomMost likely causeWhat to do
Client disconnects after every restartOAuth state is in memoryAdd the cache link and enable client_storage
Login completes but the client never finishes connectingClient rejected a callback without issConfirm the deployed image includes the OAuth proxy fix; re-add the connector
Tools list is missing a technology you haveThe corresponding link is not drawnAdd the link, build, deploy — the tools register on the next start
A write tool returns 401, reads workPlatform account, not the connectorSet the MCP component's stacktic_api_user and stacktic_api_key to a real platform account — not the catalog placeholders, and not a user of your stack's identity provider — then build, apply and restart the pod. For this conversation only, stacktic_login signs in as that account without a redeploy
A configuration change had no effectThe pod is still running the previous configurationRoll the workload so it picks up the new values
Every tool call is refused as "not a member of a group"allowed_groups holds something other than a bare group name, the group does not exist yet, or the client's token predates the groupsFix the value, wait for the identity sync to finish, reconnect the client once
The client connects as the wrong userThe browser still holds the identity provider's sessionSign out there, or use a private window, then reconnect

Health​

The server exposes two endpoints, and they answer different questions on purpose.

EndpointWhat it answers
/healthWhether the process is up. Kubernetes probes use it, and it never fails for an external reason — a bad credential must not put the pod in a restart loop
/readyzWhether the server can actually work: platform credentials set and not the catalog placeholders, an OIDC base URL clients can discover, persistent client storage, a stack agent, and the knowledge repository. It always answers HTTP 200 — read status (ok or degraded) and the degraded list, not the status code

/readyz answers without a login, so it reports booleans and modes only — whether authentication is on, whether a callback allow-list is in force, the consent mode, and whether calls are restricted to groups — never a hostname, user or URL. The authenticated self_check tool returns the values behind each of them.

curl https://<mcp-host>/readyz

Neither endpoint asserts that every tool registered, so a healthy pod with a missing link still reports healthy. The authoritative answer to "which tools do I have" is the client's own tool list. From inside a conversation, server_info reports the same capabilities and self_check tests every credential live and names the attribute that fixes a failure.