fastmcp/docs
Jeremiah Lowin b07f9ce9ae
Honor OAuth application_type in DCR (SEP-837) (#4621)
* Honor OAuth application_type in DCR (SEP-837)

* Simplify web redirect check per ruff SIM103

* Enforce application_type over HTTP, at auth time, and tighten native scheme rules

Recover the DCR application_type the SDK RegistrationHandler drops (P1), enforce the stored type on the authorization redirect path (P2), restrict native to loopback http + custom schemes (P2), and document the web/native rules (P2).

* Fix loopback range detection and use a positive scheme allowlist

Classify loopback hosts with ipaddress.is_loopback so all of 127.0.0.0/8 counts (a web client could bypass the non-loopback rule with 127.0.0.2). Replace the NON_REDIRECT_NETWORK_SCHEMES denylist with STANDARD_URI_SCHEMES: native now accepts only https, loopback http, and unregistered private-use schemes per RFC 8252, so smb/smtp/nfs and other unlisted standard schemes no longer pass.

* Vendor the IANA scheme registry and consolidate the loopback classifier

Replace the hand-picked STANDARD_URI_SCHEMES with a vendored snapshot of the IANA URI scheme registry (423 schemes), so registered transports nobody enumerated (coap, coaps, stun, turn, mqtt) fail closed instead of passing as private-use. Delete the stale duplicate _is_loopback_host in oauth_proxy/models.py and reuse the ipaddress-based classifier from redirect_validation, restoring loopback port flexibility across all of 127.0.0.0/8.

* Treat the reserved localhost namespace and absolute host forms as loopback

RFC 6761 6.3 reserves the whole localhost namespace for the local machine, so app.localhost and localhost. are loopback just as much as localhost. Previously a web client could register https://app.localhost/callback and bypass the non-loopback rule, while native clients were wrongly refused legitimate http://app.localhost:3000 dev callbacks. The suffix test is anchored on a leading dot so localhost.evil.com and notlocalhost stay non-loopback.

* Narrow scope: drop native scheme classification, keep the web rule

Registry membership cannot separate app-dispatch schemes from network transports (vscode is registered because it is an app scheme), so classifying a native client's scheme rejected callbacks that real MCP clients need. Remove the vendored registry and the private-use test; native now accepts any scheme outside the unsafe set, with cleartext http still limited to loopback. Also reject web registrations that omit redirect_uris rather than storing an unusable localhost placeholder.
2026-07-26 14:24:50 -04:00
..
.cursor/rules Clean up parameter documentation 2025-06-22 20:59:53 -04:00
apps Trim fastmcp.types to FastMCP-unique types only 2026-07-20 20:53:11 -04:00
assets Animated (#3231) 2026-02-19 11:56:51 -05:00
cli Align CLI, deployment, and config docs (#4259) 2026-07-19 14:24:07 -04:00
clients v4 docs quality pass: stale task/era claims, broken links, polish (#4619) 2026-07-23 20:42:13 -04:00
community Normalize repo references to PrefectHQ/fastmcp casing (#3218) 2026-02-18 14:51:18 -05:00
css Archive v3 docs and publish v4 as the primary version (#4613) 2026-07-23 19:47:57 -04:00
deployment Support routable transport headers for gateways (SEP-2243) (#4622) 2026-07-26 13:40:09 -04:00
development Unpublish v4 development notes; prep docs for beta 1 (#4644) 2026-07-26 14:08:34 -04:00
getting-started Unpublish v4 development notes; prep docs for beta 1 (#4644) 2026-07-26 14:08:34 -04:00
integrations Trim fastmcp.types to FastMCP-unique types only 2026-07-20 20:53:11 -04:00
more Session-in-task Context API, task telemetry, settings dotenv, guard fail-loud 2026-07-23 20:05:54 -04:00
patterns Align CLI, deployment, and config docs (#4259) 2026-07-19 14:24:07 -04:00
public/schemas/fastmcp.json chore: Update fastmcp.json schema (#1955) 2025-09-29 20:12:24 -04:00
python-sdk chore: Update SDK documentation (#4615) 2026-07-23 20:52:17 -04:00
servers Honor OAuth application_type in DCR (SEP-837) (#4621) 2026-07-26 14:24:50 -04:00
snippets Fix docs app demo iframe assets (#4194) 2026-05-20 13:18:45 -04:00
tutorials Migrate to MCP SDK v2.0.0b2 (httpx2) (#4503) 2026-07-18 15:12:47 -04:00
v2 docs: quote pip extras install examples (#4568) 2026-07-20 11:09:50 -04:00
v3 Archive v3 docs and publish v4 as the primary version (#4613) 2026-07-23 19:47:57 -04:00
.ccignore Add comprehensive OAuth 2.1 authentication system with WorkOS integration (#1327) 2025-08-01 17:06:55 -04:00
changelog.mdx Fix typos (#4498) 2026-07-18 21:18:39 -04:00
docs.json Unpublish v4 development notes; prep docs for beta 1 (#4644) 2026-07-26 14:08:34 -04:00
fastmcp-analytics.js [codex] Add FastMCP docs telemetry (#3727) 2026-03-31 19:32:09 -04:00
prefab-demo-payloads.js Fix docs app demo iframe assets (#4194) 2026-05-20 13:18:45 -04:00
python-sdk-pages.json chore: Update SDK documentation (#4569) 2026-07-20 18:44:54 -04:00
unify-intent.js Add tag to deployment pages (#3624) 2026-03-25 11:39:25 -04:00
updates.mdx Docs: forward-port v3.4.4 changelog entries (#4476) 2026-07-08 20:55:43 -04:00
v2-banner.js Update docs for 3.0 GA release (#3216) 2026-02-18 14:29:28 -05:00
v2-navigation.json chore: split v2 docs navigation into separate file (#3762) 2026-04-04 21:17:39 -04:00
v3-banner.js Archive v3 docs and publish v4 as the primary version (#4613) 2026-07-23 19:47:57 -04:00
v3-navigation.json Archive v3 docs and publish v4 as the primary version (#4613) 2026-07-23 19:47:57 -04:00