@executor-js/plugin-mcp 0.1.0 → 1.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddMcpSource-TLAL463B.js +762 -0
- package/dist/AddMcpSource-TLAL463B.js.map +1 -0
- package/dist/EditMcpSource-CWN6HIC4.js +259 -0
- package/dist/EditMcpSource-CWN6HIC4.js.map +1 -0
- package/dist/McpSourceSummary-257JNETP.js +85 -0
- package/dist/McpSourceSummary-257JNETP.js.map +1 -0
- package/dist/api/group.d.ts +183 -19
- package/dist/api/index.d.ts +501 -0
- package/dist/chunk-4ORPFRLI.js +238 -0
- package/dist/chunk-4ORPFRLI.js.map +1 -0
- package/dist/chunk-M6REVU6O.js +179 -0
- package/dist/chunk-M6REVU6O.js.map +1 -0
- package/dist/chunk-NQT7NAGE.js +2277 -0
- package/dist/chunk-NQT7NAGE.js.map +1 -0
- package/dist/chunk-SKSXXFOA.js +104 -0
- package/dist/chunk-SKSXXFOA.js.map +1 -0
- package/dist/chunk-ZIRGIRGP.js +115 -0
- package/dist/chunk-ZIRGIRGP.js.map +1 -0
- package/dist/client.js +51 -0
- package/dist/client.js.map +1 -0
- package/dist/core.js +26 -2
- package/dist/index.js +2 -1
- package/dist/react/McpRemoteSourceFields.d.ts +18 -0
- package/dist/react/McpSourceSummary.d.ts +5 -0
- package/dist/react/atoms.d.ts +286 -6
- package/dist/react/client.d.ts +187 -16
- package/dist/react/index.d.ts +1 -1
- package/dist/react/plugin-client.d.ts +9 -2
- package/dist/sdk/binding-store.d.ts +106 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/invoke.d.ts +2 -0
- package/dist/sdk/plugin.d.ts +178 -114
- package/dist/sdk/probe-shape-real-servers.live.test.d.ts +1 -0
- package/dist/sdk/probe-shape.d.ts +17 -3
- package/dist/sdk/stored-source.d.ts +12 -11
- package/dist/sdk/types.d.ts +122 -17
- package/dist/{stdio-connector-KNHLETKM.js → stdio-connector-AA5S6UUJ.js} +1 -1
- package/dist/{stdio-connector-KNHLETKM.js.map → stdio-connector-AA5S6UUJ.js.map} +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/{sdk/test-utils.d.ts → testing/server.d.ts} +0 -6
- package/dist/testing.js +51 -0
- package/dist/testing.js.map +1 -0
- package/package.json +17 -4
- package/dist/chunk-C2GNZGFJ.js +0 -1622
- package/dist/chunk-C2GNZGFJ.js.map +0 -1
package/dist/sdk/plugin.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import type { HttpClient } from "effect/unstable/http";
|
|
3
3
|
import { type StorageFailure } from "@executor-js/sdk/core";
|
|
4
4
|
import { type McpBindingStore, type McpStoredSource } from "./binding-store";
|
|
5
5
|
import { McpConnectionError, McpToolDiscoveryError } from "./errors";
|
|
6
|
-
import { type
|
|
6
|
+
import { type McpShapeProbeResult } from "./probe-shape";
|
|
7
|
+
import { McpSourceBindingInput, McpSourceBindingRef, type McpConnectionAuthInput, type McpCredentialInput, type SecretBackedValue } from "./types";
|
|
7
8
|
import { type ConfigFileSink } from "@executor-js/config";
|
|
8
9
|
/**
|
|
9
10
|
* Executor scope id that owns a newly-added MCP source row. Must be one
|
|
@@ -19,10 +20,15 @@ export interface McpRemoteSourceConfig extends McpSourceScopeField {
|
|
|
19
20
|
readonly name: string;
|
|
20
21
|
readonly endpoint: string;
|
|
21
22
|
readonly remoteTransport?: "streamable-http" | "sse" | "auto";
|
|
22
|
-
readonly queryParams?: Record<string,
|
|
23
|
-
readonly headers?: Record<string,
|
|
23
|
+
readonly queryParams?: Record<string, McpCredentialInput>;
|
|
24
|
+
readonly headers?: Record<string, McpCredentialInput>;
|
|
24
25
|
readonly namespace?: string;
|
|
25
|
-
readonly auth?:
|
|
26
|
+
readonly auth?: McpConnectionAuthInput;
|
|
27
|
+
/**
|
|
28
|
+
* Scope that owns any direct credentials supplied on this call. Required
|
|
29
|
+
* whenever headers/queryParams/auth carry direct secret or connection ids.
|
|
30
|
+
*/
|
|
31
|
+
readonly credentialTargetScope?: string;
|
|
26
32
|
}
|
|
27
33
|
export interface McpStdioSourceConfig extends McpSourceScopeField {
|
|
28
34
|
readonly transport: "stdio";
|
|
@@ -37,6 +43,7 @@ export type McpSourceConfig = McpRemoteSourceConfig | McpStdioSourceConfig;
|
|
|
37
43
|
export interface McpProbeResult {
|
|
38
44
|
readonly connected: boolean;
|
|
39
45
|
readonly requiresOAuth: boolean;
|
|
46
|
+
readonly supportsDynamicRegistration: boolean;
|
|
40
47
|
readonly name: string;
|
|
41
48
|
readonly namespace: string;
|
|
42
49
|
readonly toolCount: number | null;
|
|
@@ -45,15 +52,25 @@ export interface McpProbeResult {
|
|
|
45
52
|
export interface McpUpdateSourceInput {
|
|
46
53
|
readonly name?: string;
|
|
47
54
|
readonly endpoint?: string;
|
|
48
|
-
readonly headers?: Record<string,
|
|
49
|
-
readonly queryParams?: Record<string,
|
|
50
|
-
readonly
|
|
55
|
+
readonly headers?: Record<string, McpCredentialInput>;
|
|
56
|
+
readonly queryParams?: Record<string, McpCredentialInput>;
|
|
57
|
+
readonly credentialTargetScope?: string;
|
|
58
|
+
readonly auth?: McpConnectionAuthInput;
|
|
51
59
|
}
|
|
52
60
|
export interface McpProbeEndpointInput {
|
|
53
61
|
readonly endpoint: string;
|
|
54
62
|
readonly headers?: Record<string, SecretBackedValue>;
|
|
55
63
|
readonly queryParams?: Record<string, SecretBackedValue>;
|
|
56
64
|
}
|
|
65
|
+
/** Translate a non-MCP probe outcome into a message a user can act on.
|
|
66
|
+
* The technical `reason` (`401 without Bearer WWW-Authenticate — not an
|
|
67
|
+
* MCP auth challenge`, etc.) stays in telemetry via the probe span; the
|
|
68
|
+
* user gets a sentence pointing at their next step. Exported for tests. */
|
|
69
|
+
export declare const userFacingProbeMessage: (shape: Extract<McpShapeProbeResult, {
|
|
70
|
+
kind: "not-mcp";
|
|
71
|
+
} | {
|
|
72
|
+
kind: "unreachable";
|
|
73
|
+
}>) => string;
|
|
57
74
|
export interface McpPluginOptions {
|
|
58
75
|
/**
|
|
59
76
|
* Allow configuring stdio-transport MCP sources. Off by default.
|
|
@@ -62,6 +79,7 @@ export interface McpPluginOptions {
|
|
|
62
79
|
* `process.env`. Only enable for trusted single-user contexts.
|
|
63
80
|
*/
|
|
64
81
|
readonly dangerouslyAllowStdioMCP?: boolean;
|
|
82
|
+
readonly httpClientLayer?: Layer.Layer<HttpClient.HttpClient>;
|
|
65
83
|
/** If provided, source add/remove is mirrored to executor.jsonc
|
|
66
84
|
* (best-effort — file errors are logged, not raised). */
|
|
67
85
|
readonly configFile?: ConfigFileSink;
|
|
@@ -70,6 +88,7 @@ export declare const mcpPlugin: import("@executor-js/sdk/core").ConfiguredPlugin
|
|
|
70
88
|
probeEndpoint: (input: string | McpProbeEndpointInput) => Effect.Effect<{
|
|
71
89
|
connected: true;
|
|
72
90
|
requiresOAuth: false;
|
|
91
|
+
supportsDynamicRegistration: false;
|
|
73
92
|
name: string;
|
|
74
93
|
namespace: string;
|
|
75
94
|
toolCount: number;
|
|
@@ -77,6 +96,7 @@ export declare const mcpPlugin: import("@executor-js/sdk/core").ConfiguredPlugin
|
|
|
77
96
|
} | {
|
|
78
97
|
connected: false;
|
|
79
98
|
requiresOAuth: true;
|
|
99
|
+
supportsDynamicRegistration: boolean;
|
|
80
100
|
name: string;
|
|
81
101
|
namespace: string;
|
|
82
102
|
toolCount: null;
|
|
@@ -91,7 +111,46 @@ export declare const mcpPlugin: import("@executor-js/sdk/core").ConfiguredPlugin
|
|
|
91
111
|
toolCount: number;
|
|
92
112
|
}, StorageFailure | McpConnectionError | McpToolDiscoveryError, never>;
|
|
93
113
|
getSource: (namespace: string, scope: string) => Effect.Effect<McpStoredSource | null, StorageFailure, never>;
|
|
94
|
-
updateSource: (namespace: string, scope: string, input: McpUpdateSourceInput) => Effect.Effect<void, StorageFailure, never>;
|
|
114
|
+
updateSource: (namespace: string, scope: string, input: McpUpdateSourceInput) => Effect.Effect<void, StorageFailure | McpConnectionError, never>;
|
|
115
|
+
listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly {
|
|
116
|
+
readonly value: {
|
|
117
|
+
readonly text: string;
|
|
118
|
+
readonly kind: "text";
|
|
119
|
+
} | {
|
|
120
|
+
readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
|
|
121
|
+
readonly kind: "secret";
|
|
122
|
+
readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
|
|
123
|
+
} | {
|
|
124
|
+
readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
|
|
125
|
+
readonly kind: "connection";
|
|
126
|
+
};
|
|
127
|
+
readonly createdAt: Date;
|
|
128
|
+
readonly sourceId: string;
|
|
129
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
130
|
+
readonly updatedAt: Date;
|
|
131
|
+
readonly slot: string;
|
|
132
|
+
readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
133
|
+
}[], StorageFailure, never>;
|
|
134
|
+
setSourceBinding: (input: McpSourceBindingInput) => Effect.Effect<{
|
|
135
|
+
readonly value: {
|
|
136
|
+
readonly text: string;
|
|
137
|
+
readonly kind: "text";
|
|
138
|
+
} | {
|
|
139
|
+
readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
|
|
140
|
+
readonly kind: "secret";
|
|
141
|
+
readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
|
|
142
|
+
} | {
|
|
143
|
+
readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
|
|
144
|
+
readonly kind: "connection";
|
|
145
|
+
};
|
|
146
|
+
readonly createdAt: Date;
|
|
147
|
+
readonly sourceId: string;
|
|
148
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
149
|
+
readonly updatedAt: Date;
|
|
150
|
+
readonly slot: string;
|
|
151
|
+
readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
152
|
+
}, StorageFailure, never>;
|
|
153
|
+
removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
|
|
95
154
|
}, McpBindingStore, McpPluginOptions, {
|
|
96
155
|
readonly mcp_source: {
|
|
97
156
|
readonly fields: {
|
|
@@ -112,12 +171,117 @@ export declare const mcpPlugin: import("@executor-js/sdk/core").ConfiguredPlugin
|
|
|
112
171
|
readonly type: "json";
|
|
113
172
|
readonly required: true;
|
|
114
173
|
};
|
|
174
|
+
readonly auth_kind: {
|
|
175
|
+
readonly type: ["none", "header", "oauth2"];
|
|
176
|
+
readonly required: true;
|
|
177
|
+
readonly defaultValue: "none";
|
|
178
|
+
};
|
|
179
|
+
readonly auth_header_name: {
|
|
180
|
+
readonly type: "string";
|
|
181
|
+
readonly required: false;
|
|
182
|
+
};
|
|
183
|
+
readonly auth_header_slot: {
|
|
184
|
+
readonly type: "string";
|
|
185
|
+
readonly required: false;
|
|
186
|
+
};
|
|
187
|
+
readonly auth_header_prefix: {
|
|
188
|
+
readonly type: "string";
|
|
189
|
+
readonly required: false;
|
|
190
|
+
};
|
|
191
|
+
readonly auth_connection_slot: {
|
|
192
|
+
readonly type: "string";
|
|
193
|
+
readonly required: false;
|
|
194
|
+
};
|
|
195
|
+
readonly auth_client_id_slot: {
|
|
196
|
+
readonly type: "string";
|
|
197
|
+
readonly required: false;
|
|
198
|
+
};
|
|
199
|
+
readonly auth_client_secret_slot: {
|
|
200
|
+
readonly type: "string";
|
|
201
|
+
readonly required: false;
|
|
202
|
+
};
|
|
115
203
|
readonly created_at: {
|
|
116
204
|
readonly type: "date";
|
|
117
205
|
readonly required: true;
|
|
118
206
|
};
|
|
119
207
|
};
|
|
120
208
|
};
|
|
209
|
+
readonly mcp_source_header: {
|
|
210
|
+
readonly fields: {
|
|
211
|
+
readonly id: {
|
|
212
|
+
readonly type: "string";
|
|
213
|
+
readonly required: true;
|
|
214
|
+
};
|
|
215
|
+
readonly scope_id: {
|
|
216
|
+
readonly type: "string";
|
|
217
|
+
readonly required: true;
|
|
218
|
+
readonly index: true;
|
|
219
|
+
};
|
|
220
|
+
readonly source_id: {
|
|
221
|
+
readonly type: "string";
|
|
222
|
+
readonly required: true;
|
|
223
|
+
readonly index: true;
|
|
224
|
+
};
|
|
225
|
+
readonly name: {
|
|
226
|
+
readonly type: "string";
|
|
227
|
+
readonly required: true;
|
|
228
|
+
};
|
|
229
|
+
readonly kind: {
|
|
230
|
+
readonly type: ["text", "binding"];
|
|
231
|
+
readonly required: true;
|
|
232
|
+
};
|
|
233
|
+
readonly text_value: {
|
|
234
|
+
readonly type: "string";
|
|
235
|
+
readonly required: false;
|
|
236
|
+
};
|
|
237
|
+
readonly slot_key: {
|
|
238
|
+
readonly type: "string";
|
|
239
|
+
readonly required: false;
|
|
240
|
+
};
|
|
241
|
+
readonly prefix: {
|
|
242
|
+
readonly type: "string";
|
|
243
|
+
readonly required: false;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
readonly mcp_source_query_param: {
|
|
248
|
+
readonly fields: {
|
|
249
|
+
readonly id: {
|
|
250
|
+
readonly type: "string";
|
|
251
|
+
readonly required: true;
|
|
252
|
+
};
|
|
253
|
+
readonly scope_id: {
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
readonly required: true;
|
|
256
|
+
readonly index: true;
|
|
257
|
+
};
|
|
258
|
+
readonly source_id: {
|
|
259
|
+
readonly type: "string";
|
|
260
|
+
readonly required: true;
|
|
261
|
+
readonly index: true;
|
|
262
|
+
};
|
|
263
|
+
readonly name: {
|
|
264
|
+
readonly type: "string";
|
|
265
|
+
readonly required: true;
|
|
266
|
+
};
|
|
267
|
+
readonly kind: {
|
|
268
|
+
readonly type: ["text", "binding"];
|
|
269
|
+
readonly required: true;
|
|
270
|
+
};
|
|
271
|
+
readonly text_value: {
|
|
272
|
+
readonly type: "string";
|
|
273
|
+
readonly required: false;
|
|
274
|
+
};
|
|
275
|
+
readonly slot_key: {
|
|
276
|
+
readonly type: "string";
|
|
277
|
+
readonly required: false;
|
|
278
|
+
};
|
|
279
|
+
readonly prefix: {
|
|
280
|
+
readonly type: "string";
|
|
281
|
+
readonly required: false;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
};
|
|
121
285
|
readonly mcp_binding: {
|
|
122
286
|
readonly fields: {
|
|
123
287
|
readonly id: {
|
|
@@ -144,110 +308,7 @@ export declare const mcpPlugin: import("@executor-js/sdk/core").ConfiguredPlugin
|
|
|
144
308
|
};
|
|
145
309
|
};
|
|
146
310
|
};
|
|
147
|
-
},
|
|
148
|
-
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
149
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
150
|
-
readonly endpoint: import("effect/Schema").String;
|
|
151
|
-
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
152
|
-
readonly secretId: import("effect/Schema").String;
|
|
153
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
154
|
-
}>]>>>;
|
|
155
|
-
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
156
|
-
readonly secretId: import("effect/Schema").String;
|
|
157
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
158
|
-
}>]>>>;
|
|
159
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
160
|
-
readonly connected: import("effect/Schema").Boolean;
|
|
161
|
-
readonly requiresOAuth: import("effect/Schema").Boolean;
|
|
162
|
-
readonly name: import("effect/Schema").String;
|
|
163
|
-
readonly namespace: import("effect/Schema").String;
|
|
164
|
-
readonly toolCount: import("effect/Schema").NullOr<import("effect/Schema").Number>;
|
|
165
|
-
readonly serverName: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
166
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"addSource", "POST", "/scopes/:scopeId/mcp/sources", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
167
|
-
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
168
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
169
|
-
readonly transport: import("effect/Schema").Literal<"remote">;
|
|
170
|
-
readonly name: import("effect/Schema").String;
|
|
171
|
-
readonly endpoint: import("effect/Schema").String;
|
|
172
|
-
readonly remoteTransport: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["streamable-http", "sse", "auto"]>>;
|
|
173
|
-
readonly namespace: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
174
|
-
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
175
|
-
readonly secretId: import("effect/Schema").String;
|
|
176
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
177
|
-
}>]>>>;
|
|
178
|
-
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
179
|
-
readonly secretId: import("effect/Schema").String;
|
|
180
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
181
|
-
}>]>>>;
|
|
182
|
-
readonly auth: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
183
|
-
readonly kind: import("effect/Schema").Literal<"none">;
|
|
184
|
-
}>, import("effect/Schema").Struct<{
|
|
185
|
-
readonly kind: import("effect/Schema").Literal<"header">;
|
|
186
|
-
readonly headerName: import("effect/Schema").String;
|
|
187
|
-
readonly secretId: import("effect/Schema").String;
|
|
188
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
189
|
-
}>, import("effect/Schema").Struct<{
|
|
190
|
-
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
191
|
-
readonly connectionId: import("effect/Schema").String;
|
|
192
|
-
readonly clientIdSecretId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
193
|
-
readonly clientSecretSecretId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
194
|
-
}>]>>;
|
|
195
|
-
}>, import("effect/Schema").Struct<{
|
|
196
|
-
readonly transport: import("effect/Schema").Literal<"stdio">;
|
|
197
|
-
readonly name: import("effect/Schema").String;
|
|
198
|
-
readonly command: import("effect/Schema").String;
|
|
199
|
-
readonly args: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
200
|
-
readonly env: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
201
|
-
readonly cwd: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
202
|
-
readonly namespace: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
203
|
-
}>]>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
204
|
-
readonly toolCount: import("effect/Schema").Number;
|
|
205
|
-
readonly namespace: import("effect/Schema").String;
|
|
206
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"removeSource", "POST", "/scopes/:scopeId/mcp/sources/remove", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
207
|
-
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
208
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
209
|
-
readonly namespace: import("effect/Schema").String;
|
|
210
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
211
|
-
readonly removed: import("effect/Schema").Boolean;
|
|
212
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"refreshSource", "POST", "/scopes/:scopeId/mcp/sources/refresh", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
213
|
-
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
214
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
215
|
-
readonly namespace: import("effect/Schema").String;
|
|
216
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
217
|
-
readonly toolCount: import("effect/Schema").Number;
|
|
218
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSource", "GET", "/scopes/:scopeId/mcp/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
219
|
-
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
220
|
-
namespace: import("effect/Schema").String;
|
|
221
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<typeof import("./stored-source").McpStoredSourceSchema>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateSource", "PATCH", "/scopes/:scopeId/mcp/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
222
|
-
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
223
|
-
namespace: import("effect/Schema").String;
|
|
224
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
225
|
-
readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
226
|
-
readonly endpoint: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
227
|
-
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
228
|
-
readonly secretId: import("effect/Schema").String;
|
|
229
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
230
|
-
}>]>>>;
|
|
231
|
-
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
232
|
-
readonly secretId: import("effect/Schema").String;
|
|
233
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
234
|
-
}>]>>>;
|
|
235
|
-
readonly auth: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
236
|
-
readonly kind: import("effect/Schema").Literal<"none">;
|
|
237
|
-
}>, import("effect/Schema").Struct<{
|
|
238
|
-
readonly kind: import("effect/Schema").Literal<"header">;
|
|
239
|
-
readonly headerName: import("effect/Schema").String;
|
|
240
|
-
readonly secretId: import("effect/Schema").String;
|
|
241
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
242
|
-
}>, import("effect/Schema").Struct<{
|
|
243
|
-
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
244
|
-
readonly connectionId: import("effect/Schema").String;
|
|
245
|
-
readonly clientIdSecretId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
246
|
-
readonly clientSecretSecretId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
247
|
-
}>]>>;
|
|
248
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
249
|
-
readonly updated: import("effect/Schema").Boolean;
|
|
250
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never>, false>>;
|
|
311
|
+
}, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
|
|
251
312
|
/**
|
|
252
313
|
* Errors any MCP extension method may surface. The first four are
|
|
253
314
|
* plugin-domain tagged errors that flow directly to clients (4xx, each
|
|
@@ -271,5 +332,8 @@ export interface McpPluginExtension {
|
|
|
271
332
|
}, McpExtensionFailure>;
|
|
272
333
|
readonly getSource: (namespace: string, scope: string) => Effect.Effect<McpStoredSource | null, McpExtensionFailure>;
|
|
273
334
|
readonly updateSource: (namespace: string, scope: string, input: McpUpdateSourceInput) => Effect.Effect<void, McpExtensionFailure>;
|
|
335
|
+
readonly listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly McpSourceBindingRef[], StorageFailure>;
|
|
336
|
+
readonly setSourceBinding: (input: McpSourceBindingInput) => Effect.Effect<McpSourceBindingRef, StorageFailure>;
|
|
337
|
+
readonly removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => Effect.Effect<void, StorageFailure>;
|
|
274
338
|
}
|
|
275
339
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import { HttpClient } from "effect/unstable/http";
|
|
3
|
+
/** Why the probe rejected an endpoint as not-MCP.
|
|
4
|
+
*
|
|
5
|
+
* - `auth-required` — server returned 401. We don't know for sure it's
|
|
6
|
+
* an MCP server (no spec-compliant Bearer challenge or the body
|
|
7
|
+
* isn't JSON-RPC), but the right next step for the user is the same
|
|
8
|
+
* either way: provide credentials and retry. This is what
|
|
9
|
+
* misclassifies real MCP servers like cubic.dev (no
|
|
10
|
+
* resource_metadata) or ref.tools (no WWW-Authenticate at all)
|
|
11
|
+
* without the URL-token fallback at the detect layer.
|
|
12
|
+
* - `wrong-shape` — endpoint responded but with a body or status that
|
|
13
|
+
* doesn't match any MCP shape (200 HTML, 400 GraphQL, 404 from a
|
|
14
|
+
* static host, etc.). User action: this URL probably isn't MCP. */
|
|
15
|
+
export type McpProbeRejectCategory = "auth-required" | "wrong-shape";
|
|
2
16
|
export type McpShapeProbeResult =
|
|
3
17
|
/** Server answered initialize successfully — either a 2xx with a
|
|
4
18
|
* JSON-RPC payload, or a 401 + WWW-Authenticate: Bearer (RFC 6750
|
|
@@ -11,6 +25,7 @@ export type McpShapeProbeResult =
|
|
|
11
25
|
| {
|
|
12
26
|
readonly kind: "not-mcp";
|
|
13
27
|
readonly reason: string;
|
|
28
|
+
readonly category: McpProbeRejectCategory;
|
|
14
29
|
}
|
|
15
30
|
/** Transport-level failure (DNS, TLS, timeout, abort, ...). */
|
|
16
31
|
| {
|
|
@@ -18,10 +33,9 @@ export type McpShapeProbeResult =
|
|
|
18
33
|
readonly reason: string;
|
|
19
34
|
};
|
|
20
35
|
export interface ProbeOptions {
|
|
21
|
-
/** Injected for tests. Defaults to the global `fetch`. */
|
|
22
|
-
readonly fetch?: typeof fetch;
|
|
23
36
|
/** Abort the request after this many ms. Default 8000. */
|
|
24
37
|
readonly timeoutMs?: number;
|
|
38
|
+
readonly httpClientLayer?: Layer.Layer<HttpClient.HttpClient>;
|
|
25
39
|
readonly headers?: Record<string, string>;
|
|
26
40
|
readonly queryParams?: Record<string, string>;
|
|
27
41
|
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
declare const
|
|
2
|
+
export declare const McpStoredSourceSchema: Schema.Struct<{
|
|
3
3
|
readonly namespace: Schema.String;
|
|
4
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
4
5
|
readonly name: Schema.String;
|
|
5
6
|
readonly config: Schema.Union<readonly [Schema.Struct<{
|
|
6
7
|
readonly transport: Schema.Literal<"remote">;
|
|
7
8
|
readonly endpoint: Schema.String;
|
|
8
9
|
readonly remoteTransport: Schema.withConstructorDefault<Schema.optionalKey<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>>;
|
|
9
10
|
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
10
|
-
readonly
|
|
11
|
+
readonly kind: Schema.Literal<"binding">;
|
|
12
|
+
readonly slot: Schema.String;
|
|
11
13
|
readonly prefix: Schema.optional<Schema.String>;
|
|
12
14
|
}>]>>>;
|
|
13
15
|
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
14
|
-
readonly
|
|
16
|
+
readonly kind: Schema.Literal<"binding">;
|
|
17
|
+
readonly slot: Schema.String;
|
|
15
18
|
readonly prefix: Schema.optional<Schema.String>;
|
|
16
19
|
}>]>>>;
|
|
17
20
|
readonly auth: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -19,13 +22,13 @@ declare const McpStoredSourceSchema_base: Schema.Class<McpStoredSourceSchema, Sc
|
|
|
19
22
|
}>, Schema.Struct<{
|
|
20
23
|
readonly kind: Schema.Literal<"header">;
|
|
21
24
|
readonly headerName: Schema.String;
|
|
22
|
-
readonly
|
|
25
|
+
readonly secretSlot: Schema.String;
|
|
23
26
|
readonly prefix: Schema.optional<Schema.String>;
|
|
24
27
|
}>, Schema.Struct<{
|
|
25
28
|
readonly kind: Schema.Literal<"oauth2">;
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
+
readonly connectionSlot: Schema.String;
|
|
30
|
+
readonly clientIdSlot: Schema.optional<Schema.String>;
|
|
31
|
+
readonly clientSecretSlot: Schema.optional<Schema.String>;
|
|
29
32
|
}>]>;
|
|
30
33
|
}>, Schema.Struct<{
|
|
31
34
|
readonly transport: Schema.Literal<"stdio">;
|
|
@@ -34,8 +37,6 @@ declare const McpStoredSourceSchema_base: Schema.Class<McpStoredSourceSchema, Sc
|
|
|
34
37
|
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
35
38
|
readonly cwd: Schema.optional<Schema.String>;
|
|
36
39
|
}>]>;
|
|
37
|
-
}
|
|
38
|
-
export
|
|
39
|
-
}
|
|
40
|
+
}>;
|
|
41
|
+
export type McpStoredSourceSchema = typeof McpStoredSourceSchema.Type;
|
|
40
42
|
export type McpStoredSourceSchemaType = typeof McpStoredSourceSchema.Type;
|
|
41
|
-
export {};
|