Skip to content

feat(mcp): support connection namespace settings in create_connection and update_connection - #1474

Merged
Aaron ("AJ") Steers (aaronsteers) merged 8 commits into
release-candidate/v1from
devin/1794627103-connection-namespace-settings
Nov 14, 2026
Merged

Aaron ("AJ") Steers (aaronsteers) merged 8 commits into
release-candidate/v1from
devin/1794627103-connection-namespace-settings

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #1473. Requested by AJ Steers.

Adds optional namespace_provider (source | destination | custom) and custom_namespace_pattern arguments to the create_connection, update_connection and update_connection_unsafe MCP tools. They are passed through to the public API's namespaceDefinition / namespaceFormat, and custom maps to the API's custom_format. The read-only CloudConnection.namespace_definition / namespace_format properties keep their names because they mirror the API response.

  • Each MCP arg is defined once as a reusable Annotated alias (NamespaceProviderArg, CustomNamespacePatternArg) that carries the type, description and TraceArg marker, and all three tools use them. A shared _NAMESPACE_TOOL_HELP pointer is added to each tool description.
  • The descriptions say the namespace is usually the destination schema name (dataset, database or path prefix on some destinations). They list interpolation variables with open-ended wording ("include: ${SOURCE_NAMESPACE}").
  • api_util.create_connection / patch_connection don't serialize omitted args, so creation keeps the API defaults and updates keep the existing settings.
  • CloudWorkspace.deploy_connection forwards the args. The new CloudConnection.set_namespace() handles updates.
  • api_util.validate_namespace_settings runs before any write. custom_namespace_pattern requires an explicit namespace_provider="custom" (also on update), and empty or whitespace-only patterns are rejected.
  • Update order in _update_cloud_connection_impl is: stream overrides (validated, then written) → disable if enabled=False → namespace → enable if enabled=True → schedule. This way, enabling or scheduling can't start a sync into the old namespace, and a rejected stream override doesn't leave the connection disabled.
  • A namespace-only update now counts as a valid setting in _validate_update_connection_args.
  • The settings are kept separate from table_prefix and from the source-side stream_namespace selector.
create_connection(..., namespace_provider="custom", custom_namespace_pattern="${SOURCE_NAMESPACE}_raw")
update_connection(connection_id=..., namespace_provider="destination")

Test plan

  • tests/unit_tests/test_connection_namespaces.py: create and update with each provider and with a custom pattern, omitted args not sent, invalid combinations failing before any write, and update-ordering regressions.
  • The related MCP cloud, schedule, API util and arg-trace parity tests pass (603 passed). Ruff and pyrefly are clean, and CI is green.
  • Not yet tested against a live Cloud workspace.

Link to Devin session: https://app.devin.ai/sessions/d310284bcb10417d98c97fa1d6c237d8
Open in Devin Desktop: https://app.devin.ai/desktop/session/d310284bcb10417d98c97fa1d6c237d8?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)

… and update_connection

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You 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/1794627103-connection-namespace-settings' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1794627103-connection-namespace-settings'

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
  • /evals - Runs the Cloud MCP evals that use the MCP tools this PR changed (/evals full=true runs the full suite)
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

@github-code-quality

github-code-quality Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/pytest-no-creds

release-candidate/v1 d9f652f devin/1794627103-con... af7669b +/-
65% 81% +16%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f devin/1794627103-con... af7669b +/-
airbyte/_util/api_util.py 36% 68% +32%
airbyte/mcp/cloud.py 52% 87% +35%
airbyte/cloud/connectors.py 34% 81% +47%
airbyte/cloud/connections.py 26% 76% +50%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/cloud/c...lder/project.py 0% 94% +94%
airbyte/_direct...ctors/models.py 0% 95% +95%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 96% +96%

Python / code-coverage/pytest

release-candidate/v1 d9f652f devin/1794627103-con... af7669b +/-
71% 83% +12%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f devin/1794627103-con... af7669b +/-
airbyte/cloud/connectors.py 51% 84% +33%
airbyte/mcp/cloud.py 52% 87% +35%
airbyte/cloud/connections.py 34% 78% +44%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/cloud/c...lder/project.py 0% 94% +94%
airbyte/_direct...ctors/models.py 0% 95% +95%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 96% +96%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest-unit

release-candidate/v1 devin/1794627103-con... af7669b +/-
— 78% —

Line coverage data for the release-candidate/v1 branch is not yet available.

View coverage of the 10 most covered files.
File release-candidate/v1 devin/1794627103-con... af7669b +/-
airbyte/mcp/_sso_auth.py — 96% —
airbyte/cloud/models.py — 96% —
airbyte/_direct...ctors/models.py — 95% —
airbyte/cloud/client.py — 91% —
airbyte/mcp/cloud.py — 87% —
airbyte/cloud/connectors.py — 81% —
airbyte/progress.py — 80% —
airbyte/cloud/connections.py — 76% —
airbyte/_util/api_util.py — 68% —
airbyte/shared/...ql_processor.py — 68% —

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 14, 2026 05:26 UTC

Comment thread airbyte/mcp/cloud.py Resolved
devin-ai-integration Bot and others added 3 commits November 14, 2026 04:02
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review November 14, 2026 04:49
Copilot AI balanced review requested due to automatic review settings November 14, 2026 04:49

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration

devin-ai-integration Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Devin Review

🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 finding. Devin automatically fixed it.

Fixed by Devin (1)
  • Rejected stream updates leave connections disabled — Stream overrides are validated/applied before any disable; order is now overrides → disable → namespace → enable → schedule, with a regression test.

View findings in Devin Review · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 2 commits November 14, 2026 05:11
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) merged commit 74ae3c1 into release-candidate/v1 Nov 14, 2026
30 checks passed
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) deleted the devin/1794627103-connection-namespace-settings branch November 14, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants