@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.
Files changed (45) hide show
  1. package/dist/AddMcpSource-TLAL463B.js +762 -0
  2. package/dist/AddMcpSource-TLAL463B.js.map +1 -0
  3. package/dist/EditMcpSource-CWN6HIC4.js +259 -0
  4. package/dist/EditMcpSource-CWN6HIC4.js.map +1 -0
  5. package/dist/McpSourceSummary-257JNETP.js +85 -0
  6. package/dist/McpSourceSummary-257JNETP.js.map +1 -0
  7. package/dist/api/group.d.ts +183 -19
  8. package/dist/api/index.d.ts +501 -0
  9. package/dist/chunk-4ORPFRLI.js +238 -0
  10. package/dist/chunk-4ORPFRLI.js.map +1 -0
  11. package/dist/chunk-M6REVU6O.js +179 -0
  12. package/dist/chunk-M6REVU6O.js.map +1 -0
  13. package/dist/chunk-NQT7NAGE.js +2277 -0
  14. package/dist/chunk-NQT7NAGE.js.map +1 -0
  15. package/dist/chunk-SKSXXFOA.js +104 -0
  16. package/dist/chunk-SKSXXFOA.js.map +1 -0
  17. package/dist/chunk-ZIRGIRGP.js +115 -0
  18. package/dist/chunk-ZIRGIRGP.js.map +1 -0
  19. package/dist/client.js +51 -0
  20. package/dist/client.js.map +1 -0
  21. package/dist/core.js +26 -2
  22. package/dist/index.js +2 -1
  23. package/dist/react/McpRemoteSourceFields.d.ts +18 -0
  24. package/dist/react/McpSourceSummary.d.ts +5 -0
  25. package/dist/react/atoms.d.ts +286 -6
  26. package/dist/react/client.d.ts +187 -16
  27. package/dist/react/index.d.ts +1 -1
  28. package/dist/react/plugin-client.d.ts +9 -2
  29. package/dist/sdk/binding-store.d.ts +106 -1
  30. package/dist/sdk/index.d.ts +1 -1
  31. package/dist/sdk/invoke.d.ts +2 -0
  32. package/dist/sdk/plugin.d.ts +178 -114
  33. package/dist/sdk/probe-shape-real-servers.live.test.d.ts +1 -0
  34. package/dist/sdk/probe-shape.d.ts +17 -3
  35. package/dist/sdk/stored-source.d.ts +12 -11
  36. package/dist/sdk/types.d.ts +122 -17
  37. package/dist/{stdio-connector-KNHLETKM.js → stdio-connector-AA5S6UUJ.js} +1 -1
  38. package/dist/{stdio-connector-KNHLETKM.js.map → stdio-connector-AA5S6UUJ.js.map} +1 -1
  39. package/dist/testing/index.d.ts +1 -0
  40. package/dist/{sdk/test-utils.d.ts → testing/server.d.ts} +0 -6
  41. package/dist/testing.js +51 -0
  42. package/dist/testing.js.map +1 -0
  43. package/package.json +17 -4
  44. package/dist/chunk-C2GNZGFJ.js +0 -1622
  45. package/dist/chunk-C2GNZGFJ.js.map +0 -1
@@ -6,23 +6,125 @@ export type McpRemoteTransport = typeof McpRemoteTransport.Type;
6
6
  /** All transport types (used in the connector layer) */
7
7
  export declare const McpTransport: Schema.Literals<readonly ["streamable-http", "sse", "stdio", "auto"]>;
