@executor-js/plugin-mcp 1.4.33 → 1.5.1

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.
Files changed (57) hide show
  1. package/dist/AddMcpSource-4LLERUW5.js +602 -0
  2. package/dist/AddMcpSource-4LLERUW5.js.map +1 -0
  3. package/dist/EditMcpSource-GKJRP75X.js +313 -0
  4. package/dist/EditMcpSource-GKJRP75X.js.map +1 -0
  5. package/dist/McpAccountsPanel-UX7MHEIG.js +132 -0
  6. package/dist/McpAccountsPanel-UX7MHEIG.js.map +1 -0
  7. package/dist/api/group.d.ts +79 -143
  8. package/dist/api/index.d.ts +99 -155
  9. package/dist/chunk-2TXHTMKM.js +1298 -0
  10. package/dist/chunk-2TXHTMKM.js.map +1 -0
  11. package/dist/chunk-6OEQZ72N.js +124 -0
  12. package/dist/chunk-6OEQZ72N.js.map +1 -0
  13. package/dist/chunk-7FJ3PUUL.js +21 -0
  14. package/dist/chunk-7FJ3PUUL.js.map +1 -0
  15. package/dist/chunk-N4EAF5CA.js +146 -0
  16. package/dist/chunk-N4EAF5CA.js.map +1 -0
  17. package/dist/client.js +9 -9
  18. package/dist/client.js.map +1 -1
  19. package/dist/core.js +36 -26
  20. package/dist/index.js +2 -2
  21. package/dist/promise.d.ts +1 -1
  22. package/dist/react/AddMcpSource.d.ts +1 -1
  23. package/dist/react/McpAccountsPanel.d.ts +6 -0
  24. package/dist/react/McpRemoteSourceFields.d.ts +4 -2
  25. package/dist/react/McpSignInButton.d.ts +2 -0
  26. package/dist/react/atoms.d.ts +93 -313
  27. package/dist/react/auth-method-config.d.ts +8 -0
  28. package/dist/react/client.d.ts +78 -142
  29. package/dist/react/index.d.ts +3 -3
  30. package/dist/react/source-plugin.d.ts +5 -5
  31. package/dist/sdk/connection.d.ts +4 -4
  32. package/dist/sdk/errors.d.ts +0 -19
  33. package/dist/sdk/index.d.ts +4 -3
  34. package/dist/sdk/invoke.d.ts +9 -16
  35. package/dist/sdk/plugin.d.ts +101 -236
  36. package/dist/sdk/types.d.ts +25 -130
  37. package/package.json +5 -4
  38. package/dist/AddMcpSource-PADMBVX2.js +0 -688
  39. package/dist/AddMcpSource-PADMBVX2.js.map +0 -1
  40. package/dist/EditMcpSource-L5GC2B4J.js +0 -281
  41. package/dist/EditMcpSource-L5GC2B4J.js.map +0 -1
  42. package/dist/McpSourceSummary-LE3WXFUE.js +0 -170
  43. package/dist/McpSourceSummary-LE3WXFUE.js.map +0 -1
  44. package/dist/chunk-6OYEXHU3.js +0 -156
  45. package/dist/chunk-6OYEXHU3.js.map +0 -1
  46. package/dist/chunk-FMTVLO5L.js +0 -179
  47. package/dist/chunk-FMTVLO5L.js.map +0 -1
  48. package/dist/chunk-LEGVPKYH.js +0 -2391
  49. package/dist/chunk-LEGVPKYH.js.map +0 -1
  50. package/dist/chunk-ZIRGIRGP.js +0 -115
  51. package/dist/chunk-ZIRGIRGP.js.map +0 -1
  52. package/dist/react/McpSourceSummary.d.ts +0 -5
  53. package/dist/sdk/binding-store.d.ts +0 -31
  54. package/dist/sdk/stored-source.d.ts +0 -42
  55. /package/dist/{sdk/connection-pool.test.d.ts → react/auth-method-config.test.d.ts} +0 -0
  56. /package/dist/sdk/{cross-user-isolation.test.d.ts → describe-auth-methods.test.d.ts} +0 -0
  57. /package/dist/sdk/{per-user-auth-isolation.test.d.ts → owner-isolation.test.d.ts} +0 -0
@@ -1,286 +1,151 @@
1
1
  import { Effect, Layer, Schema } from "effect";
2
2
  import type { HttpClient } from "effect/unstable/http";
3
- import { type StorageFailure } from "@executor-js/sdk/core";
4
- import { OAuth2SourceConfig } from "@executor-js/sdk/http-source";
5
- import { type McpBindingStore, type McpStoredSource } from "./binding-store";
3
+ import { IntegrationAlreadyExistsError, type AuthMethodDescriptor, type Integration, type IntegrationConfig, type IntegrationRecord, type StorageFailure } from "@executor-js/sdk";
6
4
  import { McpConnectionError, McpToolDiscoveryError } from "./errors";
