Repository navigation
Replies: 2 comments 2 replies
|
I dug through the current From there the proxy builds all of its stores on top of that same backend: client registrations, upstream token state, OAuth transactions, authorization codes, JTI mappings, and refresh-token metadata. I don't see separate DI hooks for durable identity state vs ephemeral flow state. So the concrete answer today is: if you want durable client registrations / refresh-token metadata but ephemeral auth-code transactions, that's not a built-in split right now; you'd need a custom storage layer or wrapper. Whether FastMCP should expose two backends is probably a feature/API question for the maintainers, but the current code path is one backend for everything. |
|
I don’t think this is just academic. There are really two different kinds of OAuth state here:
Losing the first category is annoying but recoverable: the user retries the OAuth flow. Losing the second category changes the identity state of the server. Existing clients may become The current |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
FastMCP currently routes all OAuth storage through
py-key-value-aio- client registrations, refresh tokens, and auth codes all go to the same backend.Redis/Valkey are not durable (in the ACID sense). This is fine for auth codes, "mcp-oauth-transactions" stuff - they're short-lived and a lost code just means the user retries. But client registrations and refresh tokens are long-lived identity records whose loss has consequences (every registered client becomes
invalid_client, refresh tokens are destroyed, users must re-authorize).E.g., ElastiCache with Multi-AZ (a standard production setup) documents that a primary node reboot clears all replicas too, and that Multi-AZ. Append-Only File (AOF) (which is btw, mutually exclusive with Multi-AZ) exists, but it's "very very slow" if you want the strongest durability guarantee it can provide.
Is there appetite for exposing separate dependency injection points for durable state (client registrations, refresh tokens) vs. ephemeral state (auth codes) - so users can wire a durable like Postgres to the former without having to override the entire OAuth storage layer?
Also, I know
py-key-value-aiohas support for treating postgres as a key-value store. But I think it makes sense to put some things in a durable database, and some things in Redis et al.And I'll be honest: the fact that FastMCP is so widely used by so many companies makes me wonder if all of the discussion above is basically academic, so lmk if that's the case too.
All reactions