Repository navigation
feat(mcp): support ?read-only=true URL param for clients without custom headers - #1433
Conversation
Co-Authored-By: AJ Steers <[email protected]>
|
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/1793319647-mcp-url-param-modalities' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1793319647-mcp-url-param-modalities'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 |
Co-Authored-By: AJ Steers <[email protected]>
|
|
Let's reduce this to the minimum that we know we need, which is the read-only option, and remove the other options |
|
Will do. In this PR I'll drop Posted by Devin, on behalf of Aaron ("AJ") Steers (@aaronsteers). |
Co-Authored-By: AJ Steers <[email protected]>
?read-only=true URL param for clients without custom headers
Co-Authored-By: AJ Steers <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The pinned dependency allows ?read-only=false to bypass server-configured MCP_READONLY_MODE=1, potentially exposing writable tools despite the read-only setting.
1 open issue
What changed in this PR
Adds URL-based read-only mode to PyAirbyte’s hosted MCP server for clients that cannot send custom headers, using the existing shared tool filters.
Changes:
- Pins
fastmcp-extensionsto a prerelease with URL query parameter support. - Adds an HTTP test verifying that
?read-only=truehides a writable tool while retaining a read-only tool. - Documents the read-only URL parameter and hosted endpoint example.
| File | Description |
|---|---|
uv.lock |
Locks the selected prerelease and its distribution artifacts. |
tests/unit_tests/test_mcp_http.py |
Supports custom session URLs and tests read-only tool visibility. |
pyproject.toml |
Pins the dependency providing query parameter support. |
airbyte/mcp/__init__.py |
Documents how HTTP clients enable read-only mode through the URL. |
Review effort: Balanced
Co-Authored-By: AJ Steers <[email protected]>
|
Co-Authored-By: AJ Steers <[email protected]>
1e79888
into
release-candidate/v1

Summary
Claude's custom connector UI can't send custom headers, so it has no way to turn on read-only mode on the hosted Cloud MCP. This picks up airbytehq/fastmcp-extensions#157 (released in
0.37.0), which adds the?read-only=trueURL query param to the shared standard read-only filter. PyAirbyte already enablesinclude_standard_tool_filters, so no new PyAirbyte config args are needed:fastmcp-extensionsto>=0.37.0,<1.0.0and documents the URL param inairbyte/mcp/__init__.py.run_mcp_http_server: near-miss names (?readonly=,?read_only=, ...) and invalid values (?read-only=yes) return HTTP 400, and other query params are ignored. A request can't disable read-only when the server setsMCP_READONLY_MODE=1.tools/listtests:?read-only=truehidesrun_connection_syncand keepslist_workspaces.MCP_READONLY_MODE=1+?read-only=falsestill hidesrun_connection_sync.?allow-*and?insidersparams are left out for now.Test plan
uv run pytest tests/unit_tests/test_mcp_http.py -qpasses (12 tests) against0.37.0.0.37.0) was deployed tohttps://mcp.internal.airbyte.ai/cloud-mcp-previewand tested withtools/list:?read-only=truereturns 32 tools, all read-only, instead of 55.?readonly=trueand?read-only=yesreturn 400.?utm_source=xis ignored.mcp.airbyte.comhasn't been tested yet.Link to Devin session: https://app.devin.ai/sessions/06a79d83e27e4641825a199f478b4d9e
Open in Devin Desktop: https://app.devin.ai/desktop/session/06a79d83e27e4641825a199f478b4d9e?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)