7
5
  import { type McpShapeProbeResult } from "./probe-shape";
8
- import { type McpConfiguredValueInput as McpConfiguredValueInputType } from "./types";
9
- import { type ConfigFileSink } from "@executor-js/config";
10
- /**
11
- * Executor scope id that owns a newly-added MCP source row. Must be one
12
- * of the executor's configured scopes. Admins adding a shared server at
13
- * org scope pin here; per-user stdio sources can pin at the inner
14
- * scope.
15
- */
16
- type McpSourceScopeField = {
17
- readonly scope: string;
18
- };
19
- export interface McpRemoteSourceConfig extends McpSourceScopeField {
20
- readonly transport: "remote";
21
- readonly name: string;
22
- readonly endpoint: string;
23
- readonly remoteTransport?: "streamable-http" | "sse" | "auto";
24
- readonly queryParams?: Record<string, McpConfiguredValueInputType>;
25
- readonly headers?: Record<string, McpConfiguredValueInputType>;
26
- readonly namespace?: string;
27
- readonly oauth2?: OAuth2SourceConfig;
28
- readonly credentials?: McpInitialCredentialsInput;
29
- }
30
- export interface McpStdioSourceConfig extends McpSourceScopeField {
31
- readonly transport: "stdio";
32
- readonly name: string;
33
- readonly command: string;
34
- readonly args?: string[];
35
- readonly env?: Record<string, string>;
36
- readonly cwd?: string;
37
- readonly namespace?: string;
38
- }
39
- export type McpSourceConfig = McpRemoteSourceConfig | McpStdioSourceConfig;
40
- export interface McpProbeResult {
41
- readonly connected: boolean;
42
- readonly requiresOAuth: boolean;
43
- readonly supportsDynamicRegistration: boolean;
44
- readonly name: string;
45
- readonly namespace: string;
46
- readonly toolCount: number | null;
47
- readonly serverName: string | null;
48
- }
49
- declare const McpConfigureSourceInputSchema: Schema.Struct<{
50
- readonly name: Schema.optional<Schema.String>;
51
- readonly endpoint: Schema.optional<Schema.String>;
52
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
53
- readonly kind: Schema.Literal<"text">;
54
- readonly text: Schema.String;
55
- readonly prefix: Schema.optional<Schema.String>;
56
- }>, Schema.Struct<{
57
- readonly kind: Schema.Literal<"secret">;
58
- readonly secretId: Schema.String;
59
- readonly secretScope: Schema.optional<Schema.String>;
60
- readonly prefix: Schema.optional<Schema.String>;
61
- }>, Schema.Struct<{
62
- readonly kind: Schema.Literal<"connection">;
63
- readonly connectionId: Schema.String;
64
- }>]>>>;
65
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
66
- readonly kind: Schema.Literal<"text">;
67
- readonly text: Schema.String;
68
- readonly prefix: Schema.optional<Schema.String>;
69
- }>, Schema.Struct<{
70
- readonly kind: Schema.Literal<"secret">;
71
- readonly secretId: Schema.String;
72
- readonly secretScope: Schema.optional<Schema.String>;
73
- readonly prefix: Schema.optional<Schema.String>;
74
- }>, Schema.Struct<{
75
- readonly kind: Schema.Literal<"connection">;
76
- readonly connectionId: Schema.String;
77
- }>]>>>;
6
+ import { type McpIntegrationConfig as McpIntegrationConfigType } from "./types";
7
+ declare const McpRemoteServerInputSchema: Schema.Struct<{
8
+ readonly transport: Schema.optional<Schema.Literal<"remote">>;
9
+ readonly name: Schema.String;
10
+ readonly endpoint: Schema.String;
11
+ readonly remoteTransport: Schema.optional<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>;
12
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
13
+ readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
14
+ readonly slug: Schema.optional<Schema.String>;
15
+ /** How a connection's value is applied to requests. Defaults to none. */
78
16
  readonly auth: Schema.optional<Schema.Union<readonly [Schema.Struct<{
79
17
  readonly kind: Schema.Literal<"none">;
80
18
  }>, Schema.Struct<{
81
- readonly oauth2: Schema.optional<Schema.Struct<{
82
- readonly clientId: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
83
- readonly kind: Schema.Literal<"text">;
84
- readonly text: Schema.String;
85
- readonly prefix: Schema.optional<Schema.String>;
86
- }>, Schema.Struct<{
87
- readonly kind: Schema.Literal<"secret">;
88
- readonly secretId: Schema.String;
89
- readonly secretScope: Schema.optional<Schema.String>;
90
- readonly prefix: Schema.optional<Schema.String>;
91
- }>, Schema.Struct<{
92
- readonly kind: Schema.Literal<"connection">;
93
- readonly connectionId: Schema.String;
94
- }>]>>;
95
- readonly clientSecret: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Struct<{
96
- readonly kind: Schema.Literal<"text">;
97
- readonly text: Schema.String;
98
- readonly prefix: Schema.optional<Schema.String>;
99
- }>, Schema.Struct<{
100
- readonly kind: Schema.Literal<"secret">;
101
- readonly secretId: Schema.String;
102
- readonly secretScope: Schema.optional<Schema.String>;
103
- readonly prefix: Schema.optional<Schema.String>;
104
- }>, Schema.Struct<{
105
- readonly kind: Schema.Literal<"connection">;
106
- readonly connectionId: Schema.String;
107
- }>]>>>;
108
- readonly connection: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
109
- readonly kind: Schema.Literal<"text">;
110
- readonly text: Schema.String;
111
- readonly prefix: Schema.optional<Schema.String>;
112
- }>, Schema.Struct<{
113
- readonly kind: Schema.Literal<"secret">;
114
- readonly secretId: Schema.String;
115
- readonly secretScope: Schema.optional<Schema.String>;
116
- readonly prefix: Schema.optional<Schema.String>;
117
- }>, Schema.Struct<{
118
- readonly kind: Schema.Literal<"connection">;
119
- readonly connectionId: Schema.String;
120
- }>]>>;
121
- }>>;
122
- }>]>>;
123
- readonly scope: Schema.String;
124
- }>;
125
- export type McpConfigureSourceInput = typeof McpConfigureSourceInputSchema.Type;
126
- declare const McpInitialCredentialsInputSchema: Schema.Struct<{
127
- readonly scope: Schema.String;
128
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
129
- readonly kind: Schema.Literal<"text">;
130
- readonly text: Schema.String;
131
- readonly prefix: Schema.optional<Schema.String>;
132
- }>, Schema.Struct<{
133
- readonly kind: Schema.Literal<"secret">;
134
- readonly secretId: Schema.String;
135
- readonly secretScope: Schema.optional<Schema.String>;
136
- readonly prefix: Schema.optional<Schema.String>;
137
- }>, Schema.Struct<{
138
- readonly kind: Schema.Literal<"connection">;
139
- readonly connectionId: Schema.String;
140
- }>]>>>;
141
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
142
- readonly kind: Schema.Literal<"text">;
143
- readonly text: Schema.String;
144
- readonly prefix: Schema.optional<Schema.String>;
145
- }>, Schema.Struct<{
146
- readonly kind: Schema.Literal<"secret">;
147
- readonly secretId: Schema.String;
148
- readonly secretScope: Schema.optional<Schema.String>;
19
+ readonly kind: Schema.Literal<"header">;
20
+ readonly headerName: Schema.String;
149
21
  readonly prefix: Schema.optional<Schema.String>;
150
22
  }>, Schema.Struct<{
151
- readonly kind: Schema.Literal<"connection">;
152
- readonly connectionId: Schema.String;
153
- }>]>>>;
23
+ readonly kind: Schema.Literal<"oauth2">;
24
+ }>]>>;
25
+ }>;
26
+ declare const McpStdioServerInputSchema: Schema.Struct<{
27
+ readonly transport: Schema.Literal<"stdio">;
28
+ readonly name: Schema.String;
29
+ readonly command: Schema.String;
30
+ readonly args: Schema.optional<Schema.$Array<Schema.String>>;
31
+ readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
32
+ readonly cwd: Schema.optional<Schema.String>;
33
+ readonly slug: Schema.optional<Schema.String>;
34
+ }>;
35
+ declare const McpAddServerInputSchema: Schema.Union<readonly [Schema.Struct<{
36
+ readonly transport: Schema.optional<Schema.Literal<"remote">>;
37
+ readonly name: Schema.String;
38
+ readonly endpoint: Schema.String;
39
+ readonly remoteTransport: Schema.optional<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>;
40
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
41
+ readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
42
+ readonly slug: Schema.optional<Schema.String>;
43
+ /** How a connection's value is applied to requests. Defaults to none. */
154
44
  readonly auth: Schema.optional<Schema.Union<readonly [Schema.Struct<{
155
45
  readonly kind: Schema.Literal<"none">;
156
46
  }>, Schema.Struct<{
157
- readonly oauth2: Schema.optional<Schema.Struct<{
158
- readonly clientId: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
159
- readonly kind: Schema.Literal<"text">;
160
- readonly text: Schema.String;
161
- readonly prefix: Schema.optional<Schema.String>;
162
- }>, Schema.Struct<{
163
- readonly kind: Schema.Literal<"secret">;
164
- readonly secretId: Schema.String;
165
- readonly secretScope: Schema.optional<Schema.String>;
166
- readonly prefix: Schema.optional<Schema.String>;
167
- }>, Schema.Struct<{
168
- readonly kind: Schema.Literal<"connection">;
169
- readonly connectionId: Schema.String;
170
- }>]>>;
171
- readonly clientSecret: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Struct<{
172
- readonly kind: Schema.Literal<"text">;
173
- readonly text: Schema.String;
174
- readonly prefix: Schema.optional<Schema.String>;
175
- }>, Schema.Struct<{
176
- readonly kind: Schema.Literal<"secret">;
177
- readonly secretId: Schema.String;
178
- readonly secretScope: Schema.optional<Schema.String>;
179
- readonly prefix: Schema.optional<Schema.String>;
180
- }>, Schema.Struct<{
181
- readonly kind: Schema.Literal<"connection">;
182
- readonly connectionId: Schema.String;
183
- }>]>>>;
184
- readonly connection: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
185
- readonly kind: Schema.Literal<"text">;
186
- readonly text: Schema.String;
187
- readonly prefix: Schema.optional<Schema.String>;
188
- }>, Schema.Struct<{
189
- readonly kind: Schema.Literal<"secret">;
190
- readonly secretId: Schema.String;
191
- readonly secretScope: Schema.optional<Schema.String>;
192
- readonly prefix: Schema.optional<Schema.String>;
193
- }>, Schema.Struct<{
194
- readonly kind: Schema.Literal<"connection">;
195
- readonly connectionId: Schema.String;
196
- }>]>>;
197
- }>>;
47
+ readonly kind: Schema.Literal<"header">;
48
+ readonly headerName: Schema.String;
49
+ readonly prefix: Schema.optional<Schema.String>;
50
+ }>, Schema.Struct<{
51
+ readonly kind: Schema.Literal<"oauth2">;
198
52
  }>]>>;
