Skip to content

Commit 9482e47

Browse files
feat(config): custom_headers on McpConfig/GatewayConfig — persistence, REST, validation, provisioner, OpenAPI (#11096)
1 parent 1f50f93 commit 9482e47

17 files changed

Lines changed: 219 additions & 10 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-7b9d926e46ee0dca27286795e6d90d3ba75643c897ea21c3ce05a7d999a1d33b.yml
3-
openapi_spec_hash: 19d9c8ceae252900eca5fbb84eb19285
4-
config_hash: 2b0535779b180339d10766ba74a96700
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

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ from runloop_api_client.types import (
77
AgentSource,
88
BrokerMount,
99
CodeMountParameters,
10+
CustomHeader,
1011
LaunchParameters,
1112
LifecycleConfiguration,
1213
LifecycleHooks,

src/runloop_api_client/resources/gateway_configs.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66

77
import httpx
88

@@ -20,6 +20,7 @@
2020
from ..pagination import SyncGatewayConfigsCursorIDPage, AsyncGatewayConfigsCursorIDPage
2121
from .._base_client import AsyncPaginator, make_request_options
2222
from ..types.gateway_config_view import GatewayConfigView
23+
from ..types.shared_params.custom_header import CustomHeader
2324

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

@@ -50,6 +51,7 @@ def create(
5051
auth_mechanism: gateway_config_create_params.AuthMechanism,
5152
endpoint: str,
5253
name: str,
54+
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
5355
description: Optional[str] | Omit = omit,
5456
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5557
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -73,6 +75,9 @@ def create(
7375
name: The human-readable name for the GatewayConfig. Must be unique within your
7476
account.
7577
78+
custom_headers: Additional headers applied to proxied requests after the auth mechanism. At most
79+
8 entries.
80+
7681
description: Optional description for this gateway configuration.
7782
7883
extra_headers: Send extra headers
@@ -92,6 +97,7 @@ def create(
9297
"auth_mechanism": auth_mechanism,
9398
"endpoint": endpoint,
9499
"name": name,
100+
"custom_headers": custom_headers,
95101
"description": description,
96102
},
97103
gateway_config_create_params.GatewayConfigCreateParams,
@@ -144,6 +150,7 @@ def update(
144150
id: str,
145151
*,
146152
auth_mechanism: Optional[gateway_config_update_params.AuthMechanism] | Omit = omit,
153+
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
147154
description: Optional[str] | Omit = omit,
148155
endpoint: Optional[str] | Omit = omit,
149156
name: Optional[str] | Omit = omit,
@@ -163,6 +170,9 @@ def update(
163170
auth_mechanism: Defines how credentials are applied to HTTP requests when proxying through the
164171
gateway.
165172
173+
custom_headers: New list of additional headers. Replaces the existing list entirely; use an
174+
empty list to clear all custom headers. At most 8 entries.
175+
166176
description: New description for this gateway configuration.
167177
168178
endpoint: New target endpoint URL (e.g., 'https://api.anthropic.com').
@@ -186,6 +196,7 @@ def update(
186196
body=maybe_transform(
187197
{
188198
"auth_mechanism": auth_mechanism,
199+
"custom_headers": custom_headers,
189200
"description": description,
190201
"endpoint": endpoint,
191202
"name": name,
@@ -335,6 +346,7 @@ async def create(
335346
auth_mechanism: gateway_config_create_params.AuthMechanism,
336347
endpoint: str,
337348
name: str,
349+
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
338350
description: Optional[str] | Omit = omit,
339351
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
340352
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -358,6 +370,9 @@ async def create(
358370
name: The human-readable name for the GatewayConfig. Must be unique within your
359371
account.
360372
373+
custom_headers: Additional headers applied to proxied requests after the auth mechanism. At most
374+
8 entries.
375+
361376
description: Optional description for this gateway configuration.
362377
363378
extra_headers: Send extra headers
@@ -377,6 +392,7 @@ async def create(
377392
"auth_mechanism": auth_mechanism,
378393
"endpoint": endpoint,
379394
"name": name,
395+
"custom_headers": custom_headers,
380396
"description": description,
381397
},
382398
gateway_config_create_params.GatewayConfigCreateParams,
@@ -429,6 +445,7 @@ async def update(
429445
id: str,
430446
*,
431447
auth_mechanism: Optional[gateway_config_update_params.AuthMechanism] | Omit = omit,
448+
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
432449
description: Optional[str] | Omit = omit,
433450
endpoint: Optional[str] | Omit = omit,
434451
name: Optional[str] | Omit = omit,
@@ -448,6 +465,9 @@ async def update(
448465
auth_mechanism: Defines how credentials are applied to HTTP requests when proxying through the
449466
gateway.
450467
468+
custom_headers: New list of additional headers. Replaces the existing list entirely; use an
469+
empty list to clear all custom headers. At most 8 entries.
470+
451471
description: New description for this gateway configuration.
452472
453473
endpoint: New target endpoint URL (e.g., 'https://api.anthropic.com').
@@ -471,6 +491,7 @@ async def update(
471491
body=await async_maybe_transform(
472492
{
473493
"auth_mechanism": auth_mechanism,
494+
"custom_headers": custom_headers,
474495
"description": description,
475496
"endpoint": endpoint,
476497
"name": name,

src/runloop_api_client/resources/mcp_configs.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66

77
import httpx
88

@@ -20,6 +20,7 @@
2020
from ..pagination import SyncMcpConfigsCursorIDPage, AsyncMcpConfigsCursorIDPage
2121
from .._base_client import AsyncPaginator, make_request_options
2222
from ..types.mcp_config_view import McpConfigView
23+
from ..types.shared_params.custom_header import CustomHeader
2324

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

@@ -50,6 +51,7 @@ def create(
5051
allowed_tools: SequenceNotStr[str],
5152
endpoint: str,
5253
name: str,
54+
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
5355
description: Optional[str] | Omit = omit,
5456
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5557
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -75,6 +77,9 @@ def create(
7577
The first segment before '-' is used as the service name for tool routing (e.g.,
7678
'github-readonly' uses 'github' as the service name).
7779
80+
custom_headers: Additional headers applied to upstream requests after the credential. At most 8
81+
entries.
82+
7883
description: Optional description for this MCP configuration.
7984
8085
extra_headers: Send extra headers
@@ -94,6 +99,7 @@ def create(
9499
"allowed_tools": allowed_tools,
95100
"endpoint": endpoint,
96101
"name": name,
102+
"custom_headers": custom_headers,
97103
"description": description,
98104
},
99105
mcp_config_create_params.McpConfigCreateParams,
@@ -146,6 +152,7 @@ def update(
146152
id: str,
147153
*,
148154
allowed_tools: Optional[SequenceNotStr[str]] | Omit = omit,
155+
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
149156
description: Optional[str] | Omit = omit,
150157
endpoint: Optional[str] | Omit = omit,
151158
name: Optional[str] | Omit = omit,
@@ -165,6 +172,9 @@ def update(
165172
allowed_tools: New glob patterns specifying which tools are allowed. Examples: ['*'] for all
166173
tools, ['github.search_*'] for specific patterns.
167174
175+
custom_headers: New list of additional headers. Replaces the existing list entirely; use an
176+
empty list to clear all custom headers. At most 8 entries.
177+
168178
description: New description for this MCP configuration.
169179
170180
endpoint: New target MCP server endpoint URL.
@@ -188,6 +198,7 @@ def update(
188198
body=maybe_transform(
189199
{
190200
"allowed_tools": allowed_tools,
201+
"custom_headers": custom_headers,
191202
"description": description,
192203
"endpoint": endpoint,
193204
"name": name,
@@ -336,6 +347,7 @@ async def create(
336347
allowed_tools: SequenceNotStr[str],
337348
endpoint: str,
338349
name: str,
350+
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
339351
description: Optional[str] | Omit = omit,
340352
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
341353
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -361,6 +373,9 @@ async def create(
361373
The first segment before '-' is used as the service name for tool routing (e.g.,
362374
'github-readonly' uses 'github' as the service name).
363375
376+
custom_headers: Additional headers applied to upstream requests after the credential. At most 8
377+
entries.
378+
364379
description: Optional description for this MCP configuration.
365380
366381
extra_headers: Send extra headers
@@ -380,6 +395,7 @@ async def create(
380395
"allowed_tools": allowed_tools,
381396
"endpoint": endpoint,
382397
"name": name,
398+
"custom_headers": custom_headers,
383399
"description": description,
384400
},
385401
mcp_config_create_params.McpConfigCreateParams,
@@ -432,6 +448,7 @@ async def update(
432448
id: str,
433449
*,
434450
allowed_tools: Optional[SequenceNotStr[str]] | Omit = omit,
451+
custom_headers: Optional[Iterable[CustomHeader]] | Omit = omit,
435452
description: Optional[str] | Omit = omit,
436453
endpoint: Optional[str] | Omit = omit,
437454
name: Optional[str] | Omit = omit,
@@ -451,6 +468,9 @@ async def update(
451468
allowed_tools: New glob patterns specifying which tools are allowed. Examples: ['*'] for all
452469
tools, ['github.search_*'] for specific patterns.
453470
471+
custom_headers: New list of additional headers. Replaces the existing list entirely; use an
472+
empty list to clear all custom headers. At most 8 entries.
473+
454474
description: New description for this MCP configuration.
455475
456476
endpoint: New target MCP server endpoint URL.
@@ -474,6 +494,7 @@ async def update(
474494
body=await async_maybe_transform(
475495
{
476496
"allowed_tools": allowed_tools,
497+
"custom_headers": custom_headers,
477498
"description": description,
478499
"endpoint": endpoint,
479500
"name": name,

src/runloop_api_client/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
AgentSource as AgentSource,
1111
BrokerMount as BrokerMount,
1212
ObjectMount as ObjectMount,
13+
CustomHeader as CustomHeader,
1314
LifecycleHooks as LifecycleHooks,
1415
ResumeTriggers as ResumeTriggers,
1516
LaunchParameters as LaunchParameters,

src/runloop_api_client/types/gateway_config_create_params.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66
from typing_extensions import Required, TypedDict
77

8+
from .shared_params.custom_header import CustomHeader
9+
810
__all__ = ["GatewayConfigCreateParams", "AuthMechanism"]
911

1012

@@ -24,6 +26,12 @@ class GatewayConfigCreateParams(TypedDict, total=False):
2426
Must be unique within your account.
2527
"""
2628

29+
custom_headers: Optional[Iterable[CustomHeader]]
30+
"""Additional headers applied to proxied requests after the auth mechanism.
31+
32+
At most 8 entries.
33+
"""
34+
2735
description: Optional[str]
2836
"""Optional description for this gateway configuration."""
2937

src/runloop_api_client/types/gateway_config_update_params.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66
from typing_extensions import Required, TypedDict
77

8+
from .shared_params.custom_header import CustomHeader
9+
810
__all__ = ["GatewayConfigUpdateParams", "AuthMechanism"]
911

1012

@@ -15,6 +17,13 @@ class GatewayConfigUpdateParams(TypedDict, total=False):
1517
gateway.
1618
"""
1719

20+
custom_headers: Optional[Iterable[CustomHeader]]
21+
"""New list of additional headers.
22+
23+
Replaces the existing list entirely; use an empty list to clear all custom
24+
headers. At most 8 entries.
25+
"""
26+
1827
description: Optional[str]
1928
"""New description for this gateway configuration."""
2029

src/runloop_api_client/types/gateway_config_view.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import List, Optional
44

55
from .._models import BaseModel
6+
from .shared.custom_header import CustomHeader
67

78
__all__ = ["GatewayConfigView", "AuthMechanism"]
89

@@ -47,5 +48,12 @@ class GatewayConfigView(BaseModel):
4748
account_id: Optional[str] = None
4849
"""The account ID that owns this config."""
4950

51+
custom_headers: Optional[List[CustomHeader]] = None
52+
"""Additional headers applied to proxied requests after the auth mechanism.
53+
54+
Secret-backed entries reference the secret by 'sec\\__' id; values are never
55+
returned.
56+
"""
57+
5058
description: Optional[str] = None
5159
"""Optional description for this gateway configuration."""

src/runloop_api_client/types/mcp_config_create_params.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66
from typing_extensions import Required, TypedDict
77

88
from .._types import SequenceNotStr
9+
from .shared_params.custom_header import CustomHeader
910

1011
__all__ = ["McpConfigCreateParams"]
1112

@@ -29,5 +30,11 @@ class McpConfigCreateParams(TypedDict, total=False):
2930
service name).
3031
"""
3132

33+
custom_headers: Optional[Iterable[CustomHeader]]
34+
"""Additional headers applied to upstream requests after the credential.
35+
36+
At most 8 entries.
37+
"""
38+
3239
description: Optional[str]
3340
"""Optional description for this MCP configuration."""

src/runloop_api_client/types/mcp_config_update_params.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66
from typing_extensions import TypedDict
77

88
from .._types import SequenceNotStr
9+
from .shared_params.custom_header import CustomHeader
910

1011
__all__ = ["McpConfigUpdateParams"]
1112

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

21+
custom_headers: Optional[Iterable[CustomHeader]]
22+
"""New list of additional headers.
23+
24+
Replaces the existing list entirely; use an empty list to clear all custom
25+
headers. At most 8 entries.
26+
"""
27+
2028
description: Optional[str]
2129
"""New description for this MCP configuration."""
2230

0 commit comments

Comments
 (0)