8
8
  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 McpCredentialInput: Schema.Union<readonly [Schema.Struct<{
16
+ readonly secretId: Schema.String;
17
+ readonly prefix: Schema.optional<Schema.String>;
18
+ readonly targetScope: Schema.brand<Schema.String, "ScopeId">;
19
+ readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
20
+ }>, Schema.Union<readonly [Schema.String, Schema.Struct<{
21
+ readonly secretId: Schema.String;
22
+ readonly prefix: Schema.optional<Schema.String>;
23
+ }>]>, Schema.Union<readonly [Schema.String, Schema.Struct<{
24
+ readonly kind: Schema.Literal<"binding">;
25
+ readonly slot: Schema.String;
26
+ readonly prefix: Schema.optional<Schema.String>;
27
+ }>]>]>;
28
+ export type McpCredentialInput = typeof McpCredentialInput.Type;
29
+ export declare const mcpHeaderSlot: (name: string) => string;
30
+ export declare const mcpQueryParamSlot: (name: string) => string;
31
+ export declare const MCP_HEADER_AUTH_SLOT = "auth:header";
32
+ export declare const MCP_OAUTH_CONNECTION_SLOT = "auth:oauth2:connection";
33
+ export declare const MCP_OAUTH_CLIENT_ID_SLOT = "auth:oauth2:client-id";
34
+ export declare const MCP_OAUTH_CLIENT_SECRET_SLOT = "auth:oauth2:client-secret";
9
35
  /** JSON object loosely typed — used for opaque OAuth state we just round-trip. */
10
36
  declare const JsonObject: Schema.$Record<Schema.String, Schema.Unknown>;
11
37
  export { JsonObject as McpJsonObject };
12
38
  export declare const McpConnectionAuth: Schema.Union<readonly [Schema.Struct<{
13
39
  readonly kind: Schema.Literal<"none">;
14
40
  }>, Schema.Struct<{
41
+ readonly kind: Schema.Literal<"header">;
42
+ readonly headerName: Schema.String;
43
+ readonly secretSlot: Schema.String;
44
+ readonly prefix: Schema.optional<Schema.String>;
45
+ }>, Schema.Struct<{
46
+ readonly kind: Schema.Literal<"oauth2">;
47
+ readonly connectionSlot: Schema.String;
48
+ readonly clientIdSlot: Schema.optional<Schema.String>;
49
+ readonly clientSecretSlot: Schema.optional<Schema.String>;
50
+ }>]>;
51
+ export type McpConnectionAuth = typeof McpConnectionAuth.Type;
52
+ export declare const McpConnectionAuthInput: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
53
+ readonly kind: Schema.Literal<"none">;
54
+ }>, Schema.Struct<{
55
+ readonly kind: Schema.Literal<"header">;
56
+ readonly headerName: Schema.String;
57
+ readonly secretSlot: Schema.String;
58
+ readonly prefix: Schema.optional<Schema.String>;
59
+ }>, Schema.Struct<{
60
+ readonly kind: Schema.Literal<"oauth2">;
61
+ readonly connectionSlot: Schema.String;
62
+ readonly clientIdSlot: Schema.optional<Schema.String>;
63
+ readonly clientSecretSlot: Schema.optional<Schema.String>;
64
+ }>]>, Schema.Struct<{
15
65
  readonly kind: Schema.Literal<"header">;
16
66
  readonly headerName: Schema.String;
17
67
  readonly secretId: Schema.String;
18
68
  readonly prefix: Schema.optional<Schema.String>;
69
+ readonly targetScope: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
70
+ readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
19
71
  }>, Schema.Struct<{
20
72
  readonly kind: Schema.Literal<"oauth2">;
21
73
  readonly connectionId: Schema.String;
22
74
  readonly clientIdSecretId: Schema.optional<Schema.String>;
23
75
  readonly clientSecretSecretId: Schema.optional<Schema.NullOr<Schema.String>>;
24
76
  }>]>;