199
- }>;
200
- type McpInitialCredentialsInput = typeof McpInitialCredentialsInputSchema.Type;
53
+ }>, Schema.Struct<{
54
+ readonly transport: Schema.Literal<"stdio">;
55
+ readonly name: Schema.String;
56
+ readonly command: Schema.String;
57
+ readonly args: Schema.optional<Schema.$Array<Schema.String>>;
58
+ readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
59
+ readonly cwd: Schema.optional<Schema.String>;
60
+ readonly slug: Schema.optional<Schema.String>;
61
+ }>]>;
201
62
  declare const McpProbeEndpointInputSchema: Schema.Struct<{
202
63
  readonly endpoint: Schema.String;
203
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
204
- readonly secretId: Schema.String;
205
- readonly prefix: Schema.optional<Schema.String>;
206
- }>]>>>;
207
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
208
- readonly secretId: Schema.String;
209
- readonly prefix: Schema.optional<Schema.String>;
210
- }>]>>>;
64
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
65
+ readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
66
+ }>;
67
+ declare const McpProbeEndpointOutputSchema: Schema.Struct<{
68
+ readonly connected: Schema.Boolean;
69
+ readonly requiresAuthentication: Schema.Boolean;
70
+ readonly requiresOAuth: Schema.Boolean;
71
+ readonly supportsDynamicRegistration: Schema.Boolean;
72
+ readonly name: Schema.String;
73
+ readonly slug: Schema.String;
74
+ readonly toolCount: Schema.NullOr<Schema.Number>;
75
+ readonly serverName: Schema.NullOr<Schema.String>;
211
76
  }>;
