@executor-js/plugin-mcp 0.0.1 → 0.0.2
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/README.md +19 -15
- package/dist/api/group.d.ts +113 -144
- package/dist/api/handlers.d.ts +2 -2
- package/dist/chunk-DJANY5EU.js +1325 -0
- package/dist/chunk-DJANY5EU.js.map +1 -0
- package/dist/core.js +8 -52
- package/dist/core.js.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/promise.d.ts +2 -6
- package/dist/react/AddMcpSource.d.ts +2 -0
- package/dist/react/McpSignInButton.d.ts +3 -0
- package/dist/react/atoms.d.ts +153 -0
- package/dist/react/client.d.ts +437 -3
- package/dist/react/index.d.ts +3 -2
- package/dist/react/source-plugin.d.ts +13 -1
- package/dist/sdk/binding-store.d.ts +79 -25
- package/dist/sdk/connection-pool.test.d.ts +1 -0
- package/dist/sdk/connection.d.ts +3 -1
- package/dist/sdk/cross-user-isolation.test.d.ts +1 -0
- package/dist/sdk/errors.d.ts +15 -23
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/invoke.d.ts +18 -17
- package/dist/sdk/manifest.d.ts +1 -0
- package/dist/sdk/per-user-auth-isolation.test.d.ts +1 -0
- package/dist/sdk/plugin.d.ts +108 -43
- package/dist/sdk/probe-shape.d.ts +39 -0
- package/dist/sdk/probe-shape.test.d.ts +1 -0
- package/dist/sdk/stdio-connector.d.ts +8 -0
- package/dist/sdk/stored-source.d.ts +31 -105
- package/dist/sdk/types.d.ts +77 -93
- package/dist/stdio-connector-KNHLETKM.js +12 -0
- package/dist/stdio-connector-KNHLETKM.js.map +1 -0
- package/package.json +11 -21
- package/dist/chunk-X3JTTDWJ.js +0 -1255
- package/dist/chunk-X3JTTDWJ.js.map +0 -1
- package/dist/react/McpSourceSummary.d.ts +0 -3
- package/dist/sdk/config-file-store.d.ts +0 -10
- package/dist/sdk/oauth.d.ts +0 -40
package/README.md
CHANGED
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
# @executor/plugin-mcp
|
|
1
|
+
# @executor-js/plugin-mcp
|
|
2
2
|
|
|
3
3
|
Register [Model Context Protocol](https://modelcontextprotocol.io) servers as tool sources for an executor. Supports both stdio-launched servers and remote (HTTP) servers, with optional OAuth.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
bun add @executor/sdk @executor/plugin-mcp
|
|
8
|
+
bun add @executor-js/sdk @executor-js/plugin-mcp
|
|
9
9
|
# or
|
|
10
|
-
npm install @executor/sdk @executor/plugin-mcp
|
|
10
|
+
npm install @executor-js/sdk @executor-js/plugin-mcp
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
import { createExecutor } from "@executor/sdk";
|
|
17
|
-
import { mcpPlugin } from "@executor/plugin-mcp";
|
|
16
|
+
import { createExecutor } from "@executor-js/sdk";
|
|
17
|
+
import { mcpPlugin } from "@executor-js/plugin-mcp";
|
|
18
18
|
|
|
19
19
|
const executor = await createExecutor({
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
onElicitation: "accept-all",
|
|
21
|
+
// Stdio sources spawn a local subprocess and inherit `process.env` —
|
|
22
|
+
// only enable for trusted single-user contexts.
|
|
23
|
+
plugins: [mcpPlugin({ dangerouslyAllowStdioMCP: true })] as const,
|
|
22
24
|
});
|
|
23
25
|
|
|
26
|
+
const scope = executor.scopes[0]!.id;
|
|
27
|
+
|
|
24
28
|
// Remote MCP server
|
|
25
29
|
await executor.mcp.addSource({
|
|
30
|
+
scope,
|
|
26
31
|
transport: "remote",
|
|
27
32
|
name: "Context7",
|
|
28
33
|
endpoint: "https://mcp.context7.com/mcp",
|
|
29
34
|
});
|
|
30
35
|
|
|
31
|
-
// Stdio MCP server
|
|
36
|
+
// Stdio MCP server (requires `dangerouslyAllowStdioMCP: true` above)
|
|
32
37
|
await executor.mcp.addSource({
|
|
38
|
+
scope,
|
|
33
39
|
transport: "stdio",
|
|
34
40
|
name: "My Server",
|
|
35
41
|
command: "npx",
|
|
@@ -39,19 +45,17 @@ await executor.mcp.addSource({
|
|
|
39
45
|
// Every MCP tool is now part of the unified catalog
|
|
40
46
|
const tools = await executor.tools.list();
|
|
41
47
|
|
|
42
|
-
const result = await executor.tools.invoke(
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
{ onElicitation: "accept-all" },
|
|
46
|
-
);
|
|
48
|
+
const result = await executor.tools.invoke("context7.searchLibraries", {
|
|
49
|
+
query: "effect-ts",
|
|
50
|
+
});
|
|
47
51
|
```
|
|
48
52
|
|
|
49
53
|
## Using with Effect
|
|
50
54
|
|
|
51
|
-
If you're building on `@executor/sdk` (the raw Effect entry), import this plugin from its `/core` subpath instead:
|
|
55
|
+
If you're building on `@executor-js/sdk/core` (the raw Effect entry), import this plugin from its `/core` subpath instead — it returns the Effect-shaped plugin with `Effect.Effect<...>`-returning methods rather than promisified wrappers:
|
|
52
56
|
|
|
53
57
|
```ts
|
|
54
|
-
import { mcpPlugin } from "@executor/plugin-mcp";
|
|
58
|
+
import { mcpPlugin } from "@executor-js/plugin-mcp/core";
|
|
55
59
|
```
|
|
56
60
|
|
|
57
61
|
## Status
|
package/dist/api/group.d.ts
CHANGED
|
@@ -1,146 +1,115 @@
|
|
|
1
|
-
import { HttpApiEndpoint, HttpApiGroup
|
|
1
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
+
import { InternalError } from "@executor-js/api";
|
|
4
|
+
import { McpConnectionError, McpToolDiscoveryError } from "../sdk/errors";
|
|
3
5
|
import { McpStoredSourceSchema } from "../sdk/stored-source";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
readonly
|
|
21
|
-
|
|
22
|
-
readonly
|
|
23
|
-
}, never, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
|
|
31
|
-
readonly
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
readonly
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
readonly
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
readonly
|
|
46
|
-
}
|
|
47
|
-
readonly
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
readonly
|
|
53
|
-
readonly
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
|
|
64
|
-
readonly
|
|
65
|
-
readonly
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
readonly
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
readonly namespace:
|
|
76
|
-
}
|
|
77
|
-
readonly
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
readonly
|
|
86
|
-
|
|
87
|
-
readonly
|
|
88
|
-
|
|
89
|
-
readonly
|
|
90
|
-
}
|
|
91
|
-
readonly
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
readonly namespace: string;
|
|
115
|
-
}, never, never, never, McpStoredSourceSchema | null, McpApiError | McpInternalError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateSource", "PATCH", {
|
|
116
|
-
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
117
|
-
readonly namespace: string;
|
|
118
|
-
}, never, {
|
|
119
|
-
readonly name?: string | undefined;
|
|
120
|
-
readonly endpoint?: string | undefined;
|
|
121
|
-
readonly queryParams?: {
|
|
122
|
-
readonly [x: string]: string;
|
|
123
|
-
} | undefined;
|
|
124
|
-
readonly headers?: {
|
|
125
|
-
readonly [x: string]: string;
|
|
126
|
-
} | undefined;
|
|
127
|
-
readonly auth?: {
|
|
128
|
-
readonly kind: "none";
|
|
129
|
-
} | {
|
|
130
|
-
readonly secretId: string;
|
|
131
|
-
readonly kind: "header";
|
|
132
|
-
readonly headerName: string;
|
|
133
|
-
readonly prefix?: string | undefined;
|
|
134
|
-
} | {
|
|
135
|
-
readonly kind: "oauth2";
|
|
136
|
-
readonly scope: string | null;
|
|
137
|
-
readonly accessTokenSecretId: string;
|
|
138
|
-
readonly refreshTokenSecretId: string | null;
|
|
139
|
-
readonly tokenType?: string | undefined;
|
|
140
|
-
readonly expiresAt: number | null;
|
|
141
|
-
} | undefined;
|
|
142
|
-
}, never, {
|
|
143
|
-
readonly updated: boolean;
|
|
144
|
-
}, McpApiError | McpInternalError, never, never>, never, never, false>;
|
|
145
|
-
export declare class McpGroup extends McpGroup_base {
|
|
146
|
-
}
|
|
6
|
+
export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.HttpApiEndpoint<"probeEndpoint", "POST", "/scopes/:scopeId/mcp/probe", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
7
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
8
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
9
|
+
readonly endpoint: Schema.String;
|
|
10
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
11
|
+
readonly secretId: Schema.String;
|
|
12
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
13
|
+
}>]>>>;
|
|
14
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
15
|
+
readonly secretId: Schema.String;
|
|
16
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
17
|
+
}>]>>>;
|
|
18
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
19
|
+
readonly connected: Schema.Boolean;
|
|
20
|
+
readonly requiresOAuth: Schema.Boolean;
|
|
21
|
+
readonly name: Schema.String;
|
|
22
|
+
readonly namespace: Schema.String;
|
|
23
|
+
readonly toolCount: Schema.NullOr<Schema.Number>;
|
|
24
|
+
readonly serverName: Schema.NullOr<Schema.String>;
|
|
25
|
+
}>>, HttpApiEndpoint.Json<typeof McpConnectionError | typeof McpToolDiscoveryError | typeof InternalError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"addSource", "POST", "/scopes/:scopeId/mcp/sources", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
26
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
27
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Union<readonly [Schema.Struct<{
|
|
28
|
+
readonly transport: Schema.Literal<"remote">;
|
|
29
|
+
readonly name: Schema.String;
|
|
30
|
+
readonly endpoint: Schema.String;
|
|
31
|
+
readonly remoteTransport: Schema.optional<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>;
|
|
32
|
+
readonly namespace: Schema.optional<Schema.String>;
|
|
33
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
34
|
+
readonly secretId: Schema.String;
|
|
35
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
36
|
+
}>]>>>;
|
|
37
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
38
|
+
readonly secretId: Schema.String;
|
|
39
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
40
|
+
}>]>>>;
|
|
41
|
+
readonly auth: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
42
|
+
readonly kind: Schema.Literal<"none">;
|
|
43
|
+
}>, Schema.Struct<{
|
|
44
|
+
readonly kind: Schema.Literal<"header">;
|
|
45
|
+
readonly headerName: Schema.String;
|
|
46
|
+
readonly secretId: Schema.String;
|
|
47
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
48
|
+
}>, Schema.Struct<{
|
|
49
|
+
readonly kind: Schema.Literal<"oauth2">;
|
|
50
|
+
/** Stable id of the SDK Connection minted by `completeOAuth`. The
|
|
51
|
+
* backing access/refresh secrets live on the connection row; the
|
|
52
|
+
* source only needs this pointer. */
|
|
53
|
+
readonly connectionId: Schema.String;
|
|
54
|
+
readonly clientIdSecretId: Schema.optional<Schema.String>;
|
|
55
|
+
readonly clientSecretSecretId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
56
|
+
}>]>>;
|
|
57
|
+
}>, Schema.Struct<{
|
|
58
|
+
readonly transport: Schema.Literal<"stdio">;
|
|
59
|
+
readonly name: Schema.String;
|
|
60
|
+
readonly command: Schema.String;
|
|
61
|
+
readonly args: Schema.optional<Schema.$Array<Schema.String>>;
|
|
62
|
+
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
63
|
+
readonly cwd: Schema.optional<Schema.String>;
|
|
64
|
+
readonly namespace: Schema.optional<Schema.String>;
|
|
65
|
+
}>]>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
66
|
+
readonly toolCount: Schema.Number;
|
|
67
|
+
readonly namespace: Schema.String;
|
|
68
|
+
}>>, HttpApiEndpoint.Json<typeof McpConnectionError | typeof McpToolDiscoveryError | typeof InternalError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"removeSource", "POST", "/scopes/:scopeId/mcp/sources/remove", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
69
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
70
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
71
|
+
readonly namespace: Schema.String;
|
|
72
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
73
|
+
readonly removed: Schema.Boolean;
|
|
74
|
+
}>>, HttpApiEndpoint.Json<typeof McpConnectionError | typeof McpToolDiscoveryError | typeof InternalError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"refreshSource", "POST", "/scopes/:scopeId/mcp/sources/refresh", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
75
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
76
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
77
|
+
readonly namespace: Schema.String;
|
|
78
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
79
|
+
readonly toolCount: Schema.Number;
|
|
80
|
+
}>>, HttpApiEndpoint.Json<typeof McpConnectionError | typeof McpToolDiscoveryError | typeof InternalError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getSource", "GET", "/scopes/:scopeId/mcp/sources/:namespace", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
81
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
82
|
+
namespace: Schema.String;
|
|
83
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.NullOr<typeof McpStoredSourceSchema>>, HttpApiEndpoint.Json<typeof McpConnectionError | typeof McpToolDiscoveryError | typeof InternalError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateSource", "PATCH", "/scopes/:scopeId/mcp/sources/:namespace", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
84
|
+
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
85
|
+
namespace: Schema.String;
|
|
86
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
87
|
+
readonly name: Schema.optional<Schema.String>;
|
|
88
|
+
readonly endpoint: Schema.optional<Schema.String>;
|
|
89
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
90
|
+
readonly secretId: Schema.String;
|
|
91
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
92
|
+
}>]>>>;
|
|
93
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
94
|
+
readonly secretId: Schema.String;
|
|
95
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
96
|
+
}>]>>>;
|
|
97
|
+
readonly auth: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
98
|
+
readonly kind: Schema.Literal<"none">;
|
|
99
|
+
}>, Schema.Struct<{
|
|
100
|
+
readonly kind: Schema.Literal<"header">;
|
|
101
|
+
readonly headerName: Schema.String;
|
|
102
|
+
readonly secretId: Schema.String;
|
|
103
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
104
|
+
}>, Schema.Struct<{
|
|
105
|
+
readonly kind: Schema.Literal<"oauth2">;
|
|
106
|
+
/** Stable id of the SDK Connection minted by `completeOAuth`. The
|
|
107
|
+
* backing access/refresh secrets live on the connection row; the
|
|
108
|
+
* source only needs this pointer. */
|
|
109
|
+
readonly connectionId: Schema.String;
|
|
110
|
+
readonly clientIdSecretId: Schema.optional<Schema.String>;
|
|
111
|
+
readonly clientSecretSecretId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
112
|
+
}>]>>;
|
|
113
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
114
|
+
readonly updated: Schema.Boolean;
|
|
115
|
+
}>>, HttpApiEndpoint.Json<typeof McpConnectionError | typeof McpToolDiscoveryError | typeof InternalError>, never, never>, false>;
|
package/dist/api/handlers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context } from "effect";
|
|
2
2
|
import type { McpPluginExtension } from "../sdk/plugin";
|
|
3
|
-
declare const McpExtensionService_base: Context.
|
|
3
|
+
declare const McpExtensionService_base: Context.ServiceClass<McpExtensionService, "McpExtensionService", McpPluginExtension>;
|
|
4
4
|
export declare class McpExtensionService extends McpExtensionService_base {
|
|
5
5
|
}
|
|
6
|
-
export declare const McpHandlers: import("effect/Layer").Layer<import("
|
|
6
|
+
export declare const McpHandlers: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<"executor", "mcp">, never, import("effect/unstable/http/HttpRouter").Request<"Requires", McpExtensionService>>;
|
|
7
7
|
export {};
|