25
- export type McpConnectionAuth = typeof McpConnectionAuth.Type;
77
+ export type McpConnectionAuthInput = typeof McpConnectionAuthInput.Type;
78
+ export declare const McpSourceBindingValue: Schema.Union<readonly [Schema.Struct<{
79
+ readonly kind: Schema.Literal<"text">;
80
+ readonly text: Schema.String;
81
+ }>, Schema.Struct<{
82
+ readonly kind: Schema.Literal<"secret">;
83
+ readonly secretId: Schema.brand<Schema.String, "SecretId">;
84
+ readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
85
+ }>, Schema.Struct<{
86
+ readonly kind: Schema.Literal<"connection">;
87
+ readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
88
+ }>]>;
89
+ export type McpSourceBindingValue = typeof McpSourceBindingValue.Type;
90
+ export declare const McpSourceBindingInput: Schema.Struct<{
91
+ readonly sourceId: Schema.String;
92
+ readonly sourceScope: Schema.brand<Schema.String, "ScopeId">;
93
+ readonly scope: Schema.brand<Schema.String, "ScopeId">;
94
+ readonly slot: Schema.String;
95
+ readonly value: Schema.Union<readonly [Schema.Struct<{
96
+ readonly kind: Schema.Literal<"text">;
97
+ readonly text: Schema.String;
98
+ }>, Schema.Struct<{
99
+ readonly kind: Schema.Literal<"secret">;
100
+ readonly secretId: Schema.brand<Schema.String, "SecretId">;
101
+ readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
102
+ }>, Schema.Struct<{
103
+ readonly kind: Schema.Literal<"connection">;
104
+ readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
105
+ }>]>;
106
+ }>;
107
+ export type McpSourceBindingInput = typeof McpSourceBindingInput.Type;
108
+ export declare const McpSourceBindingRef: Schema.Struct<{
109
+ readonly sourceId: Schema.String;
110
+ readonly sourceScopeId: Schema.brand<Schema.String, "ScopeId">;
111
+ readonly scopeId: Schema.brand<Schema.String, "ScopeId">;
112
+ readonly slot: Schema.String;
113
+ readonly value: Schema.Union<readonly [Schema.Struct<{
114
+ readonly kind: Schema.Literal<"text">;
115
+ readonly text: Schema.String;
116
+ }>, Schema.Struct<{
117
+ readonly kind: Schema.Literal<"secret">;
118
+ readonly secretId: Schema.brand<Schema.String, "SecretId">;
119
+ readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
120
+ }>, Schema.Struct<{
121
+ readonly kind: Schema.Literal<"connection">;
122
+ readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
123
+ }>]>;
124
+ readonly createdAt: Schema.Date;
125
+ readonly updatedAt: Schema.Date;
126
+ }>;
127
+ export type McpSourceBindingRef = typeof McpSourceBindingRef.Type;
26
128
  export declare const McpRemoteSourceData: Schema.Struct<{
27
129
  readonly transport: Schema.Literal<"remote">;
28
130
  /** The MCP server endpoint URL */
@@ -31,12 +133,14 @@ export declare const McpRemoteSourceData: Schema.Struct<{
31
133
  readonly remoteTransport: Schema.withConstructorDefault<Schema.optionalKey<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>>;
32
134
  /** Extra query params appended to the endpoint URL */
33
135
  readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
34
- readonly secretId: Schema.String;
136
+ readonly kind: Schema.Literal<"binding">;
137
+ readonly slot: Schema.String;
35
138
  readonly prefix: Schema.optional<Schema.String>;
36
139
  }>]>>>;
37
140
  /** Extra headers sent on every request */
38
141
  readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
39
- readonly secretId: Schema.String;
142
+ readonly kind: Schema.Literal<"binding">;
143
+ readonly slot: Schema.String;
40
144
  readonly prefix: Schema.optional<Schema.String>;
41
145
  }>]>>>;
42
146
  /** Auth configuration */
@@ -45,13 +149,13 @@ export declare const McpRemoteSourceData: Schema.Struct<{
45
149
  }>, Schema.Struct<{
46
150
  readonly kind: Schema.Literal<"header">;
47
151
  readonly headerName: Schema.String;
48
- readonly secretId: Schema.String;
152
+ readonly secretSlot: Schema.String;
49
153
  readonly prefix: Schema.optional<Schema.String>;
50
154
  }>, Schema.Struct<{
51
155
  readonly kind: Schema.Literal<"oauth2">;
52
- readonly connectionId: Schema.String;
53
- readonly clientIdSecretId: Schema.optional<Schema.String>;
54
- readonly clientSecretSecretId: Schema.optional<Schema.NullOr<Schema.String>>;
156
+ readonly connectionSlot: Schema.String;
157
+ readonly clientIdSlot: Schema.optional<Schema.String>;
158
+ readonly clientSecretSlot: Schema.optional<Schema.String>;
55
159
  }>]>;
