2323 SDKScorerCreateParams ,
2424 SDKBenchmarkListParams ,
2525 SDKBlueprintListParams ,
26+ SDKMcpConfigListParams ,
2627 SDKBenchmarkCreateParams ,
2728 SDKBlueprintCreateParams ,
29+ SDKMcpConfigCreateParams ,
2830 SDKDiskSnapshotListParams ,
2931 SDKGatewayConfigListParams ,
3032 SDKNetworkPolicyListParams ,
4244from .async_snapshot import AsyncSnapshot
4345from .async_benchmark import AsyncBenchmark
4446from .async_blueprint import AsyncBlueprint
47+ from .async_mcp_config import AsyncMcpConfig
4548from ..lib .context_loader import TarFilter , build_directory_tar
4649from .async_gateway_config import AsyncGatewayConfig
4750from .async_network_policy import AsyncNetworkPolicy
@@ -1011,6 +1014,62 @@ 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+ :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKMcpConfigCreateParams` for available parameters
1046+ :return: The newly created MCP config
1047+ :rtype: AsyncMcpConfig
1048+ """
1049+ response = await self ._client .mcp_configs .create (** params )
1050+ return AsyncMcpConfig (self ._client , response .id )
1051+
1052+ def from_id (self , mcp_config_id : str ) -> AsyncMcpConfig :
1053+ """Get an AsyncMcpConfig instance for an existing MCP config ID.
1054+
1055+ :param mcp_config_id: ID of the MCP config
1056+ :type mcp_config_id: str
1057+ :return: AsyncMcpConfig instance for the given ID
1058+ :rtype: AsyncMcpConfig
1059+ """
1060+ return AsyncMcpConfig (self ._client , mcp_config_id )
1061+
1062+ async def list (self , ** params : Unpack [SDKMcpConfigListParams ]) -> list [AsyncMcpConfig ]:
1063+ """List all MCP configs, optionally filtered by parameters.
1064+
1065+ :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKMcpConfigListParams` for available parameters
1066+ :return: List of MCP configs
1067+ :rtype: list[AsyncMcpConfig]
1068+ """
1069+ page = await self ._client .mcp_configs .list (** params )
1070+ return [AsyncMcpConfig (self ._client , item .id ) for item in page .mcp_configs ]
1071+
1072+
10141073class AsyncRunloopSDK :
10151074 """High-level asynchronous entry point for the Runloop SDK.
10161075
@@ -1040,6 +1099,8 @@ class AsyncRunloopSDK:
10401099 :vartype network_policy: AsyncNetworkPolicyOps
10411100 :ivar gateway_config: High-level async interface for gateway config management
10421101 :vartype gateway_config: AsyncGatewayConfigOps
1102+ :ivar mcp_config: High-level async interface for MCP config management
1103+ :vartype mcp_config: AsyncMcpConfigOps
10431104
10441105 Example:
10451106 >>> runloop = AsyncRunloopSDK() # Uses RUNLOOP_API_KEY env var
@@ -1055,6 +1116,7 @@ class AsyncRunloopSDK:
10551116 devbox : AsyncDevboxOps
10561117 blueprint : AsyncBlueprintOps
10571118 gateway_config : AsyncGatewayConfigOps
1119+ mcp_config : AsyncMcpConfigOps
10581120 network_policy : AsyncNetworkPolicyOps
10591121 scenario : AsyncScenarioOps
10601122 scorer : AsyncScorerOps
@@ -1104,6 +1166,7 @@ def __init__(
11041166 self .devbox = AsyncDevboxOps (self .api )
11051167 self .blueprint = AsyncBlueprintOps (self .api )
11061168 self .gateway_config = AsyncGatewayConfigOps (self .api )
1169+ self .mcp_config = AsyncMcpConfigOps (self .api )
11071170 self .network_policy = AsyncNetworkPolicyOps (self .api )
11081171 self .scenario = AsyncScenarioOps (self .api )
11091172 self .scorer = AsyncScorerOps (self .api )
0 commit comments