How access works
The agent signs in with an Orka service account token. Every request the server makes to Orka runs as that service account, so the agent can do what the service account can do in its namespace, and nothing more. An agent only sees the VMs its service account created through Orka. It can’t list, inspect, or delete VMs that people or other service accounts created, even in the same namespace, and an admin’s token gets no wider view through the MCP server. Agents that use the same service account share VMs, so give each agent its own.Before you begin
- Your cluster is hosted by MacStadium.
- You’re an Orka admin, so you can create service accounts.
- The commands on this page use the
orkaCLI from Orka 4.0. On an Orka 3.6 cluster, useorka3instead. The commands and flags are the same. - You’re connected to your cluster’s network (for example, over the VPN), and so is the machine where the agent runs.
Connect an agent
1
Enable the MCP server
Contact MacStadium support and ask to turn on the Orka MCP server for your cluster. MacStadium turns it on and sends you the server’s URL, which looks like
https://<CUSTOMER>.orka.app/mcp.2
Create a service account for the agent
orka-dev role binding in its namespace, which is the access the MCP server needs. For more on service accounts, see Manage Orka service accounts for CI/CD.3
Get a token for the service account
720h (30 days). Without --duration, it lasts 1 year, and Orka can return a different lifetime than the one you ask for. The MCP server doesn’t renew tokens, so when the token expires, the agent’s requests fail until you give it a new one.To cut an agent off, delete its service account. That revokes its token within about 10 seconds. See Which credential should you use, and how long does it last?4
Add the server to your MCP client
The server uses the streamable HTTP transport and reads the token from an To make the server available in every project, add
Authorization: Bearer header.- Claude Code
- Cursor
- Other clients
--scope user. Don’t use --scope project, which writes the token into .mcp.json in your repository.5
Check the connection
Ask the agent to list its Orka VMs. A new agent has none yet, so an empty list means the connection and token work. An authentication error means the token is wrong or has expired.
Work inside a VM
The server doesn’t run commands inside a VM. When the agent deploys a VM, the server waits until the VM answers on SSH, then returns its SSH host and port, and the agent connects over SSH to do its work. The result also includes VNC and Screen Sharing ports, when the VM has them. The SSH username and password come from the image the VM was created from, so the agent needs the image’s credentials. MacStadium’s base images ship with well-known default credentials, so change them in any image you give an agent. See Understanding Orka credentials.Clean up
Each VM the agent creates uses capacity in your cluster until it’s deleted. Ask the agent to delete VMs when it’s finished with them. If an agent crashes or loses track of a VM, it can list the VMs it owns and delete the ones it no longer needs. If a deploy times out or the connection drops, the agent should retry it with the sameidempotency_key, which returns the same VM instead of starting a second one.
What the MCP server doesn’t do yet
The first release covers the VM lifecycle only. It deploys from OCI images, and it doesn’t:- Run commands inside a VM without SSH
- Check capacity before it deploys a VM
- Report per-VM usage, or limit how much a single agent can use