77
+ export type McpRemoteServerInput = typeof McpRemoteServerInputSchema.Type;
78
+ export type McpStdioServerInput = typeof McpStdioServerInputSchema.Type;
79
+ export type McpServerInput = typeof McpAddServerInputSchema.Type;
80
+ export type McpProbeResult = typeof McpProbeEndpointOutputSchema.Type;
212
81
  export type McpProbeEndpointInput = typeof McpProbeEndpointInputSchema.Type;
213
82
  /** Translate a non-MCP probe outcome into a message a user can act on.
214
- * The technical `reason` (`401 without Bearer WWW-Authenticate — not an
215
- * MCP auth challenge`, etc.) stays in telemetry via the probe span; the
216
- * user gets a sentence pointing at their next step. Exported for tests. */
83
+ * Exported for tests. */
217
84
  export declare const userFacingProbeMessage: (shape: Extract<McpShapeProbeResult, {
218
85
  kind: "not-mcp";
219
86
  } | {
220
87
  kind: "unreachable";
221
88
  }>) => string;
89
+ export declare const describeMcpAuthMethods: (record: IntegrationRecord) => readonly AuthMethodDescriptor[];
90
+ export declare const describeMcpIntegrationDisplay: (record: IntegrationRecord) => {
91
+ readonly url?: string;
92
+ };
222
93
  export interface McpPluginOptions {
223
94
  /**
224
- * Allow configuring stdio-transport MCP sources. Off by default.
95
+ * Allow configuring stdio-transport MCP servers. Off by default.
225
96
  *
226
- * Stdio sources spawn a local subprocess that inherits the parent
97
+ * Stdio servers spawn a local subprocess that inherits the parent
227
98
  * `process.env`. Only enable for trusted single-user contexts.
228
99
  */
229
100
  readonly dangerouslyAllowStdioMCP?: boolean;
230
101
  readonly httpClientLayer?: Layer.Layer<HttpClient.HttpClient>;
231
- /** If provided, source add/remove is mirrored to executor.jsonc
232
- * (best-effort — file errors are logged, not raised). */
233
- readonly configFile?: ConfigFileSink;
234
102
  }
