2626 SDKBenchmarkCreateParams ,
2727 SDKBlueprintCreateParams ,
2828 SDKDiskSnapshotListParams ,
29+ SDKMcpConfigListParams ,
2930 SDKGatewayConfigListParams ,
3031 SDKNetworkPolicyListParams ,
32+ SDKMcpConfigCreateParams ,
3133 SDKGatewayConfigCreateParams ,
3234 SDKNetworkPolicyCreateParams ,
3335 SDKDevboxCreateFromImageParams ,
4345from .async_benchmark import AsyncBenchmark
4446from .async_blueprint import AsyncBlueprint
4547from ..lib .context_loader import TarFilter , build_directory_tar
48+ from .async_mcp_config import AsyncMcpConfig
4649from .async_gateway_config import AsyncGatewayConfig
4750from .async_network_policy import AsyncNetworkPolicy
4851from .async_storage_object import AsyncStorageObject
@@ -1011,6 +1014,80 @@ async def list(self, **params: Unpack[SDKGatewayConfigListParams]) -> list[Async
10111014 return [AsyncGatewayConfig (self ._client , item .id ) for item in page .gateway_configs ]
10121015
10131016
1017+ class AsyncMcpConfigOps :
1018+ """High-level async manager for creating and managing MCP configurations.
1019+
1020+ Accessed via ``runloop.mcp_config`` from :class:`AsyncRunloopSDK`, provides methods
1021+ to create, retrieve, update, delete, and list MCP configs. MCP configs define
1022+ how to connect to upstream MCP (Model Context Protocol) servers, specifying the
1023+ target endpoint and which tools are allowed.
1024+
1025+ Example:
1026+ >>> runloop = AsyncRunloopSDK()
1027+ >>> mcp_config = await runloop.mcp_config.create(
1028+ ... name="my-mcp-server",
1029+ ... endpoint="https://mcp.example.com",
1030+ ... allowed_tools=["*"],
1031+ ... )
1032+ """
1033+
1034+ def __init__ (self , client : AsyncRunloop ) -> None :
1035+ """Initialize AsyncMcpConfigOps.
1036+
1037+ :param client: AsyncRunloop client instance
1038+ :type client: AsyncRunloop
1039+ """
1040+ self ._client = client
1041+
1042+ async def create (self , ** params : Unpack [SDKMcpConfigCreateParams ]) -> AsyncMcpConfig :
1043+ """Create a new MCP config.
1044+
1045+ Example:
1046+ >>> mcp_config = await runloop.mcp_config.create(
1047+ ... name="my-mcp-server",
1048+ ... endpoint="https://mcp.example.com",
1049+ ... allowed_tools=["*"],
1050+ ... description="MCP server for my tools",
1051+ ... )
1052+
1053+ :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKMcpConfigCreateParams` for available parameters
1054+ :return: The newly created MCP config
1055+ :rtype: AsyncMcpConfig
1056+ """
1057+ response = await self ._client .mcp_configs .create (** params )
1058+ return AsyncMcpConfig (self ._client , response .id )
1059+
1060+ def from_id (self , mcp_config_id : str ) -> AsyncMcpConfig :
1061+ """Get an AsyncMcpConfig instance for an existing MCP config ID.
1062+
1063+ Example:
1064+ >>> mcp_config = runloop.mcp_config.from_id("mcp_1234567890")
1065+ >>> info = await mcp_config.get_info()
1066+ >>> print(f"MCP Config name: {info.name}")
1067+
1068+ :param mcp_config_id: ID of the MCP config
1069+ :type mcp_config_id: str
1070+ :return: AsyncMcpConfig instance for the given ID
1071+ :rtype: AsyncMcpConfig
1072+ """
1073+ return AsyncMcpConfig (self ._client , mcp_config_id )
1074+
1075+ async def list (self , ** params : Unpack [SDKMcpConfigListParams ]) -> list [AsyncMcpConfig ]:
1076+ """List all MCP configs, optionally filtered by parameters.
1077+
1078+ Example:
1079+ >>> configs = await runloop.mcp_config.list(limit=10)
1080+ >>> for config in configs:
1081+ ... print(config.id)
1082+
1083+ :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKMcpConfigListParams` for available parameters
1084+ :return: List of MCP configs
1085+ :rtype: list[AsyncMcpConfig]
1086+ """
1087+ page = await self ._client .mcp_configs .list (** params )
1088+ return [AsyncMcpConfig (self ._client , item .id ) for item in page .mcp_configs ]
1089+
1090+
10141091class AsyncRunloopSDK :
10151092 """High-level asynchronous entry point for the Runloop SDK.
10161093
@@ -1040,6 +1117,8 @@ class AsyncRunloopSDK:
10401117 :vartype network_policy: AsyncNetworkPolicyOps
10411118 :ivar gateway_config: High-level async interface for gateway config management
10421119 :vartype gateway_config: AsyncGatewayConfigOps
1120+ :ivar mcp_config: High-level async interface for MCP config management
1121+ :vartype mcp_config: AsyncMcpConfigOps
10431122
10441123 Example:
10451124 >>> runloop = AsyncRunloopSDK() # Uses RUNLOOP_API_KEY env var
@@ -1055,6 +1134,7 @@ class AsyncRunloopSDK:
10551134 devbox : AsyncDevboxOps
10561135 blueprint : AsyncBlueprintOps
10571136 gateway_config : AsyncGatewayConfigOps
1137+ mcp_config : AsyncMcpConfigOps
10581138 network_policy : AsyncNetworkPolicyOps
10591139 scenario : AsyncScenarioOps
10601140 scorer : AsyncScorerOps
@@ -1104,6 +1184,7 @@ def __init__(
11041184 self .devbox = AsyncDevboxOps (self .api )
11051185 self .blueprint = AsyncBlueprintOps (self .api )
11061186 self .gateway_config = AsyncGatewayConfigOps (self .api )
1187+ self .mcp_config = AsyncMcpConfigOps (self .api )
11071188 self .network_policy = AsyncNetworkPolicyOps (self .api )
11081189 self .scenario = AsyncScenarioOps (self .api )
11091190 self .scorer = AsyncScorerOps (self .api )
0 commit comments