Repository navigation
fix(mcp): pin fastmcp<4.1.7 to restore hosted SSO login - #1465
Conversation
… login Co-Authored-By: AJ Steers <aj@airbyte.io>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1794492938-fix-sso-consent-cookie-fastmcp' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1794492938-fix-sso-consent-cookie-fastmcp'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
Code coverage overviewLanguages: Python Python / code-coverage/pytest-no-creds
View coverage of the 10 most impacted files.
Python / code-coverage/pytest
View coverage of the 10 most impacted files.
Python / code-coverage/pytest-unit
Line coverage data for the release-candidate/v1 branch is not yet available. View coverage of the 10 most covered files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…ay unique Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
…ires unique source IDs Co-Authored-By: AJ Steers <aj@airbyte.io>
_set_consent_binding_cookie signature
Devin Review🟢 Devin Review found nothing to fix · View findings |
fastmcp<4.1.7 to restore hosted SSO login
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the FastMCP compatibility update.
No open issues 🎉
What changed in this PR
This PR addresses hosted Cloud MCP login failures caused by incompatible FastMCP consent-cookie APIs. It narrows the dependency range and strengthens startup compatibility checks for the custom SSO proxy.
Changes:
- Constrains FastMCP to
>=4.0.9,<4.1.7and locks it to4.1.6. - Checks parameter names for both consent-binding methods so incompatible signatures fail at startup.
- Adds a signature-change regression test and names the fake MultiAuth verifier to avoid duplicate provider IDs.
| File | Description |
|---|---|
uv.lock |
Locks FastMCP to 4.1.6 and refreshes affected transitive dependencies. |
tests/unit_tests/test_mcp_sso_auth.py |
Tests rejection of an incompatible consent-cookie method signature. |
tests/unit_tests/test_mcp_http_main.py |
Assigns the fake verifier a distinct MultiAuth identifier. |
pyproject.toml |
Caps FastMCP below the incompatible 4.1.7 release. |
airbyte/mcp/_sso_auth.py |
Adds consent-binding signature checks and updates compatibility documentation and errors. |
Review effort: Balanced
4a8d8cc
into
release-candidate/v1
Overview
👉 TL;DR: Fixes the hosted Cloud MCP login, which has been failing with a server error for every user since 2026-11-06. It pins the auth library back to a stable release so the hosted image can no longer pull in an alpha build, and makes the server refuse to start if that library's internals ever change shape again.
Specifically, this pins
fastmcp>=4.0.9,<4.1.7and extendscheck_fastmcp_compatibility()to check the signatures of the privateOIDCProxyconsent-cookie methods thatAirbyteSsoOidcProxycalls.Changes
pyproject.toml:fastmcp>=4.0.9,<5.0→fastmcp>=4.0.9,<4.1.7.uv.lockmovesfastmcp/fastmcp-slimfrom 4.0.9 to 4.1.6.airbyte/mcp/_sso_auth.py: the new_CALLED_FASTMCP_METHOD_PARAMSgives the expected parameter names of_set_consent_binding_cookieand_verify_consent_binding_cookie.check_fastmcp_compatibility()now fails at startup when either one doesn't match. The existing_set_consent_binding_cookie(request, response, txn_id, token)call is unchanged.tests/unit_tests/test_mcp_sso_auth.py: a new test confirms that the check names a changed_set_consent_binding_cookiesignature.tests/unit_tests/test_mcp_http_main.py: theMultiAuthtest now names its fake verifier (verifiers={"headless": verifier}). fastmcp 4.1.6 rejects duplicate source IDs, and its two identical fakes collided.Review Spotlight
Reviewers with limited time, please review first:
pyproject.toml#L48: the pin_sso_auth.py#L704-L740: the startup signature checkRoot cause
uv pip install --prerelease=allow, so PyAirbyte'suv.lockis not used.fastmcp>=4.0.9,<5.0resolved to4.2.0a3for1.0.0-rc.42, and it resolves to4.2.0a4today.4.1.7+, droppedrequestfrom the private_set_consent_binding_cookie. EveryPOST /auth/login(Airbyte Cloud and SSO) then raisesTypeError: ConsentMixin._set_consent_binding_cookie() takes 4 positional arguments but 5 were given.<4.1.7excludes4.1.7pre-releases and every4.2.0a*, even with--prerelease=allow.Risks
fastmcp4.1.7+ alongside this release until the pin is lifted. Lifting it means changing the call to the new signature, and the startup check will flag that.AIRBYTE_MCP_SSO_OIDC_CONFIG_URL_TEMPLATE, so they never serve the SSO login page.Follow-ups
Test plan
uv run pytest tests/unit_tests/test_mcp_sso_auth.py tests/unit_tests/test_mcp_http_main.py: 143 passed.ruff checkandruff formatpass./authorize→/auth/login→POST /auth/login) against a localhttp_mainwith SSO login enabled and pointed atcloud.airbyte.com. Both builds were installed the way the image does it (--prerelease=allow):airbyte==1.0.0rc42(fastmcp4.2.0a4) returns 500 with theTypeErrorabove. This matches what prodmcp.airbyte.comreturns today.4.1.6) returns 302 to the Keycloak authorize URL.Link to Devin session: https://app.devin.ai/sessions/372eb3109e3742879489bff8d6b26bb0
Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.