235
- export declare const mcpPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"mcp", {
103
+ export declare const mcpPlugin: import("@executor-js/sdk").ConfiguredPlugin<"mcp", {
236
104
  probeEndpoint: (input: string | McpProbeEndpointInput) => Effect.Effect<{
237
105
  connected: true;
106
+ requiresAuthentication: false;
238
107
  requiresOAuth: false;
239
108
  supportsDynamicRegistration: false;
240
109
  name: string;
241
- namespace: string;
110
+ slug: string;
242
111
  toolCount: number;
243
112
  serverName: string | null;
244
113
  } | {
245
114
  connected: false;
115
+ requiresAuthentication: true;
246
116
  requiresOAuth: true;
247
117
  supportsDynamicRegistration: boolean;
248
118
  name: string;
249
- namespace: string;
119
+ slug: string;
250
120
  toolCount: null;
251
121
  serverName: null;
252
- }, StorageFailure | McpConnectionError, never>;
253
- addSource: (config: McpSourceConfig) => Effect.Effect<{
254
- toolCount: number;
255
- namespace: string;
256
- }, StorageFailure | McpConnectionError | McpToolDiscoveryError, never>;
257
- removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
258
- refreshSource: (namespace: string, scope: string) => Effect.Effect<{
259
- toolCount: number;
260
- }, StorageFailure | McpConnectionError | McpToolDiscoveryError, never>;
261
- getSource: (namespace: string, scope: string) => Effect.Effect<McpStoredSource | null, StorageFailure, never>;
262
- }, McpBindingStore, McpPluginOptions, {}, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
263
- /**
264
- * Errors any MCP extension method may surface. The first four are
265
- * plugin-domain tagged errors that flow directly to clients (4xx, each
266
- * carrying its own `HttpApiSchema` status). `StorageFailure` covers
267
- * raw backend failures (`StorageError`) plus `UniqueViolationError`;
268
- * the HTTP edge (`@executor-js/api`'s `withCapture`) translates
269
- * `StorageError` to the opaque `InternalError({ traceId })` at Layer
270
- * composition. `UniqueViolationError` passes through — plugins can
271
- * `Effect.catchTag` it if they want a friendlier user-facing error.
272
- */
122
+ } | {
123
+ connected: false;
124
+ requiresAuthentication: true;
125
+ requiresOAuth: false;
126
+ supportsDynamicRegistration: false;
127
+ name: string;
128
+ slug: string;
129
+ toolCount: null;
130
+ serverName: null;
131
+ }, McpConnectionError, never>;
132
+ addServer: (input: McpServerInput) => Effect.Effect<{
133
+ slug: string;
134
+ }, StorageFailure | IntegrationAlreadyExistsError, never>;
135
+ removeServer: (slug: string) => Effect.Effect<void, StorageFailure, never>;
136
+ getServer: (slug: string) => Effect.Effect<IntegrationRecord | null, StorageFailure, never>;
137
+ configureServer: (slug: string, config: McpIntegrationConfigType) => Effect.Effect<void, StorageFailure, never>;
138
+ }, {}, McpPluginOptions, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
273
139
  export type McpExtensionFailure = McpConnectionError | McpToolDiscoveryError | StorageFailure;
274
140
  export interface McpPluginExtension {
275
141
  readonly probeEndpoint: (input: string | McpProbeEndpointInput) => Effect.Effect<McpProbeResult, McpExtensionFailure>;
276
- readonly addSource: (config: McpSourceConfig) => Effect.Effect<{
277
- readonly toolCount: number;
278
- readonly namespace: string;
279
- }, McpExtensionFailure>;
280
- readonly removeSource: (namespace: string, scope: string) => Effect.Effect<void, McpExtensionFailure>;
281
- readonly refreshSource: (namespace: string, scope: string) => Effect.Effect<{
282
- readonly toolCount: number;
283
- }, McpExtensionFailure>;
284
- readonly getSource: (namespace: string, scope: string) => Effect.Effect<McpStoredSource | null, McpExtensionFailure>;
142
+ readonly addServer: (input: McpServerInput) => Effect.Effect<{
143
+ readonly slug: string;
144
+ }, McpExtensionFailure | IntegrationAlreadyExistsError>;
145
+ readonly removeServer: (slug: string) => Effect.Effect<void, McpExtensionFailure>;
146
+ readonly getServer: (slug: string) => Effect.Effect<(Integration & {
147
+ readonly config: IntegrationConfig;
148
+ }) | null, McpExtensionFailure>;
149
+ readonly configureServer: (slug: string, config: McpIntegrationConfigType) => Effect.Effect<void, McpExtensionFailure>;
285
150
  }
