-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmcp-configs.ts
More file actions
280 lines (241 loc) · 7.63 KB
/
Copy pathmcp-configs.ts
File metadata and controls
280 lines (241 loc) · 7.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import { McpConfigsCursorIDPage, type McpConfigsCursorIDPageParams } from '../pagination';
export class McpConfigs extends APIResource {
/**
* [Beta] Create a new McpConfig to connect to an upstream MCP (Model Context
* Protocol) server. The config specifies the target endpoint and which tools are
* allowed.
*/
create(body: McpConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise<McpConfigView> {
return this._client.post('/v1/mcp-configs', { body, ...options });
}
/**
* [Beta] Get a specific McpConfig by its unique identifier.
*/
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<McpConfigView> {
return this._client.get(`/v1/mcp-configs/${id}`, options);
}
/**
* [Beta] Update an existing McpConfig. All fields are optional.
*/
update(
id: string,
body?: McpConfigUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<McpConfigView>;
update(id: string, options?: Core.RequestOptions): Core.APIPromise<McpConfigView>;
update(
id: string,
body: McpConfigUpdateParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<McpConfigView> {
if (isRequestOptions(body)) {
return this.update(id, {}, body);
}
return this._client.post(`/v1/mcp-configs/${id}`, { body, ...options });
}
/**
* [Beta] List all McpConfigs for the authenticated account.
*/
list(
query?: McpConfigListParams,
options?: Core.RequestOptions,
): Core.PagePromise<McpConfigViewsMcpConfigsCursorIDPage, McpConfigView>;
list(options?: Core.RequestOptions): Core.PagePromise<McpConfigViewsMcpConfigsCursorIDPage, McpConfigView>;
list(
query: McpConfigListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<McpConfigViewsMcpConfigsCursorIDPage, McpConfigView> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v1/mcp-configs', McpConfigViewsMcpConfigsCursorIDPage, {
query,
...options,
});
}
/**
* [Beta] Delete an existing McpConfig. This action is irreversible.
*/
delete(
id: string,
body?: McpConfigDeleteParams | null | undefined,
options?: Core.RequestOptions,
): Core.APIPromise<McpConfigView> {
return this._client.post(`/v1/mcp-configs/${id}/delete`, { body, ...options });
}
}
export class McpConfigViewsMcpConfigsCursorIDPage extends McpConfigsCursorIDPage<McpConfigView> {}
/**
* Parameters required to create a new McpConfig.
*/
export interface McpConfigCreateParameters {
/**
* Glob patterns specifying which tools are allowed from this MCP server. Examples:
* ['*'] for all tools, ['github.search_*', 'github.get_*'] for specific patterns.
*/
allowed_tools: Array<string>;
/**
* The target MCP server endpoint URL (e.g., 'https://mcp.example.com').
*/
endpoint: string;
/**
* The human-readable name for the McpConfig. Must be unique within your account.
* The first segment before '-' is used as the service name for tool routing (e.g.,
* 'github-readonly' uses 'github' as the service name).
*/
name: string;
/**
* Optional description for this MCP configuration.
*/
description?: string | null;
}
/**
* A paginated list of McpConfigs.
*/
export interface McpConfigListView {
/**
* Whether there are more results available beyond this page.
*/
has_more: boolean;
/**
* The list of McpConfigs.
*/
mcp_configs: Array<McpConfigView>;
/**
* Total count of McpConfigs that match the query.
*/
total_count?: number | null;
}
/**
* Parameters for updating an existing McpConfig. All fields are optional - only
* specified fields will be updated.
*/
export interface McpConfigUpdateParameters {
/**
* New glob patterns specifying which tools are allowed. Examples: ['*'] for all
* tools, ['github.search_*'] for specific patterns.
*/
allowed_tools?: Array<string> | null;
/**
* New description for this MCP configuration.
*/
description?: string | null;
/**
* New target MCP server endpoint URL.
*/
endpoint?: string | null;
/**
* New name for the McpConfig. Must be unique within your account.
*/
name?: string | null;
}
/**
* An McpConfig defines a configuration for connecting to an upstream MCP (Model
* Context Protocol) server. It specifies the target endpoint and which tools are
* allowed.
*/
export interface McpConfigView {
/**
* The unique identifier of the McpConfig.
*/
id: string;
/**
* Glob patterns specifying which tools are allowed from this MCP server (e.g.,
* ['github.search_*', 'github.get_*'] or ['*'] for all tools).
*/
allowed_tools: Array<string>;
/**
* Creation time of the McpConfig (Unix timestamp in milliseconds).
*/
create_time_ms: number;
/**
* The target MCP server endpoint URL (e.g., 'https://mcp.example.com').
*/
endpoint: string;
/**
* The human-readable name of the McpConfig. Unique per account.
*/
name: string;
/**
* Optional description for this MCP configuration.
*/
description?: string | null;
}
export interface McpConfigCreateParams {
/**
* Glob patterns specifying which tools are allowed from this MCP server. Examples:
* ['*'] for all tools, ['github.search_*', 'github.get_*'] for specific patterns.
*/
allowed_tools: Array<string>;
/**
* The target MCP server endpoint URL (e.g., 'https://mcp.example.com').
*/
endpoint: string;
/**
* The human-readable name for the McpConfig. Must be unique within your account.
* The first segment before '-' is used as the service name for tool routing (e.g.,
* 'github-readonly' uses 'github' as the service name).
*/
name: string;
/**
* Optional description for this MCP configuration.
*/
description?: string | null;
}
export interface McpConfigUpdateParams {
/**
* New glob patterns specifying which tools are allowed. Examples: ['*'] for all
* tools, ['github.search_*'] for specific patterns.
*/
allowed_tools?: Array<string> | null;
/**
* New description for this MCP configuration.
*/
description?: string | null;
/**
* New target MCP server endpoint URL.
*/
endpoint?: string | null;
/**
* New name for the McpConfig. Must be unique within your account.
*/
name?: string | null;
}
export interface McpConfigListParams extends McpConfigsCursorIDPageParams {
/**
* Filter by ID.
*/
id?: string;
/**
* If true (default), includes total_count in the response. Set to false to skip
* the count query for better performance on large datasets.
*/
include_total_count?: boolean;
/**
* Filter by name (prefix match supported).
*/
name?: string;
/**
* Search by MCP config ID or name.
*/
search?: string;
}
export interface McpConfigDeleteParams {}
McpConfigs.McpConfigViewsMcpConfigsCursorIDPage = McpConfigViewsMcpConfigsCursorIDPage;
export declare namespace McpConfigs {
export {
type McpConfigCreateParameters as McpConfigCreateParameters,
type McpConfigListView as McpConfigListView,
type McpConfigUpdateParameters as McpConfigUpdateParameters,
type McpConfigView as McpConfigView,
McpConfigViewsMcpConfigsCursorIDPage as McpConfigViewsMcpConfigsCursorIDPage,
type McpConfigCreateParams as McpConfigCreateParams,
type McpConfigUpdateParams as McpConfigUpdateParams,
type McpConfigListParams as McpConfigListParams,
type McpConfigDeleteParams as McpConfigDeleteParams,
};
}