56
160
  }>;
57
161
  export type McpRemoteSourceData = typeof McpRemoteSourceData.Type;
@@ -75,12 +179,14 @@ export declare const McpStoredSourceData: Schema.Union<readonly [Schema.Struct<{
75
179
  readonly remoteTransport: Schema.withConstructorDefault<Schema.optionalKey<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>>;
76
180
  /** Extra query params appended to the endpoint URL */
77
181
  readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
78
- readonly secretId: Schema.String;
182
+ readonly kind: Schema.Literal<"binding">;
183
+ readonly slot: Schema.String;
79
184
  readonly prefix: Schema.optional<Schema.String>;
80
185
  }>]>>>;
81
186
  /** Extra headers sent on every request */
82
187
  readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
83
- readonly secretId: Schema.String;
188
+ readonly kind: Schema.Literal<"binding">;
189
+ readonly slot: Schema.String;
84
190
  readonly prefix: Schema.optional<Schema.String>;
85
191
  }>]>>>;
86
192
  /** Auth configuration */
@@ -89,13 +195,13 @@ export declare const McpStoredSourceData: Schema.Union<readonly [Schema.Struct<{
89
195
  }>, Schema.Struct<{
90
196
  readonly kind: Schema.Literal<"header">;
91
197
  readonly headerName: Schema.String;
92
- readonly secretId: Schema.String;
198
+ readonly secretSlot: Schema.String;
93
199
  readonly prefix: Schema.optional<Schema.String>;
94
200
  }>, Schema.Struct<{
95
201
  readonly kind: Schema.Literal<"oauth2">;
96
- readonly connectionId: Schema.String;
97
- readonly clientIdSecretId: Schema.optional<Schema.String>;
98
- readonly clientSecretSecretId: Schema.optional<Schema.NullOr<Schema.String>>;
202
+ readonly connectionSlot: Schema.String;
203
+ readonly clientIdSlot: Schema.optional<Schema.String>;
204
+ readonly clientSecretSlot: Schema.optional<Schema.String>;
99
205
  }>]>;