286
151
  export {};
@@ -1,140 +1,42 @@
1
1
  import { Schema } from "effect";
2
- import { SecretBackedMap, SecretBackedValue } from "@executor-js/sdk/shared";
3
- export { SecretBackedMap, SecretBackedValue };
4
2
  export declare const McpRemoteTransport: Schema.Literals<readonly ["streamable-http", "sse", "auto"]>;
5
3
  export type McpRemoteTransport = typeof McpRemoteTransport.Type;
6
4
  /** All transport types (used in the connector layer) */
7
5
  export declare const McpTransport: Schema.Literals<readonly ["streamable-http", "sse", "stdio", "auto"]>;
8
6
  export type McpTransport = typeof McpTransport.Type;
9
- export declare const ConfiguredMcpCredentialValue: Schema.Union<readonly [Schema.String, Schema.Struct<{
10
- readonly kind: Schema.Literal<"binding">;
11
- readonly slot: Schema.String;
12
- readonly prefix: Schema.optional<Schema.String>;
13
- }>]>;
14
- export type ConfiguredMcpCredentialValue = typeof ConfiguredMcpCredentialValue.Type;
15
- export declare const McpConfiguredValueInput: Schema.Union<readonly [Schema.String, Schema.Struct<{
16
- readonly kind: Schema.Literal<"secret">;
17
- readonly prefix: Schema.optional<Schema.String>;
18
- }>]>;
19
- export type McpConfiguredValueInput = typeof McpConfiguredValueInput.Type;
20
- export declare const McpCredentialInput: Schema.Union<readonly [Schema.String, Schema.Struct<{
21
- readonly kind: Schema.Literal<"text">;
22
- readonly text: Schema.String;
23
- readonly prefix: Schema.optional<Schema.String>;
24
- }>, Schema.Struct<{
25
- readonly kind: Schema.Literal<"secret">;
26
- readonly secretId: Schema.String;
27
- readonly secretScope: Schema.optional<Schema.String>;
28
- readonly prefix: Schema.optional<Schema.String>;
29
- }>, Schema.Struct<{
30
- readonly kind: Schema.Literal<"connection">;
31
- readonly connectionId: Schema.String;
32
- }>]>;
33
- export type McpCredentialInput = typeof McpCredentialInput.Type;
34
- export declare const mcpHeaderSlot: (name: string) => string;
35
- export declare const mcpQueryParamSlot: (name: string) => string;
36
- export declare const MCP_HEADER_AUTH_SLOT = "auth:header";
37
- export declare const MCP_OAUTH_CONNECTION_SLOT = "auth:oauth2:connection";
38
- export declare const MCP_OAUTH_CLIENT_ID_SLOT = "auth:oauth2:client-id";
39
- export declare const MCP_OAUTH_CLIENT_SECRET_SLOT = "auth:oauth2:client-secret";
40
- /** JSON object loosely typed — used for opaque OAuth state we just round-trip. */
41
- declare const JsonObject: Schema.$Record<Schema.String, Schema.Unknown>;
42
- export { JsonObject as McpJsonObject };
43
- export declare const McpConnectionAuth: Schema.Union<readonly [Schema.Struct<{
7
+ export declare const McpAuthTemplate: Schema.Union<readonly [Schema.Struct<{
44
8
  readonly kind: Schema.Literal<"none">;
45
9
  }>, Schema.Struct<{
46
10
  readonly kind: Schema.Literal<"header">;
47
11
  readonly headerName: Schema.String;
48
- readonly secretSlot: Schema.String;
49
12
  readonly prefix: Schema.optional<Schema.String>;
50
13
  }>, Schema.Struct<{
51
14
  readonly kind: Schema.Literal<"oauth2">;
52
- readonly connectionSlot: Schema.String;
53
- readonly clientIdSlot: Schema.optional<Schema.String>;
54
- readonly clientSecretSlot: Schema.optional<Schema.String>;
55
15
  }>]>;
56
- export type McpConnectionAuth = typeof McpConnectionAuth.Type;
57
- export declare const McpConnectionAuthInput: Schema.Union<readonly [Schema.Struct<{
58
- readonly kind: Schema.Literal<"none">;
59
- }>, Schema.Struct<{
60
- readonly oauth2: Schema.optional<Schema.Struct<{
61
- readonly clientId: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
62
- readonly kind: Schema.Literal<"text">;
63
- readonly text: Schema.String;
64
- readonly prefix: Schema.optional<Schema.String>;
65
- }>, Schema.Struct<{
66
- readonly kind: Schema.Literal<"secret">;
67
- readonly secretId: Schema.String;
68
- readonly secretScope: Schema.optional<Schema.String>;
69
- readonly prefix: Schema.optional<Schema.String>;
70
- }>, Schema.Struct<{
71
- readonly kind: Schema.Literal<"connection">;
72
- readonly connectionId: Schema.String;
73
- }>]>>;
74
- readonly clientSecret: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Struct<{
75
- readonly kind: Schema.Literal<"text">;
76
- readonly text: Schema.String;
77
- readonly prefix: Schema.optional<Schema.String>;
78
- }>, Schema.Struct<{
79
- readonly kind: Schema.Literal<"secret">;
80
- readonly secretId: Schema.String;
81
- readonly secretScope: Schema.optional<Schema.String>;
82
- readonly prefix: Schema.optional<Schema.String>;
83
- }>, Schema.Struct<{
84
- readonly kind: Schema.Literal<"connection">;
85
- readonly connectionId: Schema.String;
86
- }>]>>>;
87
- readonly connection: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
88
- readonly kind: Schema.Literal<"text">;
89
- readonly text: Schema.String;
90
- readonly prefix: Schema.optional<Schema.String>;
91
- }>, Schema.Struct<{
92
- readonly kind: Schema.Literal<"secret">;
93
- readonly secretId: Schema.String;
94
- readonly secretScope: Schema.optional<Schema.String>;
95
- readonly prefix: Schema.optional<Schema.String>;
96
- }>, Schema.Struct<{
97
- readonly kind: Schema.Literal<"connection">;
98
- readonly connectionId: Schema.String;
99
- }>]>>;
100
- }>>;
101
- }>]>;
102
- export type McpConnectionAuthInput = typeof McpConnectionAuthInput.Type;
103
- export declare const McpRemoteSourceData: Schema.Struct<{
16
+ export type McpAuthTemplate = typeof McpAuthTemplate.Type;
17
+ export declare const McpRemoteIntegrationConfig: Schema.Struct<{
104
18
  readonly transport: Schema.Literal<"remote">;
105
19
  /** The MCP server endpoint URL */
106
20
  readonly endpoint: Schema.String;
107
- /** Transport preference for this remote source */
21
+ /** Transport preference for this remote server */
108
22
  readonly remoteTransport: Schema.withConstructorDefault<Schema.optionalKey<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>>;
109
- /** Extra query params appended to the endpoint URL */
110
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
111
- readonly kind: Schema.Literal<"binding">;
112
- readonly slot: Schema.String;
113
- readonly prefix: Schema.optional<Schema.String>;
114
- }>]>>>;
115
- /** Extra headers sent on every request */
116
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
117
- readonly kind: Schema.Literal<"binding">;
118
- readonly slot: Schema.String;
119
- readonly prefix: Schema.optional<Schema.String>;
120
- }>]>>>;
121
- /** Auth configuration */
23
+ /** Static query params appended to the endpoint URL (non-credential) */
24
+ readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
25
+ /** Static headers sent on every request (non-credential) */
26
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
27
+ /** Auth template — how the connection's value is rendered onto requests */
122
28
  readonly auth: Schema.Union<readonly [Schema.Struct<{
123
29
  readonly kind: Schema.Literal<"none">;
124
30
  }>, Schema.Struct<{
125
31
  readonly kind: Schema.Literal<"header">;
126
32
  readonly headerName: Schema.String;
127
- readonly secretSlot: Schema.String;
128
33
  readonly prefix: Schema.optional<Schema.String>;
129
34
  }>, Schema.Struct<{
130
35
  readonly kind: Schema.Literal<"oauth2">;
131
- readonly connectionSlot: Schema.String;
132
- readonly clientIdSlot: Schema.optional<Schema.String>;
133
- readonly clientSecretSlot: Schema.optional<Schema.String>;
134
36
  }>]>;
