add memory and disk storage backends, readme

This commit is contained in:
Taylor Wilsdon
2025-12-27 12:06:20 -08:00
parent 321d9eaef0
commit b95a87e15a
5 changed files with 1158 additions and 908 deletions

View File

@@ -16,12 +16,32 @@ OAUTH2_ENABLE_DEBUG=false
OAUTH2_ENABLE_LEGACY_AUTH=true
# ---------------------------------------------------------------------------
# FastMCP OAuth Proxy storage (OAuth 2.1)
# FastMCP OAuth Proxy Storage Backends (OAuth 2.1)
#
# By default, FastMCP stores OAuth proxy state on disk under:
# ${FASTMCP_HOME}/oauth-proxy
# Storage backend for OAuth proxy state. Options: memory, disk, valkey
# Default: FastMCP's built-in default (disk on Mac/Windows, memory on Linux)
#
# To store OAuth proxy state in Valkey instead, configure:
# WORKSPACE_MCP_OAUTH_PROXY_STORAGE_BACKEND=memory|disk|valkey
#
# ---------------------------------------------------------------------------
# Memory Storage (default on Linux)
# - Fast, no persistence, data lost on restart
# - Best for: development, testing, stateless deployments
#
# WORKSPACE_MCP_OAUTH_PROXY_STORAGE_BACKEND=memory
#
# ---------------------------------------------------------------------------
# Disk Storage (default on Mac/Windows)
# - Persists across restarts, single-server only
# - Best for: single-server production, persistent caching
#
# WORKSPACE_MCP_OAUTH_PROXY_STORAGE_BACKEND=disk
# WORKSPACE_MCP_OAUTH_PROXY_DISK_DIRECTORY=~/.fastmcp/oauth-proxy
#
# ---------------------------------------------------------------------------
# Valkey/Redis Storage
# - Distributed, multi-server support
# - Best for: production, multi-server deployments, cloud native
#
# WORKSPACE_MCP_OAUTH_PROXY_STORAGE_BACKEND=valkey
# WORKSPACE_MCP_OAUTH_PROXY_VALKEY_HOST=localhost
@@ -33,7 +53,10 @@ OAUTH2_ENABLE_LEGACY_AUTH=true
# WORKSPACE_MCP_OAUTH_PROXY_VALKEY_REQUEST_TIMEOUT_MS=5000
# WORKSPACE_MCP_OAUTH_PROXY_VALKEY_CONNECTION_TIMEOUT_MS=10000
#
# ---------------------------------------------------------------------------
# Encryption:
# - Values are encrypted with the same Fernet scheme FastMCP uses for its default disk store.
# - Key material is derived from FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY if set, otherwise GOOGLE_OAUTH_CLIENT_SECRET.
# - For stable decryption across client-secret rotations, set FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY explicitly.
# - Disk and Valkey storage are encrypted with Fernet.
# - Key derived from FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY if set,
# otherwise from GOOGLE_OAUTH_CLIENT_SECRET.
# - For stable decryption across client-secret rotations, set
# FASTMCP_SERVER_AUTH_GOOGLE_JWT_SIGNING_KEY explicitly.