Something went wrong. Try again.
mirror of github.com/PrefectHQ/fastmcp
Something went wrong. Try again.
1234567891011121314151617181920212223242526---title: apps_dev_securitysidebarTitle: apps_dev_security---
# `fastmcp.cli.apps_dev_security`
Browser session, Host, and Origin checks for the `fastmcp dev apps` host.
## Classes
### `DevSessionMiddleware` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/cli/apps_dev_security.py#L38" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
Require a browser session started from the private startup URL.
`GET /?token=...` with the startup token sets an HttpOnly, SameSite=Strictcookie and redirects to `/`. Every other request needs that cookie. Thecookie holds a separate session secret: browsers send cookies to everyport on the host, and the startup token must not reach other services. Everyrequest must also name this server in its Host header, and browserrequests must come from this origin: cookies do not distinguish ports onthe same host, so the Origin and Fetch Metadata headers are checked too.