> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Access

> How agents, and sometimes humans, reach a Mirage virtual terminal.

![Every client reaches one core, the Workspace. An app calls it directly. The mirage CLI, MCP clients and RPC clients reach the server's HTTP routes. SSH clients reach its SSH server. Both servers call the Workspace.](https://mintcdn.com/struktoai/P2GwmHfVdrabAh4w/images/access-light.svg?fit=max\&auto=format\&n=P2GwmHfVdrabAh4w\&q=85\&s=ea2fef1ebc98119a48a7fb1beb0a2456)

| Way in | For | Reach it with |
| - | - | - |
| In-app | an agent in your own process | `Workspace` and `Session`, in [Python](https://docs.mirage.strukto.ai/python/access/in-app.md) or [TypeScript](https://docs.mirage.strukto.ai/typescript/access/in-app.md) |
| [HTTP](https://docs.mirage.strukto.ai/home/access/http.md) | programs and services | `/v1/...` routes, or [`mirage api`](https://docs.mirage.strukto.ai/home/access/cli#call-any-route) with the CLI's login |
| [MCP](https://docs.mirage.strukto.ai/home/access/mcp.md) | agent harnesses such as Claude Code, Cursor and Codex | `/v1/workspaces/{id}/mcp`, or `mirage mcp` on stdio |
| [RPC](https://docs.mirage.strukto.ai/home/access/rpc.md) | programs that run lines and move bytes | `/v1/workspaces/{id}/rpc`, or `mirage rpc` on stdio |
| [CLI](https://docs.mirage.strukto.ai/home/access/cli.md) | people and scripts | `mirage <verb>` |
| [SSH](https://docs.mirage.strukto.ai/home/access/ssh.md) | people and tools that speak SSH | `ssh`, `sftp`, `scp`, on the SSH port or through `mirage ssh-proxy` |
| [FUSE](https://docs.mirage.strukto.ai/home/setup/fuse.md) | editors, language servers and other host programs | a folder on the machine running Mirage |

HTTP, MCP, RPC, CLI and SSH connections go through the Mirage server, a FastAPI app in [Python](https://docs.mirage.strukto.ai/python/access/server.md) and a Fastify app in [TypeScript](https://docs.mirage.strukto.ai/typescript/access/server.md) that speak the same protocol. It serves HTTP, and SSH on its own port when `ssh_port` is set or over HTTP through `mirage ssh-proxy`. The CLI starts the server on your machine when it needs one. In-app access reaches the workspace directly.

## What each one exposes

Each way in exposes what its own protocol defines. A dash means the protocol has no such operation.

| | In-app | HTTP | MCP | RPC | CLI | SSH |
| - | - | - | - | - | - | - |
| Create, list, delete workspaces | ✓ | ✓ | – | – | ✓ | – |
| Create, list, delete sessions | ✓ | ✓ | – | – | ✓ | – |
| Run a line | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Send stdin to a line | ✓ | ✓ | – | ✓ | ✓ | ✓ |
| Cancel a running line | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Cancel or kill all of a session's or workspace's work | ✓ | ✓ | – | – | ✓ | – |
| VFS.md, SKILL.md and session profiles | ✓ | ✓ | – | – | ✓ | – |
| The seven agent tools | ✓ | ✓ | ✓ | ✓ | ✓ | – |
| File operations on bytes | ✓ | ✓ | ✓ | ✓ | ✓ | `sftp`, `scp`, `sshfs` |
| Explain a line or a VFS call | ✓ | ✓ | ✓ | ✓ | ✓ | – |
| Snapshots | ✓ | ✓ | – | – | ✓ | – |
| Asks | ✓ | ✓ | – | – | ✓ | – |
| Jobs | – | ✓ | – | – | ✓ | – |
| Command logs | ✓ | ✓ | – | – | ✓ | – |

## Sessions

A session is one shell inside a workspace. It keeps its own working directory,
environment variables and history, and runs under one [session profile](https://docs.mirage.strukto.ai/home/configuration/session.md).
Agents in different sessions share the workspace's files but not their shell
state.

| Way in | Specify the session with |
| - | - |
| HTTP, MCP, RPC | `?session_id=` |
| MCP or RPC over stdio | `-s` |
| CLI | `-s` |
| SSH, `sshfs` included | Each login opens a new session under its key's profile. |

A call that specifies no session runs in the workspace's default session. Its
profile is the one the config's `profile:` names, else the one called
`default`, else none.

## Cancel

| Way in | Cancel a running line with |
| - | - |
| CLI, SSH | Ctrl-C |
| MCP | `notifications/cancelled` |
| RPC | `$/cancelRequest` |
| HTTP | A dropped request |

To stop a whole session, whichever way its lines came in:

| Stop | HTTP | CLI |
| - | - | - |
| A session's running lines | `POST /v1/workspaces/{id}/sessions/{session_id}/cancel` | `mirage workspace session cancel -w ID -s S` |
| A session's background jobs | `POST /v1/workspaces/{id}/sessions/{session_id}/kill` | `mirage workspace session kill -w ID -s S` |

## Auth

When authentication is configured, every way in proves who is calling. `GET /v1/health` and OAuth discovery stay public.

| Way in | Authenticates with |
| - | - |
| HTTP, MCP, RPC | A bearer token: `Authorization: Bearer <token>` |
| CLI, and MCP or RPC over stdio | The CLI's local token, sent for you |
| SSH on the SSH port | A public key |
| SSH through `mirage ssh-proxy` | The CLI's token |

A server you start directly in `local` mode, with no token configured, accepts requests without one. In `jwt` mode a token's `sub` is an [account](https://docs.mirage.strukto.ai/home/access/http.md#accounts) that reaches only its own workspaces, and an SSH key names its account with `mirage-account`. See [Auth](https://docs.mirage.strukto.ai/home/access/http.md#configure-authentication).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.