135
37
  }>;
136
- export type McpRemoteSourceData = typeof McpRemoteSourceData.Type;
137
- export declare const McpStdioSourceData: Schema.Struct<{
38
+ export type McpRemoteIntegrationConfig = typeof McpRemoteIntegrationConfig.Type;
39
+ export declare const McpStdioIntegrationConfig: Schema.Struct<{
138
40
  readonly transport: Schema.Literal<"stdio">;
139
41
  /** The command to run */
140
42
  readonly command: Schema.String;
@@ -145,38 +47,26 @@ export declare const McpStdioSourceData: Schema.Struct<{
145
47
  /** Working directory */
146
48
  readonly cwd: Schema.optional<Schema.String>;
147
49
  }>;
148
- export type McpStdioSourceData = typeof McpStdioSourceData.Type;
149
- export declare const McpStoredSourceData: Schema.Union<readonly [Schema.Struct<{
50
+ export type McpStdioIntegrationConfig = typeof McpStdioIntegrationConfig.Type;
51
+ export declare const McpIntegrationConfig: Schema.Union<readonly [Schema.Struct<{
150
52
  readonly transport: Schema.Literal<"remote">;
151
53
  /** The MCP server endpoint URL */
152
54
  readonly endpoint: Schema.String;
153
- /** Transport preference for this remote source */
55
+ /** Transport preference for this remote server */
154
56
  readonly remoteTransport: Schema.withConstructorDefault<Schema.optionalKey<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>>;
155
- /** Extra query params appended to the endpoint URL */
156
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
157
- readonly kind: Schema.Literal<"binding">;
158
- readonly slot: Schema.String;
159
- readonly prefix: Schema.optional<Schema.String>;
160
- }>]>>>;
161
- /** Extra headers sent on every request */
162
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
163
- readonly kind: Schema.Literal<"binding">;
164
- readonly slot: Schema.String;
165
- readonly prefix: Schema.optional<Schema.String>;
166
- }>]>>>;
167
- /** Auth configuration */
57
+ /** Static query params appended to the endpoint URL (non-credential) */
58
+ readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
59
+ /** Static headers sent on every request (non-credential) */
60
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
61
+ /** Auth template — how the connection's value is rendered onto requests */
168
62
  readonly auth: Schema.Union<readonly [Schema.Struct<{
169
63
  readonly kind: Schema.Literal<"none">;
170
64
  }>, Schema.Struct<{
171
65
  readonly kind: Schema.Literal<"header">;
172
66
  readonly headerName: Schema.String;
173
- readonly secretSlot: Schema.String;
174
67
  readonly prefix: Schema.optional<Schema.String>;
175
68
  }>, Schema.Struct<{
176
69
  readonly kind: Schema.Literal<"oauth2">;
177
- readonly connectionSlot: Schema.String;
178
- readonly clientIdSlot: Schema.optional<Schema.String>;
179
- readonly clientSecretSlot: Schema.optional<Schema.String>;
180
70
  }>]>;
181
71
  }>, Schema.Struct<{
182
72
  readonly transport: Schema.Literal<"stdio">;
@@ -189,7 +79,10 @@ export declare const McpStoredSourceData: Schema.Union<readonly [Schema.Struct<{
189
79
  /** Working directory */
190
80
  readonly cwd: Schema.optional<Schema.String>;
191
81
  }>]>;
192
- export type McpStoredSourceData = typeof McpStoredSourceData.Type;
82
+ export type McpIntegrationConfig = typeof McpIntegrationConfig.Type;
83
+ /** Parse an opaque integration `config` blob into a typed MCP config, or null
84
+ * if it isn't this plugin's shape. */
85
+ export declare const parseMcpIntegrationConfig: (config: unknown) => McpIntegrationConfig | null;
193
86
  export declare const McpToolAnnotations: Schema.Struct<{
194
87
  readonly title: Schema.optional<Schema.String>;
195
88
  readonly readOnlyHint: Schema.optional<Schema.Boolean>;
@@ -199,7 +92,9 @@ export declare const McpToolAnnotations: Schema.Struct<{
199
92
  }>;
200
93
  export type McpToolAnnotations = typeof McpToolAnnotations.Type;
201
94
  export declare const McpToolBinding: Schema.Struct<{
95
+ /** Sanitized, address-safe tool name (the `<tool>` address segment). */
202
96
  readonly toolId: Schema.String;
97
+ /** The real MCP tool name as advertised by the server. */
203
98
  readonly toolName: Schema.String;
204
99
  readonly description: Schema.NullOr<Schema.String>;
205
100
  readonly inputSchema: Schema.optional<Schema.Unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@executor-js/plugin-mcp",
3
- "version": "1.4.33",
3
+ "version": "1.5.1",
4
4
  "homepage": "https://github.com/RhysSullivan/executor/tree/main/packages/plugins/mcp",
5
5
  "bugs": {
6
6
  "url": "https://github.com/RhysSullivan/executor/issues"
@@ -54,10 +54,9 @@
54
54
  "dependencies": {
55
55
  "@cfworker/json-schema": "^4.1.1",
56
56
  "@effect/platform-node": "4.0.0-beta.59",
57
- "@executor-js/config": "1.4.33",
58
- "@executor-js/sdk": "1.4.33",
57
+ "@executor-js/config": "1.5.1",
58
+ "@executor-js/sdk": "1.5.1",
59
59
  "@modelcontextprotocol/sdk": "^1.29.0",
60
- "effect": "4.0.0-beta.59",
61
60
  "zod": "^4.3.6"
62
61
  },
63
62
  "devDependencies": {
@@ -66,6 +65,7 @@
66
65
  "@types/node": "^24.3.1",
67
66
  "@types/react": "^19.1.0",
68
67
  "bun-types": "^1.2.22",
68
+ "effect": "4.0.0-beta.59",
69
69
  "react": "^19.1.0",
70
70
  "tsup": "^8.5.0",
71
71
  "vitest": "^4.1.5"
@@ -73,6 +73,7 @@
73
73
  "peerDependencies": {
74
74
  "@effect/atom-react": "4.0.0-beta.59",
75
75
  "@tanstack/react-router": "^1.168.10",
76
+ "effect": "4.0.0-beta.59",
76
77
  "react": "^19.1.0"
77
78
  },
78
79
  "peerDependenciesMeta": {