Skip to content

Commit 4dd9edd

Browse files
feat(mcp): configurable auth_mechanism on McpConfig, shared shape with gateway (#11113)
1 parent 9482e47 commit 4dd9edd

16 files changed

Lines changed: 125 additions & 64 deletions

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 121
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-ae0f5383aa4cb3defa2a011375d3524b89a9fed30e2ef6c8d225192a4ea8eb1f.yml
3-
openapi_spec_hash: a4f906d2af71050ead8673bad44a65d7
4-
config_hash: 25409d286d89763213d1155725bba77a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-2b4c651a27238a14ac7bd03ba582183d14f9622bdb5ea292c2cea97acc4c727e.yml
3+
openapi_spec_hash: 8a933236116d07c8a060b6eadd205feb
4+
config_hash: 7afcebea2dd638ed0cf0d5367f820f73

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from runloop_api_client.types import (
55
AfterIdle,
66
AgentMount,
77
AgentSource,
8+
AuthMechanism,
89
BrokerMount,
910
CodeMountParameters,
1011
CustomHeader,

src/runloop_api_client/resources/gateway_configs.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from .._base_client import AsyncPaginator, make_request_options
2222
from ..types.gateway_config_view import GatewayConfigView
2323
from ..types.shared_params.custom_header import CustomHeader
24+
from ..types.shared_params.auth_mechanism import AuthMechanism
2425

2526
__all__ = ["GatewayConfigsResource", "AsyncGatewayConfigsResource"]
2627

@@ -48,7 +49,7 @@ def with_streaming_response(self) -> GatewayConfigsResourceWithStreamingResponse
4849
def create(
4950
self,
5051
*,
51-
auth_mechanism: gateway_config_create_params.AuthMechanism,
52+
auth_mechanism: AuthMechanism,
5253
endpoint: str,
5354
name: str,
5455
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
@@ -149,7 +150,7 @@ def update(
149150
self,
150151
id: str,
151152
*,
152-
auth_mechanism: Optional[gateway_config_update_params.AuthMechanism] | Omit = omit,
153+
auth_mechanism: Optional[AuthMechanism] | Omit = omit,
153154
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
154155
description: Optional[str] | Omit = omit,
155156
endpoint: Optional[str] | Omit = omit,
@@ -167,8 +168,8 @@ def update(
167168
All fields are optional.
168169
169170
Args:
170-
auth_mechanism: Defines how credentials are applied to HTTP requests when proxying through the
171-
gateway.
171+
auth_mechanism: Defines how the primary credential is applied to requests proxied to the
172+
upstream.
172173
173174
custom_headers: New list of additional headers. Replaces the existing list entirely; use an
174175
empty list to clear all custom headers. At most 8 entries.
@@ -343,7 +344,7 @@ def with_streaming_response(self) -> AsyncGatewayConfigsResourceWithStreamingRes
343344
async def create(
344345
self,
345346
*,
346-
auth_mechanism: gateway_config_create_params.AuthMechanism,
347+
auth_mechanism: AuthMechanism,
347348
endpoint: str,
348349
name: str,
349350
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
@@ -444,7 +445,7 @@ async def update(
444445
self,
445446
id: str,
446447
*,
447-
auth_mechanism: Optional[gateway_config_update_params.AuthMechanism] | Omit = omit,
448+
auth_mechanism: Optional[AuthMechanism] | Omit = omit,
448449
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
449450
description: Optional[str] | Omit = omit,
450451
endpoint: Optional[str] | Omit = omit,
@@ -462,8 +463,8 @@ async def update(
462463
All fields are optional.
463464
464465
Args:
465-
auth_mechanism: Defines how credentials are applied to HTTP requests when proxying through the
466-
gateway.
466+
auth_mechanism: Defines how the primary credential is applied to requests proxied to the
467+
upstream.
467468
468469
custom_headers: New list of additional headers. Replaces the existing list entirely; use an
469470
empty list to clear all custom headers. At most 8 entries.

src/runloop_api_client/resources/mcp_configs.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from .._base_client import AsyncPaginator, make_request_options
2222
from ..types.mcp_config_view import McpConfigView
2323
from ..types.shared_params.custom_header import CustomHeader
24+
from ..types.shared_params.auth_mechanism import AuthMechanism
2425

2526
__all__ = ["McpConfigsResource", "AsyncMcpConfigsResource"]
2627

@@ -51,6 +52,7 @@ def create(
5152
allowed_tools: SequenceNotStr[str],
5253
endpoint: str,
5354
name: str,
55+
auth_mechanism: Optional[AuthMechanism] | Omit = omit,
5456
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
5557
description: Optional[str] | Omit = omit,
5658
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -77,6 +79,9 @@ def create(
7779
The first segment before '-' is used as the service name for tool routing (e.g.,
7880
'github-readonly' uses 'github' as the service name).
7981
82+
auth_mechanism: Defines how the primary credential is applied to requests proxied to the
83+
upstream.
84+
8085
custom_headers: Additional headers applied to upstream requests after the credential. At most 8
8186
entries.
8287
@@ -99,6 +104,7 @@ def create(
99104
"allowed_tools": allowed_tools,
100105
"endpoint": endpoint,
101106
"name": name,
107+
"auth_mechanism": auth_mechanism,
102108
"custom_headers": custom_headers,
103109
"description": description,
104110
},
@@ -152,6 +158,7 @@ def update(
152158
id: str,
153159
*,
154160
allowed_tools: Optional[SequenceNotStr[str]] | Omit = omit,
161+
auth_mechanism: Optional[AuthMechanism] | Omit = omit,
155162
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
156163
description: Optional[str] | Omit = omit,
157164
endpoint: Optional[str] | Omit = omit,
@@ -172,6 +179,9 @@ def update(
172179
allowed_tools: New glob patterns specifying which tools are allowed. Examples: ['*'] for all
173180
tools, ['github.search_*'] for specific patterns.
174181
182+
auth_mechanism: Defines how the primary credential is applied to requests proxied to the
183+
upstream.
184+
175185
custom_headers: New list of additional headers. Replaces the existing list entirely; use an
176186
empty list to clear all custom headers. At most 8 entries.
177187
@@ -198,6 +208,7 @@ def update(
198208
body=maybe_transform(
199209
{
200210
"allowed_tools": allowed_tools,
211+
"auth_mechanism": auth_mechanism,
201212
"custom_headers": custom_headers,
202213
"description": description,
203214
"endpoint": endpoint,
@@ -347,6 +358,7 @@ async def create(
347358
allowed_tools: SequenceNotStr[str],
348359
endpoint: str,
349360
name: str,
361+
auth_mechanism: Optional[AuthMechanism] | Omit = omit,
350362
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
351363
description: Optional[str] | Omit = omit,
352364
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -373,6 +385,9 @@ async def create(
373385
The first segment before '-' is used as the service name for tool routing (e.g.,
374386
'github-readonly' uses 'github' as the service name).
375387
388+
auth_mechanism: Defines how the primary credential is applied to requests proxied to the
389+
upstream.
390+
376391
custom_headers: Additional headers applied to upstream requests after the credential. At most 8
377392
entries.
378393
@@ -395,6 +410,7 @@ async def create(
395410
"allowed_tools": allowed_tools,
396411
"endpoint": endpoint,
397412
"name": name,
413+
"auth_mechanism": auth_mechanism,
398414
"custom_headers": custom_headers,
399415
"description": description,
400416
},
@@ -448,6 +464,7 @@ async def update(
448464
id: str,
449465
*,
450466
allowed_tools: Optional[SequenceNotStr[str]] | Omit = omit,
467+
auth_mechanism: Optional[AuthMechanism] | Omit = omit,
451468
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
452469
description: Optional[str] | Omit = omit,
453470
endpoint: Optional[str] | Omit = omit,
@@ -468,6 +485,9 @@ async def update(
468485
allowed_tools: New glob patterns specifying which tools are allowed. Examples: ['*'] for all
469486
tools, ['github.search_*'] for specific patterns.
470487
488+
auth_mechanism: Defines how the primary credential is applied to requests proxied to the
489+
upstream.
490+
471491
custom_headers: New list of additional headers. Replaces the existing list entirely; use an
472492
empty list to clear all custom headers. At most 8 entries.
473493
@@ -494,6 +514,7 @@ async def update(
494514
body=await async_maybe_transform(
495515
{
496516
"allowed_tools": allowed_tools,
517+
"auth_mechanism": auth_mechanism,
497518
"custom_headers": custom_headers,
498519
"description": description,
499520
"endpoint": endpoint,

src/runloop_api_client/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
BrokerMount as BrokerMount,
1212
ObjectMount as ObjectMount,
1313
CustomHeader as CustomHeader,
14+
AuthMechanism as AuthMechanism,
1415
LifecycleHooks as LifecycleHooks,
1516
ResumeTriggers as ResumeTriggers,
1617
LaunchParameters as LaunchParameters,

src/runloop_api_client/types/gateway_config_create_params.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
from typing_extensions import Required, TypedDict
77

88
from .shared_params.custom_header import CustomHeader
9+
from .shared_params.auth_mechanism import AuthMechanism
910

10-
__all__ = ["GatewayConfigCreateParams", "AuthMechanism"]
11+
__all__ = ["GatewayConfigCreateParams"]
1112

1213

1314
class GatewayConfigCreateParams(TypedDict, total=False):
@@ -34,20 +35,3 @@ class GatewayConfigCreateParams(TypedDict, total=False):
3435

3536
description: Optional[str]
3637
"""Optional description for this gateway configuration."""
37-
38-
39-
class AuthMechanism(TypedDict, total=False):
40-
"""How credentials should be applied to proxied requests.
41-
42-
Specify the type ('header', 'bearer') and optional key field.
43-
"""
44-
45-
type: Required[str]
46-
"""The type of authentication mechanism: 'header', 'bearer', or 'basic'.
47-
48-
For 'basic', store the secret as plain 'user:pass'; the gateway base64-encodes
49-
it.
50-
"""
51-
52-
key: Optional[str]
53-
"""Only valid for 'header' type: the header name (e.g., 'x-api-key')."""

src/runloop_api_client/types/gateway_config_update_params.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
from __future__ import annotations
44

55
from typing import Iterable, Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import TypedDict
77

88
from .shared_params.custom_header import CustomHeader
9+
from .shared_params.auth_mechanism import AuthMechanism
910

10-
__all__ = ["GatewayConfigUpdateParams", "AuthMechanism"]
11+
__all__ = ["GatewayConfigUpdateParams"]
1112

1213

1314
class GatewayConfigUpdateParams(TypedDict, total=False):
1415
auth_mechanism: Optional[AuthMechanism]
1516
"""
16-
Defines how credentials are applied to HTTP requests when proxying through the
17-
gateway.
17+
Defines how the primary credential is applied to requests proxied to the
18+
upstream.
1819
"""
1920

2021
custom_headers: Optional[Iterable[CustomHeader]]
@@ -32,19 +33,3 @@ class GatewayConfigUpdateParams(TypedDict, total=False):
3233

3334
name: Optional[str]
3435
"""New name for the GatewayConfig. Must be unique within your account."""
35-
36-
37-
class AuthMechanism(TypedDict, total=False):
38-
"""
39-
Defines how credentials are applied to HTTP requests when proxying through the gateway.
40-
"""
41-
42-
type: Required[str]
43-
"""The type of authentication mechanism: 'header', 'bearer', or 'basic'.
44-
45-
For 'basic', store the secret as plain 'user:pass'; the gateway base64-encodes
46-
it.
47-
"""
48-
49-
key: Optional[str]
50-
"""Only valid for 'header' type: the header name (e.g., 'x-api-key')."""

src/runloop_api_client/types/gateway_config_view.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,9 @@
44

55
from .._models import BaseModel
66
from .shared.custom_header import CustomHeader
7+
from .shared.auth_mechanism import AuthMechanism
78

8-
__all__ = ["GatewayConfigView", "AuthMechanism"]
9-
10-
11-
class AuthMechanism(BaseModel):
12-
"""How credentials should be applied to proxied requests."""
13-
14-
type: str
15-
"""The type of authentication mechanism: 'header', 'bearer', or 'basic'.
16-
17-
For 'basic', store the secret as plain 'user:pass'; the gateway base64-encodes
18-
it.
19-
"""
20-
21-
key: Optional[str] = None
22-
"""Only valid for 'header' type: the header name (e.g., 'x-api-key')."""
9+
__all__ = ["GatewayConfigView"]
2310

2411

2512
class GatewayConfigView(BaseModel):

src/runloop_api_client/types/mcp_config_create_params.py

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

88
from .._types import SequenceNotStr
99
from .shared_params.custom_header import CustomHeader
10+
from .shared_params.auth_mechanism import AuthMechanism
1011

1112
__all__ = ["McpConfigCreateParams"]
1213

@@ -30,6 +31,12 @@ class McpConfigCreateParams(TypedDict, total=False):
3031
service name).
3132
"""
3233

34+
auth_mechanism: Optional[AuthMechanism]
35+
"""
36+
Defines how the primary credential is applied to requests proxied to the
37+
upstream.
38+
"""
39+
3340
custom_headers: Optional[Iterable[CustomHeader]]
3441
"""Additional headers applied to upstream requests after the credential.
3542

src/runloop_api_client/types/mcp_config_update_params.py

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

88
from .._types import SequenceNotStr
99
from .shared_params.custom_header import CustomHeader
10+
from .shared_params.auth_mechanism import AuthMechanism
1011

1112
__all__ = ["McpConfigUpdateParams"]
1213

@@ -18,6 +19,12 @@ class McpConfigUpdateParams(TypedDict, total=False):
1819
Examples: ['*'] for all tools, ['github.search_*'] for specific patterns.
1920
"""
2021

22+
auth_mechanism: Optional[AuthMechanism]
23+
"""
24+
Defines how the primary credential is applied to requests proxied to the
25+
upstream.
26+
"""
27+
2128
custom_headers: Optional[Iterable[CustomHeader]]
2229
"""New list of additional headers.
2330

0 commit comments

Comments
 (0)