mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-10-10 06:53:19 +02:00
`fastmcp dev apps` now runs its dev UI as a session started from the printed startup URL, so the preview is tied to the terminal that launched it. Opening the startup URL sets a session cookie, and requests also need the dev server's own Host and the dev UI's origin. The picker creates launches on the server, and launch pages open them by id. Tool UI resources run in a sandboxed iframe with their own opaque origin and talk to the dev UI through AppBridge, which matches how production MCP Apps hosts isolate app content. Picker errors are HTML-escaped. The `/mcp` proxy forwards only what the MCP server needs. The spawned MCP server runs with `FASTMCP_HTTP_HOST_ORIGIN_PROTECTION=auto` unless that variable is already set. Compatibility: opening the dev UI without the startup URL returns 403, and launch URLs come from the picker rather than being written by hand. Port-forwarded or proxied setups where the browser-facing host and port differ from the bind address get 400. Sandboxed apps send `Origin: null` and cannot use `alert`/`confirm`, popups, or `localStorage`. Co-authored-by: Bill Easton <williamseaston@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
75 lines
1.5 KiB
TOML
75 lines
1.5 KiB
TOML
# loq configuration - file size enforcement
|
|
# Run `loq baseline` to update when files exceed limits
|
|
|
|
default_max_lines = 1000
|
|
respect_gitignore = true
|
|
|
|
exclude = ["**/uv.lock", ".git/**", ".claude/**", "docs/**"]
|
|
|
|
[[rules]]
|
|
path = "tests/**"
|
|
max_lines = 1000
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/server/context.py"
|
|
max_lines = 1404
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/server/server.py"
|
|
max_lines = 2410
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/server/auth/oauth_proxy/proxy.py"
|
|
max_lines = 2098
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/cli/apps_dev.py"
|
|
max_lines = 1933
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/cli/cli.py"
|
|
max_lines = 1116
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/server/dependencies.py"
|
|
max_lines = 1686
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/server/providers/proxy.py"
|
|
max_lines = 1096
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/tools/tool_transform.py"
|
|
max_lines = 1004
|
|
|
|
[[rules]]
|
|
path = "tests/resources/test_resource_template.py"
|
|
max_lines = 1016
|
|
|
|
[[rules]]
|
|
path = "tests/server/providers/openapi/test_openapi_features.py"
|
|
max_lines = 1029
|
|
|
|
[[rules]]
|
|
path = "tests/server/tasks/test_task_mount.py"
|
|
max_lines = 1088
|
|
|
|
[[rules]]
|
|
path = "tests/server/test_dependencies.py"
|
|
max_lines = 1194
|
|
|
|
[[rules]]
|
|
path = "tests/test_mcp_config.py"
|
|
max_lines = 1185
|
|
|
|
[[rules]]
|
|
path = "tests/utilities/openapi/test_director.py"
|
|
max_lines = 1154
|
|
|
|
[[rules]]
|
|
path = "fastmcp_slim/fastmcp/utilities/json_schema_type.py"
|
|
max_lines = 1059
|
|
|
|
[[rules]]
|
|
path = "tests/cli/test_run.py"
|
|
max_lines = 1291
|