# Isolated local servers

A local (stdio) MCP server is a program from npm or PyPI that runs with whatever access its host gives it. Godelgate runs each one isolated.

## On Godelgate Cloud: one microVM per server

Open **Servers → Add server → Local server** and enter:

- **npx** or **uvx**, and the package, for example `@modelcontextprotocol/server-everything` or `mcp-server-fetch`. Pin a version (`pkg@1.2.3`, `pkg==1.2.3`) for repeatable installs.
- Arguments, if the server needs any.
- Environment variables (`KEY=value`, one per line). They're stored encrypted and passed only to the server process, never on a command line.

Godelgate starts a [Lizard](https://lizard.build) sandbox for the server: its own Firecracker microVM, with nothing else in it. The stdio server is bridged to Streamable HTTP inside the VM and published on a private port that needs an access token only Godelgate holds. The first start takes a little while (the package is downloaded); the server shows **starting** until it's ready. Removing the server deletes its microVM.

A workspace can run up to 2 local servers during early access.

## Self-hosted: Docker

Add `isolation.docker` to any `command` server:

```yaml
servers:
  - name: fetch
    command: uvx
    args: [mcp-server-fetch]
    isolation:
      docker:
        image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim
        network: bridge   # or none, for servers that don't need the network
        memory: 512m
        cpus: "1"
```

The server runs with `docker run -i --rm` and: a read-only root filesystem, writable scratch space only in `/tmp` and `/root`, all Linux capabilities dropped, `no-new-privileges`, and limits on memory, CPU and processes. Environment variables are passed by name, so their values don't appear in the process list. The gate's machine needs Docker.
