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

# serve

> Run a gateway in front of one upstream MCP server (SPEC-v0.2 §6.1).

`ctrlrun.gateway.serve` — function, defined at `src/ctrlrun/gateway/__init__.py:40`

```python theme={null}
def serve(upstream: str, alias: str, options: Any) -> None
```

Run a gateway in front of one upstream MCP server (SPEC-v0.2 §6.1).

The dependency check happens first and unconditionally, so an operator who has not
installed the extra learns it from one clear line rather than from a stack trace.

Blocks until interrupted. `Control.from_file()` finds the policy and the store, so a
gateway and a decorator-based worker sharing a policy share reservations (§6.1).

## Next

* [Python API index](/reference/api/index).
* [Get started](/get-started/quickstart) · [Why](/why).


## Related topics

- [Protect an existing MCP server in five minutes](/cookbook/protect-an-mcp-server.md)
- [CTRLRun and MCP](/mcp/overview.md)
- [Use the docs from your editor](/mcp/use-the-docs-from-your-editor.md)
- [Approve in Slack](/guides/approvals-in-slack.md)
- [The Agent Control Standard](/ACS.md)