100
206
  }>, Schema.Struct<{
101
207
  readonly transport: Schema.Literal<"stdio">;
@@ -117,7 +223,7 @@ export declare const McpToolAnnotations: Schema.Struct<{
117
223
  readonly openWorldHint: Schema.optional<Schema.Boolean>;
118
224
  }>;
119
225
  export type McpToolAnnotations = typeof McpToolAnnotations.Type;
120
- declare const McpToolBinding_base: Schema.Class<McpToolBinding, Schema.Struct<{
226
+ export declare const McpToolBinding: Schema.Struct<{
121
227
  readonly toolId: Schema.String;
122
228
  readonly toolName: Schema.String;
123
229
  readonly description: Schema.NullOr<Schema.String>;
@@ -130,6 +236,5 @@ declare const McpToolBinding_base: Schema.Class<McpToolBinding, Schema.Struct<{
130
236
  readonly idempotentHint: Schema.optional<Schema.Boolean>;
131
237
  readonly openWorldHint: Schema.optional<Schema.Boolean>;
132
238
  }>>;
133
- }>, {}>;
134
- export declare class McpToolBinding extends McpToolBinding_base {
135
- }
239
+ }>;
240
+ export type McpToolBinding = typeof McpToolBinding.Type;
@@ -9,4 +9,4 @@ var createStdioTransport = (config) => new StdioClientTransport({
9
9
  export {
10
10
  createStdioTransport
11
11
  };
12
- //# sourceMappingURL=stdio-connector-KNHLETKM.js.map
12
+ //# sourceMappingURL=stdio-connector-AA5S6UUJ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sdk/stdio-connector.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Stdio transport factory — loaded only on demand\n// ---------------------------------------------------------------------------\n//\n// Kept in its own module so `connection.ts` never imports it eagerly at\n// module load. `@modelcontextprotocol/sdk/client/stdio.js` pulls in\n// `node:child_process` at evaluation time; under `@cloudflare/vitest-pool-workers`\n// that crashes workerd at module instantiation with SIGSEGV (prod bundles\n// tree-shake it away when `dangerouslyAllowStdioMCP: false`, tests do not).\n//\n// Callers that actually need stdio transport reach it via a dynamic import\n// in `connection.ts`. Remote-only consumers (cloud/marketing) never execute\n// the import and therefore never touch `node:child_process`.\n// ---------------------------------------------------------------------------\n\nimport { StdioClientTransport } from \"@modelcontextprotocol/sdk/client/stdio.js\";\n\nexport type StdioTransportConfig = {\n readonly command: string;\n readonly args?: ReadonlyArray<string>;\n readonly env?: Record<string, string>;\n readonly cwd?: string;\n};\n\nexport const createStdioTransport = (config: StdioTransportConfig) =>\n new StdioClientTransport({\n command: config.command,\n args: config.args ? [...config.args] : undefined,\n env: config.env\n ? ({ ...process.env, ...config.env } as Record<string, string>)\n : undefined,\n cwd: config.cwd,\n });\n"],"mappings":";AAeA,SAAS,4BAA4B;AAS9B,IAAM,uBAAuB,CAAC,WACnC,IAAI,qBAAqB;AAAA,EACvB,SAAS,OAAO;AAAA,EAChB,MAAM,OAAO,OAAO,CAAC,GAAG,OAAO,IAAI,IAAI;AAAA,EACvC,KAAK,OAAO,MACP,EAAE,GAAG,QAAQ,KAAK,GAAG,OAAO,IAAI,IACjC;AAAA,EACJ,KAAK,OAAO;AACd,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/sdk/stdio-connector.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Stdio transport factory — loaded only on demand\n// ---------------------------------------------------------------------------\n//\n// Kept in its own module so `connection.ts` never imports it eagerly at\n// module load. `@modelcontextprotocol/sdk/client/stdio.js` pulls in\n// `node:child_process` at evaluation time; under `@cloudflare/vitest-pool-workers`\n// that crashes workerd at module instantiation with SIGSEGV (prod bundles\n// tree-shake it away when `dangerouslyAllowStdioMCP: false`, tests do not).\n//\n// Callers that actually need stdio transport reach it via a dynamic import\n// in `connection.ts`. Remote-only consumers (cloud/marketing) never execute\n// the import and therefore never touch `node:child_process`.\n// ---------------------------------------------------------------------------\n\nimport { StdioClientTransport } from \"@modelcontextprotocol/sdk/client/stdio.js\";\n\nexport type StdioTransportConfig = {\n readonly command: string;\n readonly args?: ReadonlyArray<string>;\n readonly env?: Record<string, string>;\n readonly cwd?: string;\n};\n\nexport const createStdioTransport = (config: StdioTransportConfig) =>\n new StdioClientTransport({\n command: config.command,\n args: config.args ? [...config.args] : undefined,\n env: config.env ? ({ ...process.env, ...config.env } as Record<string, string>) : undefined,\n cwd: config.cwd,\n });\n"],"mappings":";AAeA,SAAS,4BAA4B;AAS9B,IAAM,uBAAuB,CAAC,WACnC,IAAI,qBAAqB;AAAA,EACvB,SAAS,OAAO;AAAA,EAChB,MAAM,OAAO,OAAO,CAAC,GAAG,OAAO,IAAI,IAAI;AAAA,EACvC,KAAK,OAAO,MAAO,EAAE,GAAG,QAAQ,KAAK,GAAG,OAAO,IAAI,IAA+B;AAAA,EAClF,KAAK,OAAO;AACd,CAAC;","names":[]}
@@ -0,0 +1 @@
1
+ export { serveMcpServer, type McpTestServer } from "./server";
@@ -7,10 +7,4 @@ export type McpTestServer = {
7
7
  /** Number of MCP sessions created (each connect = 1 session) */
8
8
  readonly sessionCount: () => number;
9
9
  };
10
- /**
11
- * Spin up a real HTTP server backed by a fresh `McpServer` per session,
12
- * with proper session routing via `mcp-session-id`. The factory is invoked
13
- * once per new session, so tools registered inside it are isolated per
14
- * connection (matching the SDK's own server/transport coupling).
15
- */
16
10
  export declare const serveMcpServer: (factory: () => McpServer) => Effect.Effect<McpTestServer, Error, import("effect/Scope").Scope>;
@@ -0,0 +1,51 @@
1
+ // src/testing/server.ts
2
+ import { Effect } from "effect";
3
+ import * as http from "http";
4
+ import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
5
+ var serveMcpServer = (factory) => Effect.acquireRelease(
6
+ Effect.callback((resume) => {
7
+ const transports = /* @__PURE__ */ new Map();
8
+ let sessions = 0;
9
+ const httpServer = http.createServer(async (req, res) => {
10
+ const sessionId = req.headers["mcp-session-id"];
11
+ if (sessionId) {
12
+ const transport2 = transports.get(sessionId);
13
+ if (!transport2) {
14
+ res.writeHead(404);
15
+ res.end("Session not found");
16
+ return;
17
+ }
18
+ await transport2.handleRequest(req, res);
19
+ return;
20
+ }
21
+ const mcpServer = factory();
22
+ sessions++;
23
+ const transport = new StreamableHTTPServerTransport({
24
+ sessionIdGenerator: () => crypto.randomUUID(),
25
+ onsessioninitialized: (sid) => {
26
+ transports.set(sid, transport);
27
+ }
28
+ });
29
+ await mcpServer.connect(transport);
30
+ await transport.handleRequest(req, res);
31
+ });
32
+ httpServer.listen(0, () => {
33
+ const addr = httpServer.address();
34
+ const port = typeof addr === "object" && addr ? addr.port : 0;
35
+ resume(
36
+ Effect.succeed({
37
+ url: `http://127.0.0.1:${port}`,
38
+ httpServer,
39
+ sessionCount: () => sessions
40
+ })
41
+ );
42
+ });
43
+ }),
44
+ ({ httpServer }) => Effect.sync(() => {
45
+ httpServer.close();
46
+ })
47
+ );
48
+ export {
49
+ serveMcpServer
50
+ };
51
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/testing/server.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport * as http from \"node:http\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StreamableHTTPServerTransport } from \"@modelcontextprotocol/sdk/server/streamableHttp.js\";\n\nexport type McpTestServer = {\n readonly url: string;\n readonly httpServer: http.Server;\n /** Number of MCP sessions created (each connect = 1 session) */\n readonly sessionCount: () => number;\n};\n\nexport const serveMcpServer = (factory: () => McpServer) =>\n Effect.acquireRelease(\n Effect.callback<McpTestServer, Error>((resume) => {\n const transports = new Map<string, StreamableHTTPServerTransport>();\n let sessions = 0;\n\n const httpServer = http.createServer(async (req, res) => {\n const sessionId = req.headers[\"mcp-session-id\"] as string | undefined;\n\n if (sessionId) {\n const transport = transports.get(sessionId);\n if (!transport) {\n res.writeHead(404);\n res.end(\"Session not found\");\n return;\n }\n await transport.handleRequest(req, res);\n return;\n }\n\n const mcpServer = factory();\n sessions++;\n\n const transport = new StreamableHTTPServerTransport({\n sessionIdGenerator: () => crypto.randomUUID(),\n onsessioninitialized: (sid) => {\n transports.set(sid, transport);\n },\n });\n\n await mcpServer.connect(transport);\n await transport.handleRequest(req, res);\n });\n\n httpServer.listen(0, () => {\n const addr = httpServer.address();\n const port = typeof addr === \"object\" && addr ? addr.port : 0;\n resume(\n Effect.succeed({\n url: `http://127.0.0.1:${port}`,\n httpServer,\n sessionCount: () => sessions,\n }),\n );\n });\n }),\n ({ httpServer }) =>\n Effect.sync(() => {\n httpServer.close();\n }),\n );\n"],"mappings":";AAAA,SAAS,cAAc;AACvB,YAAY,UAAU;AAEtB,SAAS,qCAAqC;AASvC,IAAM,iBAAiB,CAAC,YAC7B,OAAO;AAAA,EACL,OAAO,SAA+B,CAAC,WAAW;AAChD,UAAM,aAAa,oBAAI,IAA2C;AAClE,QAAI,WAAW;AAEf,UAAM,aAAkB,kBAAa,OAAO,KAAK,QAAQ;AACvD,YAAM,YAAY,IAAI,QAAQ,gBAAgB;AAE9C,UAAI,WAAW;AACb,cAAMA,aAAY,WAAW,IAAI,SAAS;AAC1C,YAAI,CAACA,YAAW;AACd,cAAI,UAAU,GAAG;AACjB,cAAI,IAAI,mBAAmB;AAC3B;AAAA,QACF;AACA,cAAMA,WAAU,cAAc,KAAK,GAAG;AACtC;AAAA,MACF;AAEA,YAAM,YAAY,QAAQ;AAC1B;AAEA,YAAM,YAAY,IAAI,8BAA8B;AAAA,QAClD,oBAAoB,MAAM,OAAO,WAAW;AAAA,QAC5C,sBAAsB,CAAC,QAAQ;AAC7B,qBAAW,IAAI,KAAK,SAAS;AAAA,QAC/B;AAAA,MACF,CAAC;AAED,YAAM,UAAU,QAAQ,SAAS;AACjC,YAAM,UAAU,cAAc,KAAK,GAAG;AAAA,IACxC,CAAC;AAED,eAAW,OAAO,GAAG,MAAM;AACzB,YAAM,OAAO,WAAW,QAAQ;AAChC,YAAM,OAAO,OAAO,SAAS,YAAY,OAAO,KAAK,OAAO;AAC5D;AAAA,QACE,OAAO,QAAQ;AAAA,UACb,KAAK,oBAAoB,IAAI;AAAA,UAC7B;AAAA,UACA,cAAc,MAAM;AAAA,QACtB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAAA,EACD,CAAC,EAAE,WAAW,MACZ,OAAO,KAAK,MAAM;AAChB,eAAW,MAAM;AAAA,EACnB,CAAC;AACL;","names":["transport"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@executor-js/plugin-mcp",
3
- "version": "0.1.0",
3
+ "version": "1.4.20",
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"
@@ -27,6 +27,18 @@
27
27
  "types": "./dist/sdk/index.d.ts",
28
28
  "default": "./dist/core.js"
29
29
  }
30
+ },
31
+ "./client": {
32
+ "import": {
33
+ "types": "./dist/react/plugin-client.d.ts",
34
+ "default": "./dist/client.js"
35
+ }
36
+ },
37
+ "./testing": {
38
+ "import": {
39
+ "types": "./dist/testing/index.d.ts",
40
+ "default": "./dist/testing.js"
41
+ }
30
42
  }
31
43
  },
32
44
  "publishConfig": {
@@ -40,16 +52,17 @@
40
52
  "typecheck:slow": "bunx tsc --noEmit -p tsconfig.json"
41
53
  },
42
54
  "dependencies": {
55
+ "@cfworker/json-schema": "^4.1.1",
43
56
  "@effect/platform-node": "4.0.0-beta.59",
44
- "@executor-js/config": "0.1.0",
45
- "@executor-js/sdk": "0.1.0",
57
+ "@executor-js/config": "1.4.20",
58
+ "@executor-js/sdk": "1.4.20",
46
59
  "@modelcontextprotocol/sdk": "^1.29.0",
47
60
  "effect": "4.0.0-beta.59"
48
61
  },
49
62
  "devDependencies": {
50
63
  "@effect/atom-react": "4.0.0-beta.59",
51
64
  "@effect/vitest": "4.0.0-beta.59",
52
- "@executor-js/storage-core": "0.1.0",
65
+ "@executor-js/storage-core": "1.4.20",
53
66
  "@types/node": "^24.3.1",
54
67
  "@types/react": "^19.1.0",
55
68
  "bun-types": "^1.2.22",