Commit graph

2,350 commits

Author SHA1 Message Date
Jeremiah Lowin
bf3c674d49 Merge branch 'main' into dcr-proxy 2025-10-20 19:27:05 -04:00
Jeremiah Lowin
e55cc531ad Apply PR #2156 logging changes to oauth_dcr_proxy.py
- Remove info/warning logs for allowed_client_redirect_uris
- Add 'and use persistent storage' to production guidance for JWT signing key and token encryption key
2025-10-20 19:25:07 -04:00
Jeremiah Lowin
68c061d565 Remove breakpoint from settings.py 2025-10-20 19:20:01 -04:00
Jeremiah Lowin
7cecac5db0
Remove warning message in common scenario of all client redirect uri's permitted (#2156) 2025-10-20 19:17:26 -04:00
Jeremiah Lowin
7118cc5ad9 Fix deprecated access 2025-10-20 19:17:07 -04:00
Jeremiah Lowin
598b10090e Use full path for settings.deprecation_warnings access
Changed from settings_module.settings.deprecation_warnings to
fastmcp.settings.settings.deprecation_warnings for clarity.
2025-10-20 19:14:44 -04:00
Jeremiah Lowin
17b60c8815 Fix settings import pattern in OAuth providers
Use direct imports for non-deprecated items (ENV_FILE, ExtendedEnvSettingsSource,
ExtendedSettingsConfigDict) and settings_module for the deprecated settings instance.
2025-10-20 19:12:56 -04:00
Jeremiah Lowin
a9b77e76d0 Remove outdated oidc_proxy test file
This test file was testing the old oidc_proxy module which has been renamed
to oidc_dcr_proxy. The module is only used internally by providers and doesn't
need backwards compatibility.
2025-10-20 18:07:28 -04:00
Jeremiah Lowin
bd2c554e44 Move authorize method from deprecated AzureProvider to AzureDCRProvider
The authorize method with scope prefixing and resource filtering belongs on
the main AzureDCRProvider class, not just the deprecated alias.
2025-10-20 18:07:12 -04:00
Jeremiah Lowin
fc9f7197ec Update SDK 2025-10-20 18:04:53 -04:00
Jeremiah Lowin
9e0c2a2900 Fix ty type checker errors by using ExtendedSettingsConfigDict
Use ExtendedSettingsConfigDict instead of SettingsConfigDict in all provider
Settings classes to support env_prefixes field. This matches the pattern used
in src/fastmcp/settings.py and resolves type checking errors.
2025-10-20 18:01:36 -04:00
Jeremiah Lowin
5b66270a09 Fix settings import pattern in OAuth providers to avoid deprecation warnings
Changed all 6 provider files from 'from fastmcp.settings import settings'
to 'import fastmcp.settings as settings_module' to avoid triggering the
settings import deprecation warning.

Also simplified deprecation tests to only verify imports and subclass
relationships without instantiating providers.
2025-10-20 17:56:04 -04:00
Jeremiah Lowin
f5c5d20517 Update documentation to use DCR-suffixed provider names
All OAuth provider references updated from old names (GitHubProvider,
GoogleProvider, etc.) to new DCR-suffixed names (GitHubDCRProvider,
GoogleDCRProvider, etc.) including environment variable names.

Updated files:
- Authentication docs (oauth-proxy.mdx, oidc-proxy.mdx, authentication.mdx)
- Integration guides (github.mdx, google.mdx, azure.mdx, workos.mdx, auth0.mdx, aws-cognito.mdx)
- Deployment guide (http.mdx)
- Storage backends guide (storage-backends.mdx)
- Upgrade guide (upgrade-guide.mdx)
2025-10-20 17:46:42 -04:00
Jeremiah Lowin
a48d753d16 Rename OAuth providers to include DCR suffix
Renamed all OAuth provider classes to include "DCR" suffix to clarify they use
Dynamic Client Registration, distinguishing them from future SEP 991 implementations.

Provider renames:
- GitHubProvider → GitHubDCRProvider
- GoogleProvider → GoogleDCRProvider
- AzureProvider → AzureDCRProvider
- WorkOSProvider → WorkOSDCRProvider
- Auth0Provider → Auth0DCRProvider
- AWSCognitoProvider → AWSCognitoDCRProvider

Changes:
- Renamed all provider classes and settings classes with DCR suffix
- Updated environment variable prefixes to include _DCR_
- Added backwards compatibility via env_prefixes array (old vars still work)
- Created deprecated alias classes that emit deprecation warnings
- Updated all provider tests to use new DCR naming
- Fixed Auth0 tests to use oidc_dcr_proxy instead of deprecated oidc_proxy
- Created deprecation test suite to verify old names can be imported
2025-10-20 17:37:16 -04:00
Jeremiah Lowin
0ad638003c Rename OAuth providers to include DCR suffix
Renames all OAuth providers that inherit from OAuthDCRProxy to explicitly
include "DCR" in their names, clarifying their Dynamic Client Registration
implementation approach.

