Commit graph

2,500 commits

Author SHA1 Message Date
Jeremiah Lowin
9c21754a45
Fix Azure provider OIDC scope handling (#2506) v2.13.2
* Fix Azure provider to handle OIDC scopes correctly

OIDC scopes (openid, profile, email, offline_access) were being
incorrectly prefixed with identifier_uri, causing Azure to reject
authorization requests. This fix:

- Detects OIDC scopes and sends them unprefixed to Azure
- Filters OIDC scopes from token validation (Azure doesn't include
  them in access token scp claims)
- Still advertises OIDC scopes to clients via valid_scopes
- Also handles dot-notation scopes (e.g., User.Read) correctly

Fixes #2451, #2420

* Fix dot-notation scopes to be prefixed (custom scopes can have dots)

* Improve Azure scope handling docs with clear examples
2025-12-01 13:42:36 -05:00
Jeremiah Lowin
83085c3cd3
Fix version badges for icons and website_url; add Discord example (#2509)
* Fix version badges and remove redundant badges from Discord doc

* Add Discord OAuth example
2025-12-01 13:39:43 -05:00
Jeremiah Lowin
aa53bdf53e
Add Discord OAuth integration documentation (#2508) 2025-12-01 13:34:33 -05:00
Ayesha Shafique
e1d41f5e3b
Add Discord OAuth provider and corresponding tests (#2428)
* Add Discord OAuth provider and corresponding tests

* Update DiscordProvider client_secret and required_scopes documentation

* Add Discord to authentication support list in README

* Fix Discord token verifier to match actual API response format

Discord's /api/oauth2/@me endpoint returns:
- "scopes" as a list, not "scope" as a space-separated string
- "expires" as ISO timestamp, not "expires_in" as seconds
- "user" data directly in the response (no need for extra API call)

* Simplify Discord token verifier

---------

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2025-12-01 12:58:29 -05:00
Jeremiah Lowin
246a0adefd
Fix get_access_token() returning stale token after OAuth refresh (#2505)
* Fix get_access_token() returning stale token after OAuth refresh

Fixes #1863

* Update dependencies.py
2025-12-01 10:51:02 -05:00
Jeremiah Lowin
01ecc91807
Fix OAuth proxy refresh token storage for multi-instance deployments (#2483)
* Fix OAuth proxy refresh token storage for multi-instance deployments

- Use pluggable client_storage instead of local dict for refresh tokens
- Store refresh tokens by SHA-256 hash for defense in depth
- Remove unused access token and relationship mapping stores
- Simplify revocation logic

* Address review feedback for refresh token storage

- Use calculated refresh_expires_in for TTL instead of hardcoded 30 days
- Populate expires_at field with actual expiry timestamp
- Add client_id validation in load_refresh_token to prevent cross-client token usage
2025-12-01 09:26:27 -05:00
Jeremiah Lowin
3341c0c893
Add icons support to proxy classes (#2502) 2025-12-01 08:55:51 -05:00
Muspi Merol
adbb7d6e53
Add title attribute to ProxyTool, ProxyResource, … (#2497)
* fix: add title attribute to ProxyTool, ProxyResource, ProxyTemplate, and ProxyPrompt

* test: add title assertions for proxy tools, resources, and prompts
2025-12-01 08:48:42 -05:00
Jeremiah Lowin
ba69fba305
Add consent_csp_policy parameter for CSP customization (#2484)
* Add consent_csp_policy parameter to OAuthProxy

Allows customization or disabling of CSP directives on the consent page.
Fixes #2476.

* Add consent_csp_policy to OIDCProxy and update docs

* Fix HTML injection vulnerability in CSP policy

HTML-escape the CSP policy value before inserting into meta tag to prevent HTML injection when CSP policies contain quotes.
2025-11-26 16:53:40 -05:00
jason
d770a76c79
fix: prevent $defs mutation in Tool.from_tool transforms (#2493)
Deep copy parent_defs before passing to compress_schema to prevent
mutation from affecting parent tool schemas when child tools hide
parameters that remove all $ref usage.
2025-11-26 16:52:01 -05:00
SHAIK AYESHA
256f376988
Fix version number in VersionBadge: change 2.14.0 to 2.13.0 (#2491)
Corrects the typo in the VersionBadge component in docs/servers/icons.mdx. The version number was incorrectly displayed as 2.14.0 but should be 2.13.0 to match the actual current version of FastMCP.

Fixes issue #2487
2025-11-26 16:51:18 -05:00
dependabot[bot]
25166afe98
Bump actions/checkout from 5 to 6 (#2474)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-26 16:50:49 -05:00
marvin-context-protocol[bot]
fd0297014f
chore: Update SDK documentation (#2365)
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2025-11-22 12:30:09 -05:00
Akshay Parihar
a57a155c2e
Scalekit provider updates (#2413)
* sk-provider updates - aud not enforce, scopes enforce if present

* updating env_prefix, adding debug logs

* updating docs

* ruff formatting

* not changing prefix for backward compatiblity

* backward compatibility changes

* give more preference to base_url than mcp_url if both passed

* updating docs

* refactor

* updating example server

* updating readme of example

* updating docs

* updating tests to reflect what should ideally go in the parameter
2025-11-22 12:22:13 -05:00
Kevin J Gao
05db547d86
feat: Made Changes to DescopeProvider to Support New Well Known URLs (#2392)
* added new DescopeProvider for Agentic Identity Hub

* fixed formatting with ruff

* made coderabbit change

* changed wording in descope.mdx

* added backwards compatibility

* ran ruff

* added scopes_supported to protected metadata resource

* empty commit to re-run tests
2025-11-22 12:20:50 -05:00
William Easton
08a0503f63
Merge pull request #2437 from jlowin/latest-py-key-value
Bump py-key-value-aio to 0.3.0
2025-11-22 11:10:13 -06:00
William Easton
16562c918e
Merge branch 'main' into latest-py-key-value 2025-11-22 11:07:28 -06:00
Jeremiah Lowin
e37951eb5d
Merge pull request #2446 from Shengshenlan/patch-1
Update http.mdx
2025-11-22 12:04:49 -05:00
Jeremiah Lowin
3592af524a
Merge pull request #2462 from Neet-Nestor/main
Fix Azure OAuth token refresh with unprefixed scopes
2025-11-22 12:04:04 -05:00
Jeremiah Lowin
f06193850a
Merge pull request #2440 from jlowin/fix-exclude-args-serialization
Fix exclude_args with non-serializable types
2025-11-22 12:02:29 -05:00
Nestor Qin
4d7af38d3f
Merge branch 'main' into main 2025-11-20 15:34:35 -08:00
Nestor Qin
2852f2cb13 Use lazy logging 2025-11-20 15:31:40 -08:00
Nestor Qin
119bf445ea Resolve comments 2025-11-20 15:16:50 -08:00
Nestor Qin
463652a878 Add unit tests 2025-11-20 15:08:50 -08:00
Nestor Qin
9e28da11f2 fix Azure token refresh issue 2025-11-19 19:02:31 +00:00
William Easton
b3bce0c231
Merge pull request #2442 from jlowin/patch-test-failure-analysis
Update martian-test-failure.yml
2025-11-18 08:41:24 -06:00
Shengshenlan
8b546fd294
Update http.mdx
add a hint
2025-11-18 17:10:50 +08:00
William Easton
73d0f6abf0
Update martian-test-failure.yml 2025-11-17 18:34:31 -06:00
William Easton
6a462827a4
Merge branch 'main' into latest-py-key-value 2025-11-17 12:12:58 -06:00
William Easton
1b5e3cb272
Actually update lockfile, ignore caching diskstore cleanup 2025-11-17 12:03:24 -06:00
Jeremiah Lowin
52100b08ff Fix exclude_args with non-serializable types
Fixes issue #2431 where exclude_args fails when excluded parameters have
non-serializable types (e.g., ServerSession). The fix excludes parameters
from function annotations before Pydantic tries to serialize them.

Also adds deprecation notice that exclude_args will be deprecated in
FastMCP 2.14 in favor of dependency injection.
2025-11-17 12:25:43 -05:00
Jeremiah Lowin
dd876b5833
Merge pull request #2439 from jlowin/oidc-proxy-extra-params
Add extra_authorize_params and extra_token_params to OIDCProxy
2025-11-17 12:23:11 -05:00
Jeremiah Lowin
24204cdafc
Merge pull request #2438 from jlowin/google-provider-refresh-token-defaults
Add refresh token support defaults to GoogleProvider
2025-11-17 11:58:58 -05:00
Jeremiah Lowin
e0f0f816b7 Add extra_authorize_params and extra_token_params to OIDCProxy 2025-11-17 11:57:58 -05:00
Jeremiah Lowin
be90d6eb60
Merge pull request #2432 from jlowin/dependabot/github_actions/actions/setup-python-6
Bump actions/setup-python from 5 to 6
2025-11-17 11:56:37 -05:00
Jeremiah Lowin
cf7ae12a65
Merge pull request #2433 from jlowin/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-11-17 11:56:10 -05:00
Jeremiah Lowin
ea31747572 Add refresh token support defaults to GoogleProvider
Set access_type=offline and prompt=consent by default to ensure
refresh tokens are returned by Google. Also expose extra_authorize_params
so users can customize authorization behavior.
2025-11-17 11:54:00 -05:00
William Easton
64c3796d31
Bump py-key-value versions 2025-11-17 10:49:11 -06:00
dependabot[bot]
e5c6f04e0f
Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 04:25:24 +00:00
dependabot[bot]
065a4d520b
Bump actions/setup-python from 5 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 04:25:13 +00:00
Jeremiah Lowin
b5f88bfe42
Merge pull request #2426 from jlowin/simplify-object-schema-check v2.13.1
Simplify _is_object_schema helper
2025-11-15 12:39:04 -05:00
Jeremiah Lowin
e9667b6624 Fix test regex pattern for updated error message 2025-11-15 12:32:37 -05:00
Jeremiah Lowin
0af1c78cc9 Simplify _is_object_schema helper function 2025-11-15 12:27:37 -05:00
Jeremiah Lowin
e6936d0bf1
Merge pull request #2422 from jlowin/exclude-mcp-1.21.1-add-scope-validation
Exclude MCP SDK 1.21.1 and add scope validation to InMemoryOAuthProvider
2025-11-15 12:22:44 -05:00
Jeremiah Lowin
533cfb66fa
Merge pull request #2424 from jlowin/fix-bug-report-dI2C9
Fix self-referencing types not being recognized as object schemas
2025-11-15 12:21:21 -05:00
Jeremiah Lowin
f6635aa15b Fix type errors in oauth_proxy and test_auth_integration
- Add null checks for client_id before using in OAuthTransaction, AuthorizationCode, AccessToken, RefreshToken
- Add null check for redirect_uris before len() call
- Import AuthorizeError from mcp.server.auth.provider
2025-11-15 12:21:15 -05:00
Jeremiah Lowin
3826f1a240 Fix typos and formatting 2025-11-15 12:21:15 -05:00
Jeremiah Lowin
c7f4ff2cbe Add scope validation to InMemoryOAuthProvider and remove debug breakpoint
- Add scope validation to InMemoryOAuthProvider.register_client() to match MCP SDK behavior
- Ensures unit tests catch scope-related bugs like the MCP SDK 1.21.1 issue
- Remove debug breakpoint from OAuth client redirect_handler
2025-11-15 12:21:15 -05:00
Jeremiah Lowin
ec38507f9b Exclude MCP SDK 1.21.1 and update OAuth client tests
- Exclude MCP SDK 1.21.1 due to bug adding metadata URL to scopes
- Update OAuth client tests to use valid scopes
2025-11-15 12:21:15 -05:00
Jeremiah Lowin
e3ed74b794
docs: fix run_server_async documentation (#2423)
Remove incorrect task_group parameter and AnyIO references. Update to show correct async context manager usage matching actual implementation.

Fixes #2395

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
2025-11-15 12:07:22 -05:00