Skip to content

Commit 01f4b3d

Browse files
fix: switching to MCP definition to specify a secret name per MCP server (#7715)
1 parent b0fad50 commit 01f4b3d

5 files changed

Lines changed: 30 additions & 27 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-439b1a08248ef3bc7457c7b0a9a6218149732535a9f0dd541501fc35e2a3f8c2.yml
3-
openapi_spec_hash: 35b12a086d98484417ce3d2543c47929
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-132ed160716591bdcd9231c00da8c506d9451a5486b165fc27b2a01d93202082.yml
3+
openapi_spec_hash: c2b44d9e9cda56e32141a7ea3794bbba
44
config_hash: cbda3692cb48ab8582a0df1674b9e5c8

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def create(
191191
file_mounts: Optional[Dict[str, str]] | Omit = omit,
192192
gateways: Optional[Dict[str, devbox_create_params.Gateways]] | Omit = omit,
193193
launch_parameters: Optional[LaunchParameters] | Omit = omit,
194-
mcp: Optional[Iterable[devbox_create_params.Mcp]] | Omit = omit,
194+
mcp: Optional[Dict[str, devbox_create_params.Mcp]] | Omit = omit,
195195
metadata: Optional[Dict[str, str]] | Omit = omit,
196196
mounts: Optional[Iterable[Mount]] | Omit = omit,
197197
name: Optional[str] | Omit = omit,
@@ -242,10 +242,11 @@ def create(
242242
243243
launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox.
244244
245-
mcp: [Beta] (Optional) MCP specifications for MCP server access. Each spec links an
246-
MCP config to a secret. The devbox will receive environment variables
247-
(RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP hub.
248-
Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}]
245+
mcp: [Beta] (Optional) MCP specifications for MCP server access. Map key is the
246+
environment variable name for the MCP token envelope. Each spec links an MCP
247+
config to a secret. The devbox will also receive RL_MCP_URL for the MCP hub
248+
endpoint. Example: {'MCP_SECRET': {'mcp_config': 'github-readonly', 'secret':
249+
'MY_GITHUB_TOKEN'}}
249250
250251
metadata: User defined metadata to attach to the devbox for organization.
251252
@@ -1869,7 +1870,7 @@ async def create(
18691870
file_mounts: Optional[Dict[str, str]] | Omit = omit,
18701871
gateways: Optional[Dict[str, devbox_create_params.Gateways]] | Omit = omit,
18711872
launch_parameters: Optional[LaunchParameters] | Omit = omit,
1872-
mcp: Optional[Iterable[devbox_create_params.Mcp]] | Omit = omit,
1873+
mcp: Optional[Dict[str, devbox_create_params.Mcp]] | Omit = omit,
18731874
metadata: Optional[Dict[str, str]] | Omit = omit,
18741875
mounts: Optional[Iterable[Mount]] | Omit = omit,
18751876
name: Optional[str] | Omit = omit,
@@ -1920,10 +1921,11 @@ async def create(
19201921
19211922
launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox.
19221923
1923-
mcp: [Beta] (Optional) MCP specifications for MCP server access. Each spec links an
1924-
MCP config to a secret. The devbox will receive environment variables
1925-
(RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP hub.
1926-
Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}]
1924+
mcp: [Beta] (Optional) MCP specifications for MCP server access. Map key is the
1925+
environment variable name for the MCP token envelope. Each spec links an MCP
1926+
config to a secret. The devbox will also receive RL_MCP_URL for the MCP hub
1927+
endpoint. Example: {'MCP_SECRET': {'mcp_config': 'github-readonly', 'secret':
1928+
'MY_GITHUB_TOKEN'}}
19271929
19281930
metadata: User defined metadata to attach to the devbox for organization.
19291931

src/runloop_api_client/types/devbox_create_params.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ class DevboxBaseCreateParams(TypedDict, total=False):
4949
launch_parameters: Optional[LaunchParameters]
5050
"""Parameters to configure the resources and launch time behavior of the Devbox."""
5151

52-
mcp: Optional[Iterable[Mcp]]
52+
mcp: Optional[Dict[str, Mcp]]
5353
"""[Beta] (Optional) MCP specifications for MCP server access.
5454
55-
Each spec links an MCP config to a secret. The devbox will receive environment
56-
variables (RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP
57-
hub. Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}]
55+
Map key is the environment variable name for the MCP token envelope. Each spec
56+
links an MCP config to a secret. The devbox will also receive RL_MCP_URL for the
57+
MCP hub endpoint. Example: {'MCP_SECRET': {'mcp_config': 'github-readonly',
58+
'secret': 'MY_GITHUB_TOKEN'}}
5859
"""
5960

6061
metadata: Optional[Dict[str, str]]

src/runloop_api_client/types/devbox_view.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .tunnel_view import TunnelView
88
from .shared.launch_parameters import LaunchParameters
99

10-
__all__ = ["DevboxView", "StateTransition", "GatewaySpecs", "McpSpec"]
10+
__all__ = ["DevboxView", "StateTransition", "GatewaySpecs", "McpSpecs"]
1111

1212

1313
class StateTransition(BaseModel):
@@ -39,7 +39,7 @@ class GatewaySpecs(BaseModel):
3939
"""The ID of the secret containing the credential."""
4040

4141

42-
class McpSpec(BaseModel):
42+
class McpSpecs(BaseModel):
4343
mcp_config_id: str
4444
"""The ID of the MCP config (e.g., mcp_123abc)."""
4545

@@ -107,11 +107,11 @@ class DevboxView(BaseModel):
107107
initiator_type: Optional[Literal["unknown", "api", "scenario", "scoring_validation"]] = None
108108
"""The type of initiator that created the Devbox."""
109109

110-
mcp_specs: Optional[List[McpSpec]] = None
110+
mcp_specs: Optional[Dict[str, McpSpecs]] = None
111111
"""[Beta] MCP specifications configured for this devbox.
112112
113-
Each spec links an MCP config to a secret for MCP server access through the MCP
114-
hub.
113+
Map key is the environment variable name for the MCP token envelope. Each spec
114+
links an MCP config to a secret for MCP server access through the MCP hub.
115115
"""
116116

117117
name: Optional[str] = None

tests/api_resources/test_devboxes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
9393
"username": "username",
9494
},
9595
},
96-
mcp=[
97-
{
96+
mcp={
97+
"foo": {
9898
"mcp_config": "mcp_config",
9999
"secret": "secret",
100100
}
101-
],
101+
},
102102
metadata={"foo": "string"},
103103
mounts=[
104104
{
@@ -1761,12 +1761,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
17611761
"username": "username",
17621762
},
17631763
},
1764-
mcp=[
1765-
{
1764+
mcp={
1765+
"foo": {
17661766
"mcp_config": "mcp_config",
17671767
"secret": "secret",
17681768
}
1769-
],
1769+
},
17701770
metadata={"foo": "string"},
17711771
mounts=[
17721772
{

0 commit comments

Comments
 (0)