Changes:
- GitHubProvider → GitHubDCRProvider
- GoogleProvider → GoogleDCRProvider
- AzureProvider → AzureDCRProvider
- WorkOSProvider → WorkOSDCRProvider
- Auth0Provider → Auth0DCRProvider
- AWSCognitoProvider → AWSCognitoDCRProvider

All old names remain as deprecated aliases with warnings that respect
settings.deprecation_warnings. Environment variables updated to include
_DCR_ with backwards compatibility via env_prefixes.
2025-10-20 17:32:35 -04:00
Jeremiah Lowin
deb0c3ea95 Rename OIDCProxy -> OIDCDCRProxy 2025-10-20 16:01:36 -04:00
Jeremiah Lowin
dd86edf275 Rename OAuthProxy -> OAuthDCRProxy 2025-10-20 15:41:16 -04:00
Jeremiah Lowin
254ff1a25d
Make CORS opt-in via middleware parameter (#2150) 2025-10-20 15:33:13 -04:00
Jeremiah Lowin
09e899a699
docs: Add AWS Cognito resource server requirement and CORS guidance (#2149) 2025-10-20 15:28:16 -04:00
hyeonjae
24e2b09d95
Update content type in advanced_tool function (#2147) 2025-10-20 08:43:35 -04:00
marvin-context-protocol[bot]
9529fadd15
chore: Update SDK documentation (#2141)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2025-10-19 20:33:47 -04:00
Jeremiah Lowin
7da3b831d6
Update changelog for 2.12.5 (#2146) 2025-10-19 20:33:35 -04:00
Jeremiah Lowin
e7cde97e5b
Docs (#2145)
* Update fonts + styling

* Update docs.json

* Update welcome.mdx
2025-10-19 20:26:08 -04:00
Jeremiah Lowin
4c7463d5ae
Fix google scope example (#2144) 2025-10-19 19:51:40 -04:00
Jeremiah Lowin
b362444ddf
Add storage backend documentation (#2137)
* Add storage backend documentation

* Add storage patterns documentation for wrapper caching strategies

- Add PassthroughCacheWrapper section for multi-tier caching
- Document TTL clamping strategy for optimized memory usage
- Add example for wrapping custom storage implementations
- Explain how to combine fast in-memory caches with persistent remote stores

* Update docs
2025-10-19 19:24:13 -04:00
Jeremiah Lowin
96aa150cf0
Progress replacing asyncio with anyio (#2143) v2.13.0rc1
* Replace asyncio.sleep() with anyio.sleep()

- Replace asyncio.sleep() in error_handling.py retry middleware
- Replace asyncio.sleep() in oauth.py callback shutdown
- Keep asyncio.TimeoutError check for Python 3.10 compatibility
- Add anyio import to error_handling.py

All core library sleep calls now use anyio primitives. Tests and
example code still use asyncio where appropriate.

* Replace OAuth asyncio.Future with anyio.Event pattern

- Create OAuthCallbackResult dataclass for result storage
- Replace Future with Event + result container pattern
- Update oauth_callback.py to use anyio.Event coordination
- Update auth/oauth.py callback_handler to use Event pattern
- Remove asyncio imports from OAuth flow

OAuth callback now uses anyio primitives for async coordination
instead of asyncio.Future.

* Remove asyncio fire-and-forget task hack from Context

- Remove _try_flush_notifications() method entirely
- Update _queue_*_list_changed() to only queue notifications
- Remove asyncio import from context.py
- Keep _flush_notifications() for deferred sending on context exit

Notifications now flush reliably on request completion (__aexit__)
instead of attempting immediate delivery with asyncio.create_task().
Slight delay is acceptable - all notifications are deduplicated and
sent when the MCP request handler completes.
2025-10-19 14:08:06 -04:00
Jeremiah Lowin
3321644ad3
Replace subprocess tests with in-process async servers (#2006)
* Use anyio as testing backend

* Remove asyncio markers

* Update streamable http tests

* Replace all subprocess tests

* Replace anyio task groups with asyncio context managers in tests

- Convert run_server_async from anyio task group pattern to asyncio.create_task with async context manager
- Remove task_group fixture from conftest
- Update all test fixtures to use async with run_server_async pattern
- Remove TaskGroup imports from all test files
- Tests now work with pytest-asyncio instead of pytest-anyio

* Update test_github_provider_integration.py
2025-10-19 10:47:54 -04:00
marvin-context-protocol[bot]
39aebcf578
chore: Update SDK documentation (#2129)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2025-10-18 12:15:23 -04:00
Jeremiah Lowin
1cb30a4e42
Delete warning_box_test.html (#2136) 2025-10-18 11:50:34 -04:00
Jeremiah Lowin
9e78d755c2
Support custom server name, icons, and link in OAuth Proxy consent page (#2135)
* Implement icon support in fastmcp

* Fix icon feature tests

- Update snapshot for ResourceTemplate to include icons field
- Remove OAuth mounting tests (belong to PR #2119, not this feature)

* Update docs

* Customize consent screen

* Use server website link if available

* Anchor link shouldnt have trailing slash

* Remove 'a FastMCP server named' from consent page message

* Update docs
2025-10-18 11:49:26 -04:00
Omer Aharonian
5ce67f756b
transform NotFoundError to standard MCP error (#2133) 2025-10-18 11:46:57 -04:00
Jeremiah Lowin
6f627b58fd
Implement icon support (#2121)
* Implement icon support in fastmcp

* Fix icon feature tests

- Update snapshot for ResourceTemplate to include icons field
- Remove OAuth mounting tests (belong to PR #2119, not this feature)

* Update docs
2025-10-17 17:28:08 -04:00
Jeremiah Lowin
330eaed11f
OAuth proxy issues its own tokens (#2109)
* OAuth proxy issues its own tokens

Implement token factory pattern where proxy issues FastMCP JWTs
instead of forwarding upstream tokens. Tokens are minimal references
(JTI) that map to encrypted upstream credentials stored server-side.

* Update run-tests.yml

* Update secret generation and docs

* Add upgrade guide
2025-10-17 14:31:53 -04:00
Jeremiah Lowin
d472e30765
Support mounting OAuth-protected servers under path prefixes (#2119)
* Add issuer_url parameter to OAuth providers for mounting scenarios

* Add get_well_known_routes

* Update docs

* Improve docs and tests

* Trigger CI

* Fix conditional test execution for Windows
2025-10-17 11:44:49 -04:00
Jeremiah Lowin
d4837b41c5
Disable parallel test execution on Windows (#2128) 2025-10-17 11:28:42 -04:00
Jeremiah Lowin
4f5aebe59b
Update version badge for azure auth docs (#2120)
* Update version badge for azure auth docs

* Revert "Update version badge for azure auth docs"

This reverts commit 8b0537e295.
2025-10-17 09:38:59 -04:00
Jeremiah Lowin
4a9f02c87c
Upgrade to MCP 1.17+ with RFC 9728 compliance (#2122)
* Upgrade to MCP 1.17+ with RFC 9728 compliance

Updates FastMCP to require MCP 1.17+ and implements RFC 9728-compliant
OAuth protected resource metadata URL handling.

The key change is that .well-known/oauth-protected-resource endpoints
are now registered at path-aware locations. For example, if an MCP
server is mounted at /mcp, the metadata endpoint is now at
/.well-known/oauth-protected-resource/mcp instead of
/.well-known/oauth-protected-resource.

This ensures proper OAuth discovery for path-based resource servers
and aligns with the MCP SDK's implementation of RFC 9728 §3.1.

Changes include:
- Update minimum MCP version from 1.12.4 to 1.17.0
- Use build_resource_metadata_url() for RFC 9728 compliance
- Configure CI to test with latest package versions (--upgrade)
- Update tests for path-aware metadata URLs
- Add icons field to Tool model (introduced in MCP 1.17)

* Fix RemoteAuthProvider integration tests for RFC 9728

* Fix parameterized test for nested base URL paths
2025-10-17 09:29:23 -04:00
William Easton
83adbc0a79
Merge pull request #1845 from jlowin/responsecachingmiddleware
Add Response Caching Middleware
2025-10-16 22:12:31 -05:00
William Easton
f5d770e801
update lock 2025-10-16 22:00:57 -05:00
William Easton
831a5dd070
Unwind tool result changes 2025-10-16 21:59:55 -05:00
William Easton
b713b5e4d0
Merge branch 'main' into responsecachingmiddleware 2025-10-16 21:59:20 -05:00
William Easton
5831c4bb60
PR Clean-up 2025-10-16 21:56:55 -05:00
marvin-context-protocol[bot]
ef4afe4061
chore: Update SDK documentation (#1950)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2025-10-16 21:18:01 -04:00
Jeremiah Lowin
91653d2c1e
Add security policy (#2117) 2025-10-16 18:04:43 -04:00
Jeremiah Lowin
2f841c356e
Document container limitations for Image/Audio/File objects (#2118) 2025-10-16 18:03:29 -04:00
Jeremiah Lowin
52e9af1214
Add RFC 7662 token introspection provider (#2074) 2025-10-16 10:57:06 -04:00
Andrew McLachlan
98fb0a6115
Fix missing import in Tool Transformation docs. (#2108) 2025-10-15 17:49:19 -07:00
Romaric Parmentier
586a7515df
chore(auth): add client_storage property to aws provider (#2107) 2025-10-15 17:18:53 -07:00
Jeremiah Lowin
5988873601
Fix log handler to accept any JSON-serializable data type (#2102) 2025-10-15 10:20:04 -07:00
Jeremiah Lowin
a0d1c7fb69
Remove obsolete claude.py with Windows path bug (#2101) 2025-10-15 07:04:46 -07:00