Skip to content

Commit 72ac2ff

Browse files
feat(mcp): Add get_custom_source_definition tool to retrieve connector builder manifests (#933)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 3c36bef commit 72ac2ff

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

airbyte/mcp/cloud_ops.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,50 @@ def list_custom_source_definitions(
16271627
]
16281628

16291629

1630+
@mcp_tool(
1631+
domain="cloud",
1632+
read_only=True,
1633+
idempotent=True,
1634+
open_world=True,
1635+
)
1636+
def get_custom_source_definition(
1637+
definition_id: Annotated[
1638+
str,
1639+
Field(description="The ID of the custom source definition to retrieve."),
1640+
],
1641+
*,
1642+
workspace_id: Annotated[
1643+
str | None,
1644+
Field(
1645+
description=WORKSPACE_ID_TIP_TEXT,
1646+
default=None,
1647+
),
1648+
],
1649+
) -> dict[str, Any]:
1650+
"""Get a custom YAML source definition from Airbyte Cloud, including its manifest.
1651+
1652+
Returns the full definition details including the manifest YAML content,
1653+
which can be used to inspect or store the connector configuration locally.
1654+
1655+
Note: Only YAML (declarative) connectors are currently supported.
1656+
Docker-based custom sources are not yet available.
1657+
"""
1658+
workspace: CloudWorkspace = _get_cloud_workspace(workspace_id)
1659+
definition = workspace.get_custom_source_definition(
1660+
definition_id=definition_id,
1661+
definition_type="yaml",
1662+
)
1663+
1664+
return {
1665+
"definition_id": definition.definition_id,
1666+
"name": definition.name,
1667+
"version": definition.version,
1668+
"connector_builder_project_id": definition.connector_builder_project_id,
1669+
"connector_builder_project_url": definition.connector_builder_project_url,
1670+
"manifest": definition.manifest,
1671+
}
1672+
1673+
16301674
@mcp_tool(
16311675
domain="cloud",
16321676
destructive=True,

tests/integration_tests/destinations/test_source_to_destination.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
from __future__ import annotations
66

7+
import shutil
8+
from pathlib import Path
9+
710
import pytest
811
from airbyte import get_source
912
from airbyte._executors.base import Executor
@@ -23,6 +26,10 @@
2326
@pytest.fixture
2427
def new_duckdb_destination_executor() -> Executor:
2528
"""Return a new JSONL destination executor."""
29+
local_mount_dir = Path.cwd() / "destination-duckdb"
30+
if local_mount_dir.exists():
31+
shutil.rmtree(local_mount_dir, ignore_errors=True)
32+
2633
return get_connector_executor(
2734
name="destination-duckdb",
2835
docker_image="airbyte/destination-duckdb:latest",

0 commit comments

Comments
 (0)