Skip to content

Commit 4972ea1

Browse files
feat: adding MCP Config routes (#7331)
1 parent ed48249 commit 4972ea1

11 files changed

Lines changed: 555 additions & 161 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 113
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-37187e72e61b850045924e6cb40207159ab794114add75a2bf36c87915326306.yml
3-
openapi_spec_hash: 33510c114bef0847855cdaf8f55c0774
4-
config_hash: 9f86425631c30497276e58b744dd3654
1+
configured_endpoints: 116
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb90951855ef91c431a7b07ea6a42c1c470c1a0c905e19e4926b48e8039bf4cb.yml
3+
openapi_spec_hash: e98232f95d6fd27f1200e354cee0059a
4+
config_hash: eb28692edd68a6ae95cf92af931c9976

api.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,15 @@ Methods:
263263

264264
Types:
265265

266-
- <code><a href="./src/resources/scenarios/scorers.ts">ScorerCreateResponse</a></code>
267266
- <code><a href="./src/resources/scenarios/scorers.ts">ScorerRetrieveResponse</a></code>
268267
- <code><a href="./src/resources/scenarios/scorers.ts">ScorerUpdateResponse</a></code>
269268
- <code><a href="./src/resources/scenarios/scorers.ts">ScorerListResponse</a></code>
270-
- <code><a href="./src/resources/scenarios/scorers.ts">ScorerValidateResponse</a></code>
271269

272270
Methods:
273271

274-
- <code title="post /v1/scenarios/scorers">client.scenarios.scorers.<a href="./src/resources/scenarios/scorers.ts">create</a>({ ...params }) -> ScorerCreateResponse</code>
275272
- <code title="get /v1/scenarios/scorers/{id}">client.scenarios.scorers.<a href="./src/resources/scenarios/scorers.ts">retrieve</a>(id) -> ScorerRetrieveResponse</code>
276273
- <code title="post /v1/scenarios/scorers/{id}">client.scenarios.scorers.<a href="./src/resources/scenarios/scorers.ts">update</a>(id, { ...params }) -> ScorerUpdateResponse</code>
277274
- <code title="get /v1/scenarios/scorers">client.scenarios.scorers.<a href="./src/resources/scenarios/scorers.ts">list</a>({ ...params }) -> ScorerListResponsesScenarioScorersCursorIDPage</code>
278-
- <code title="post /v1/scenarios/scorers/{id}/validate">client.scenarios.scorers.<a href="./src/resources/scenarios/scorers.ts">validate</a>(id, { ...params }) -> ScorerValidateResponse</code>
279275

280276
# Objects
281277

@@ -368,3 +364,20 @@ Methods:
368364
- <code title="post /v1/gateway-configs/{id}">client.gatewayConfigs.<a href="./src/resources/gateway-configs.ts">update</a>(id, { ...params }) -> GatewayConfigView</code>
369365
- <code title="get /v1/gateway-configs">client.gatewayConfigs.<a href="./src/resources/gateway-configs.ts">list</a>({ ...params }) -> GatewayConfigViewsGatewayConfigsCursorIDPage</code>
370366
- <code title="post /v1/gateway-configs/{id}/delete">client.gatewayConfigs.<a href="./src/resources/gateway-configs.ts">delete</a>(id) -> GatewayConfigView</code>
367+
368+
# McpConfigs
369+
370+
Types:
371+
372+
- <code><a href="./src/resources/mcp-configs.ts">McpConfigCreateParameters</a></code>
373+
- <code><a href="./src/resources/mcp-configs.ts">McpConfigListView</a></code>
374+
- <code><a href="./src/resources/mcp-configs.ts">McpConfigUpdateParameters</a></code>
375+
- <code><a href="./src/resources/mcp-configs.ts">McpConfigView</a></code>
376+
377+
Methods:
378+
379+
- <code title="post /v1/mcp-configs">client.mcpConfigs.<a href="./src/resources/mcp-configs.ts">create</a>({ ...params }) -> McpConfigView</code>
380+
- <code title="get /v1/mcp-configs/{id}">client.mcpConfigs.<a href="./src/resources/mcp-configs.ts">retrieve</a>(id) -> McpConfigView</code>
381+
- <code title="post /v1/mcp-configs/{id}">client.mcpConfigs.<a href="./src/resources/mcp-configs.ts">update</a>(id, { ...params }) -> McpConfigView</code>
382+
- <code title="get /v1/mcp-configs">client.mcpConfigs.<a href="./src/resources/mcp-configs.ts">list</a>({ ...params }) -> McpConfigViewsMcpConfigsCursorIDPage</code>
383+
- <code title="post /v1/mcp-configs/{id}/delete">client.mcpConfigs.<a href="./src/resources/mcp-configs.ts">delete</a>(id) -> McpConfigView</code>

src/index.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
DiskSnapshotsCursorIDPageResponse,
2020
type GatewayConfigsCursorIDPageParams,
2121
GatewayConfigsCursorIDPageResponse,
22+
type McpConfigsCursorIDPageParams,
23+
McpConfigsCursorIDPageResponse,
2224
type NetworkPoliciesCursorIDPageParams,
2325
NetworkPoliciesCursorIDPageResponse,
2426
type ObjectsCursorIDPageParams,
@@ -106,6 +108,18 @@ import {
106108
GatewayConfigViewsGatewayConfigsCursorIDPage,
107109
GatewayConfigs,
108110
} from './resources/gateway-configs';
111+
import {
112+
McpConfigCreateParameters,
113+
McpConfigCreateParams,
114+
McpConfigDeleteParams,
115+
McpConfigListParams,
116+
McpConfigListView,
117+
McpConfigUpdateParameters,
118+
McpConfigUpdateParams,
119+
McpConfigView,
120+
McpConfigViewsMcpConfigsCursorIDPage,
121+
McpConfigs,
122+
} from './resources/mcp-configs';
109123
import {
110124
NetworkPolicies,
111125
NetworkPolicyCreateParameters,
@@ -359,6 +373,7 @@ export class Runloop extends Core.APIClient {
359373
secrets: API.Secrets = new API.Secrets(this);
360374
networkPolicies: API.NetworkPolicies = new API.NetworkPolicies(this);
361375
gatewayConfigs: API.GatewayConfigs = new API.GatewayConfigs(this);
376+
mcpConfigs: API.McpConfigs = new API.McpConfigs(this);
362377

363378
/**
364379
* Check whether the base URL is set to its default.
@@ -426,6 +441,8 @@ Runloop.NetworkPolicies = NetworkPolicies;
426441
Runloop.NetworkPolicyViewsNetworkPoliciesCursorIDPage = NetworkPolicyViewsNetworkPoliciesCursorIDPage;
427442
Runloop.GatewayConfigs = GatewayConfigs;
428443
Runloop.GatewayConfigViewsGatewayConfigsCursorIDPage = GatewayConfigViewsGatewayConfigsCursorIDPage;
444+
Runloop.McpConfigs = McpConfigs;
445+
Runloop.McpConfigViewsMcpConfigsCursorIDPage = McpConfigViewsMcpConfigsCursorIDPage;
429446

430447
export declare namespace Runloop {
431448
export type RequestOptions = Core.RequestOptions;
@@ -508,6 +525,12 @@ export declare namespace Runloop {
508525
type GatewayConfigsCursorIDPageResponse as GatewayConfigsCursorIDPageResponse,
509526
};
510527

528+
export import McpConfigsCursorIDPage = Pagination.McpConfigsCursorIDPage;
529+
export {
530+
type McpConfigsCursorIDPageParams as McpConfigsCursorIDPageParams,
531+
type McpConfigsCursorIDPageResponse as McpConfigsCursorIDPageResponse,
532+
};
533+
511534
export {
512535
Benchmarks as Benchmarks,
513536
type BenchmarkCreateParameters as BenchmarkCreateParameters,
@@ -708,6 +731,19 @@ export declare namespace Runloop {
708731
type GatewayConfigDeleteParams as GatewayConfigDeleteParams,
709732
};
710733

734+
export {
735+
McpConfigs as McpConfigs,
736+
type McpConfigCreateParameters as McpConfigCreateParameters,
737+
type McpConfigListView as McpConfigListView,
738+
type McpConfigUpdateParameters as McpConfigUpdateParameters,
739+
type McpConfigView as McpConfigView,
740+
McpConfigViewsMcpConfigsCursorIDPage as McpConfigViewsMcpConfigsCursorIDPage,
741+
type McpConfigCreateParams as McpConfigCreateParams,
742+
type McpConfigUpdateParams as McpConfigUpdateParams,
743+
type McpConfigListParams as McpConfigListParams,
744+
type McpConfigDeleteParams as McpConfigDeleteParams,
745+
};
746+
711747
export type AfterIdle = API.AfterIdle;
712748
export type AgentMount = API.AgentMount;
713749
export type AgentSource = API.AgentSource;

src/pagination.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,3 +963,77 @@ export class GatewayConfigsCursorIDPage<Item extends { id: string }>
963963
return { params: { starting_after: id } };
964964
}
965965
}
966+
967+
export interface McpConfigsCursorIDPageResponse<Item> {
968+
mcp_configs: Array<Item>;
969+
970+
has_more: boolean;
971+
972+
total_count: number;
973+
}
974+
975+
export interface McpConfigsCursorIDPageParams {
976+
starting_after?: string;
977+
978+
limit?: number;
979+
}
980+
981+
export class McpConfigsCursorIDPage<Item extends { id: string }>
982+
extends AbstractPage<Item>
983+
implements McpConfigsCursorIDPageResponse<Item>
984+
{
985+
mcp_configs: Array<Item>;
986+
987+
has_more: boolean;
988+
989+
total_count: number;
990+
991+
constructor(
992+
client: APIClient,
993+
response: Response,
994+
body: McpConfigsCursorIDPageResponse<Item>,
995+
options: FinalRequestOptions,
996+
) {
997+
super(client, response, body, options);
998+
999+
this.mcp_configs = body.mcp_configs || [];
1000+
this.has_more = body.has_more || false;
1001+
this.total_count = body.total_count || 0;
1002+
}
1003+
1004+
getPaginatedItems(): Item[] {
1005+
return this.mcp_configs ?? [];
1006+
}
1007+
1008+
override hasNextPage(): boolean {
1009+
if (this.has_more === false) {
1010+
return false;
1011+
}
1012+
1013+
return super.hasNextPage();
1014+
}
1015+
1016+
// @deprecated Please use `nextPageInfo()` instead
1017+
nextPageParams(): Partial<McpConfigsCursorIDPageParams> | null {
1018+
const info = this.nextPageInfo();
1019+
if (!info) return null;
1020+
if ('params' in info) return info.params;
1021+
const params = Object.fromEntries(info.url.searchParams);
1022+
if (!Object.keys(params).length) return null;
1023+
return params;
1024+
}
1025+
1026+
nextPageInfo(): PageInfo | null {
1027+
const mcpConfigs = this.getPaginatedItems();
1028+
if (!mcpConfigs.length) {
1029+
return null;
1030+
}
1031+
1032+
const id = mcpConfigs[mcpConfigs.length - 1]?.id;
1033+
if (!id) {
1034+
return null;
1035+
}
1036+
1037+
return { params: { starting_after: id } };
1038+
}
1039+
}

src/resources/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ export {
113113
type GatewayConfigListParams,
114114
type GatewayConfigDeleteParams,
115115
} from './gateway-configs';
116+
export {
117+
McpConfigViewsMcpConfigsCursorIDPage,
118+
McpConfigs,
119+
type McpConfigCreateParameters,
120+
type McpConfigListView,
121+
type McpConfigUpdateParameters,
122+
type McpConfigView,
123+
type McpConfigCreateParams,
124+
type McpConfigUpdateParams,
125+
type McpConfigListParams,
126+
type McpConfigDeleteParams,
127+
} from './mcp-configs';
116128
export {
117129
NetworkPolicyViewsNetworkPoliciesCursorIDPage,
118130
NetworkPolicies,

0 commit comments

Comments
 (0)