@executor-js/plugin-mcp 0.0.1 → 0.1.0

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 (41) hide show
  1. package/README.md +19 -15
  2. package/dist/api/group.d.ts +113 -144
  3. package/dist/api/handlers.d.ts +2 -2
  4. package/dist/chunk-C2GNZGFJ.js +1622 -0
  5. package/dist/chunk-C2GNZGFJ.js.map +1 -0
  6. package/dist/core.js +8 -52
  7. package/dist/core.js.map +1 -1
  8. package/dist/index.js +2 -5
  9. package/dist/index.js.map +1 -1
  10. package/dist/promise.d.ts +2 -6
  11. package/dist/react/AddMcpSource.d.ts +2 -0
  12. package/dist/react/McpSignInButton.d.ts +3 -0
  13. package/dist/react/atoms.d.ts +153 -0
  14. package/dist/react/client.d.ts +104 -3
  15. package/dist/react/index.d.ts +3 -2
  16. package/dist/react/plugin-client.d.ts +2 -0
  17. package/dist/react/source-plugin.d.ts +13 -1
  18. package/dist/sdk/binding-store.d.ts +83 -25
  19. package/dist/sdk/connection-pool.test.d.ts +1 -0
  20. package/dist/sdk/connection.d.ts +3 -1
  21. package/dist/sdk/cross-user-isolation.test.d.ts +1 -0
  22. package/dist/sdk/errors.d.ts +15 -23
  23. package/dist/sdk/index.d.ts +3 -3
  24. package/dist/sdk/invoke.d.ts +18 -17
  25. package/dist/sdk/manifest.d.ts +3 -0
  26. package/dist/sdk/per-user-auth-isolation.test.d.ts +1 -0
  27. package/dist/sdk/plugin.d.ts +238 -43
  28. package/dist/sdk/probe-shape.d.ts +39 -0
  29. package/dist/sdk/probe-shape.test.d.ts +1 -0
  30. package/dist/sdk/stdio-connector.d.ts +8 -0
  31. package/dist/sdk/stored-source.d.ts +31 -105
  32. package/dist/sdk/test-utils.d.ts +16 -0
  33. package/dist/sdk/types.d.ts +92 -93
  34. package/dist/stdio-connector-KNHLETKM.js +12 -0
  35. package/dist/stdio-connector-KNHLETKM.js.map +1 -0
  36. package/package.json +11 -21
  37. package/dist/chunk-X3JTTDWJ.js +0 -1255
  38. package/dist/chunk-X3JTTDWJ.js.map +0 -1
  39. package/dist/react/McpSourceSummary.d.ts +0 -3
  40. package/dist/sdk/config-file-store.d.ts +0 -10
  41. package/dist/sdk/oauth.d.ts +0 -40
@@ -1,3 +1,104 @@
1
- import { AtomHttpApi } from "@effect-atom/atom-react";
2
- import { McpGroup } from "../api/group";
3
- export declare const McpClient: AtomHttpApi.AtomHttpApiClient<"McpClient", "McpClient", typeof McpGroup | typeof import("@executor/api").ToolsApi | typeof import("@executor/api").SourcesApi | typeof import("@executor/api").SecretsApi | typeof import("@executor/api").ExecutionsApi | typeof import("@executor/api").ScopeApi, import("@effect/platform/HttpApiError").HttpApiDecodeError, never>;
1
+ export declare const McpClient: import("effect/unstable/reactivity/AtomHttpApi").AtomHttpApiClient<"Plugin_mcpClient", `Plugin_${string}Client`, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"mcp", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"probeEndpoint", "POST", "/scopes/:scopeId/mcp/probe", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
2
+ scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
3
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
4
+ readonly endpoint: import("effect/Schema").String;
5
+ 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<{
6
+ readonly secretId: import("effect/Schema").String;
7
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
8
+ }>]>>>;
9
+ 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<{
10
+ readonly secretId: import("effect/Schema").String;
11
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
12
+ }>]>>>;
13
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
14
+ readonly connected: import("effect/Schema").Boolean;
15
+ readonly requiresOAuth: import("effect/Schema").Boolean;
16
+ readonly name: import("effect/Schema").String;
17
+ readonly namespace: import("effect/Schema").String;
18
+ readonly toolCount: import("effect/Schema").NullOr<import("effect/Schema").Number>;
19
+ readonly serverName: import("effect/Schema").NullOr<import("effect/Schema").String>;
20
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").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<{
21
+ scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
22
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
23
+ readonly transport: import("effect/Schema").Literal<"remote">;
24
+ readonly name: import("effect/Schema").String;
25
+ readonly endpoint: import("effect/Schema").String;
26
+ readonly remoteTransport: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["streamable-http", "sse", "auto"]>>;
27
+ readonly namespace: import("effect/Schema").optional<import("effect/Schema").String>;
28
+ 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<{
29
+ readonly secretId: import("effect/Schema").String;
30
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
31
+ }>]>>>;
32
+ 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<{
33
+ readonly secretId: import("effect/Schema").String;
34
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
35
+ }>]>>>;
36
+ readonly auth: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
37
+ readonly kind: import("effect/Schema").Literal<"none">;
38
+ }>, import("effect/Schema").Struct<{
39
+ readonly kind: import("effect/Schema").Literal<"header">;
40
+ readonly headerName: import("effect/Schema").String;
41
+ readonly secretId: import("effect/Schema").String;
42
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
43
+ }>, import("effect/Schema").Struct<{
44
+ readonly kind: import("effect/Schema").Literal<"oauth2">;
45
+ readonly connectionId: import("effect/Schema").String;
46
+ readonly clientIdSecretId: import("effect/Schema").optional<import("effect/Schema").String>;
47
+ readonly clientSecretSecretId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
48
+ }>]>>;
49
+ }>, import("effect/Schema").Struct<{
50
+ readonly transport: import("effect/Schema").Literal<"stdio">;
51
+ readonly name: import("effect/Schema").String;
52
+ readonly command: import("effect/Schema").String;
53
+ readonly args: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
54
+ readonly env: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
55
+ readonly cwd: import("effect/Schema").optional<import("effect/Schema").String>;
56
+ readonly namespace: import("effect/Schema").optional<import("effect/Schema").String>;
57
+ }>]>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
58
+ readonly toolCount: import("effect/Schema").Number;
59
+ readonly namespace: import("effect/Schema").String;
60
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").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<{
61
+ scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
62
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
63
+ readonly namespace: import("effect/Schema").String;
64
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
65
+ readonly removed: import("effect/Schema").Boolean;
66
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").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<{
67
+ scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
68
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
69
+ readonly namespace: import("effect/Schema").String;
70
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
71
+ readonly toolCount: import("effect/Schema").Number;
72
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").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<{
73
+ scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
74
+ namespace: import("effect/Schema").String;
75
+ }>>, 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("../sdk/stored-source").McpStoredSourceSchema>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").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<{
76
+ scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
77
+ namespace: import("effect/Schema").String;
78
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
79
+ readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
80
+ readonly endpoint: import("effect/Schema").optional<import("effect/Schema").String>;
81
+ 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<{
82
+ readonly secretId: import("effect/Schema").String;
83
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
84
+ }>]>>>;
85
+ 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<{
86
+ readonly secretId: import("effect/Schema").String;
87
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
88
+ }>]>>>;
89
+ readonly auth: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
90
+ readonly kind: import("effect/Schema").Literal<"none">;
91
+ }>, import("effect/Schema").Struct<{
92
+ readonly kind: import("effect/Schema").Literal<"header">;
93
+ readonly headerName: import("effect/Schema").String;
94
+ readonly secretId: import("effect/Schema").String;
95
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
96
+ }>, import("effect/Schema").Struct<{
97
+ readonly kind: import("effect/Schema").Literal<"oauth2">;
98
+ readonly connectionId: import("effect/Schema").String;
99
+ readonly clientIdSecretId: import("effect/Schema").optional<import("effect/Schema").String>;
100
+ readonly clientSecretSecretId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
101
+ }>]>>;
102
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
103
+ readonly updated: import("effect/Schema").Boolean;
104
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").McpToolDiscoveryError>, never, never>, false>>;
@@ -1,3 +1,4 @@
1
- export { mcpSourcePlugin } from "./source-plugin";
1
+ export { mcpSourcePlugin, createMcpSourcePlugin } from "./source-plugin";
2
+ export type { McpSourcePluginOptions } from "./source-plugin";
2
3
  export { McpClient } from "./client";
3
- export { probeMcpEndpoint, addMcpSource, removeMcpSource, refreshMcpSource, startMcpOAuth, completeMcpOAuth, } from "./atoms";
4
+ export { probeMcpEndpoint, addMcpSource, removeMcpSource, refreshMcpSource, } from "./atoms";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@executor-js/sdk/client").ClientPluginSpec<"mcp">;
2
+ export default _default;
@@ -1,2 +1,14 @@
1
- import type { SourcePlugin } from "@executor/react/plugins/source-plugin";
1
+ import type { SourcePlugin } from "@executor-js/sdk/client";
2
+ export interface McpSourcePluginOptions {
3
+ /**
4
+ * Enable the stdio transport in the add-source UI (tab + presets).
5
+ *
6
+ * Off by default — stdio is a high-risk transport on any server deployment
7
+ * (see `dangerouslyAllowStdioMCP` on the server-side plugin). Only enable in
8
+ * trusted local contexts where the server has the matching flag set.
9
+ */
10
+ readonly allowStdio?: boolean;
11
+ }
12
+ export declare const createMcpSourcePlugin: (options?: McpSourcePluginOptions) => SourcePlugin;
13
+ /** @deprecated Use `createMcpSourcePlugin({ allowStdio })` instead. */
2
14
  export declare const mcpSourcePlugin: SourcePlugin;
@@ -1,28 +1,86 @@
1
1
  import { Effect } from "effect";
2
- import { type Kv, type ToolId } from "@executor-js/sdk";
3
- import { McpToolBinding } from "./types";
4
- import type { McpStoredSourceData } from "./types";
5
- import { McpOAuthSession } from "./oauth";
6
- import { McpStoredSourceSchema } from "./stored-source";
7
- export declare const MCP_OAUTH_SESSION_TTL_MS: number;
8
- export type McpStoredSource = McpStoredSourceSchema;
2
+ import { type StorageDeps, type StorageFailure } from "@executor-js/sdk/core";
3
+ import { McpToolBinding, McpStoredSourceData } from "./types";
4
+ export declare const mcpSchema: {
5
+ readonly mcp_source: {
6
+ readonly fields: {
7
+ readonly id: {
8
+ readonly type: "string";
9
+ readonly required: true;
10
+ };
11
+ readonly scope_id: {
12
+ readonly type: "string";
13
+ readonly required: true;
14
+ readonly index: true;
15
+ };
16
+ readonly name: {
17
+ readonly type: "string";
18
+ readonly required: true;
19
+ };
20
+ readonly config: {
21
+ readonly type: "json";
22
+ readonly required: true;
23
+ };
24
+ readonly created_at: {
25
+ readonly type: "date";
26
+ readonly required: true;
27
+ };
28
+ };
29
+ };
30
+ readonly mcp_binding: {
31
+ readonly fields: {
32
+ readonly id: {
33
+ readonly type: "string";
34
+ readonly required: true;
35
+ };
36
+ readonly scope_id: {
37
+ readonly type: "string";
38
+ readonly required: true;
39
+ readonly index: true;
40
+ };
41
+ readonly source_id: {
42
+ readonly type: "string";
43
+ readonly required: true;
44
+ readonly index: true;
45
+ };
46
+ readonly binding: {
47
+ readonly type: "json";
48
+ readonly required: true;
49
+ };
50
+ readonly created_at: {
51
+ readonly type: "date";
52
+ readonly required: true;
53
+ };
54
+ };
55
+ };
56
+ };
57
+ export type McpSchema = typeof mcpSchema;
58
+ export interface McpStoredSource {
59
+ readonly namespace: string;
60
+ /** Executor scope id this source row lives in. Writes stamp this on
61
+ * `scope_id`; reads return whichever scope's row the adapter's
62
+ * fall-through walk surfaced first. */
63
+ readonly scope: string;
64
+ readonly name: string;
65
+ readonly config: McpStoredSourceData;
66
+ }
9
67
  export interface McpBindingStore {
10
- readonly get: (toolId: ToolId) => Effect.Effect<{
11
- binding: McpToolBinding;
12
- namespace: string;
13
- } | null>;
14
- readonly put: (toolId: ToolId, namespace: string, binding: McpToolBinding) => Effect.Effect<void>;
15
- readonly remove: (toolId: ToolId) => Effect.Effect<void>;
16
- readonly listByNamespace: (namespace: string) => Effect.Effect<readonly ToolId[]>;
17
- readonly removeByNamespace: (namespace: string) => Effect.Effect<readonly ToolId[]>;
18
- readonly putSource: (source: McpStoredSource) => Effect.Effect<void>;
19
- readonly removeSource: (namespace: string) => Effect.Effect<void>;
20
- readonly listSources: () => Effect.Effect<readonly McpStoredSource[]>;
21
- readonly getSource: (namespace: string) => Effect.Effect<McpStoredSource | null>;
22
- readonly getSourceConfig: (namespace: string) => Effect.Effect<McpStoredSourceData | null>;
23
- readonly putOAuthSession: (sessionId: string, session: McpOAuthSession) => Effect.Effect<void>;
24
- readonly getOAuthSession: (sessionId: string) => Effect.Effect<McpOAuthSession | null>;
25
- readonly deleteOAuthSession: (sessionId: string) => Effect.Effect<void>;
68
+ readonly listBindingsBySource: (namespace: string, scope: string) => Effect.Effect<ReadonlyArray<{
69
+ readonly toolId: string;
70
+ readonly binding: McpToolBinding;
71
+ }>, StorageFailure>;
72
+ readonly getBinding: (toolId: string, scope: string) => Effect.Effect<{
73
+ readonly binding: McpToolBinding;
74
+ readonly namespace: string;
75
+ } | null, StorageFailure>;
76
+ readonly putBindings: (namespace: string, scope: string, entries: ReadonlyArray<{
77
+ readonly toolId: string;
78
+ readonly binding: McpToolBinding;
79
+ }>) => Effect.Effect<void, StorageFailure>;
80
+ readonly removeBindingsByNamespace: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure>;
81
+ readonly getSource: (namespace: string, scope: string) => Effect.Effect<McpStoredSource | null, StorageFailure>;
82
+ readonly getSourceConfig: (namespace: string, scope: string) => Effect.Effect<McpStoredSourceData | null, StorageFailure>;
83
+ readonly putSource: (source: McpStoredSource) => Effect.Effect<void, StorageFailure>;
84
+ readonly removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure>;
26
85
  }
27
- export declare const makeKvBindingStore: (kv: Kv, namespace: string) => McpBindingStore;
28
- export declare const makeInMemoryBindingStore: () => McpBindingStore;
86
+ export declare const makeMcpStore: ({ adapter: db, }: StorageDeps<McpSchema>) => McpBindingStore;
@@ -0,0 +1 @@
1
+ export {};
@@ -8,8 +8,10 @@ export type McpConnection = {
8
8
  readonly close: () => Promise<void>;
9
9
  };
10
10
  export type McpConnector = Effect.Effect<McpConnection, McpConnectionError>;
11
- export type RemoteConnectorInput = Omit<McpRemoteSourceData, "auth" | "remoteTransport"> & {
11
+ export type RemoteConnectorInput = Omit<McpRemoteSourceData, "auth" | "remoteTransport" | "headers" | "queryParams"> & {
12
12
  readonly remoteTransport?: McpRemoteSourceData["remoteTransport"];
13
+ readonly headers?: Record<string, string>;
14
+ readonly queryParams?: Record<string, string>;
13
15
  readonly authProvider?: OAuthClientProvider;
14
16
  };
15
17
  export type StdioConnectorInput = McpStdioSourceData;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,33 +1,25 @@
1
1
  import { Schema } from "effect";
2
- declare const McpConnectionError_base: Schema.TaggedErrorClass<McpConnectionError, "McpConnectionError", {
3
- readonly _tag: Schema.tag<"McpConnectionError">;
4
- } & {
5
- transport: typeof Schema.String;
6
- message: typeof Schema.String;
7
- }>;
2
+ declare const McpConnectionError_base: Schema.Class<McpConnectionError, Schema.TaggedStruct<"McpConnectionError", {
3
+ readonly transport: Schema.String;
4
+ readonly message: Schema.String;
5
+ }>, import("effect/Cause").YieldableError>;
8
6
  export declare class McpConnectionError extends McpConnectionError_base {
9
7
  }
10
- declare const McpToolDiscoveryError_base: Schema.TaggedErrorClass<McpToolDiscoveryError, "McpToolDiscoveryError", {
11
- readonly _tag: Schema.tag<"McpToolDiscoveryError">;
12
- } & {
13
- stage: Schema.Literal<["connect", "list_tools"]>;
14
- message: typeof Schema.String;
15
- }>;
8
+ declare const McpToolDiscoveryError_base: Schema.Class<McpToolDiscoveryError, Schema.TaggedStruct<"McpToolDiscoveryError", {
9
+ readonly stage: Schema.Literals<readonly ["connect", "list_tools"]>;
10
+ readonly message: Schema.String;
11
+ }>, import("effect/Cause").YieldableError>;
16
12
  export declare class McpToolDiscoveryError extends McpToolDiscoveryError_base {
17
13
  }
18
- declare const McpInvocationError_base: Schema.TaggedErrorClass<McpInvocationError, "McpInvocationError", {
19
- readonly _tag: Schema.tag<"McpInvocationError">;
20
- } & {
21
- toolName: typeof Schema.String;
22
- message: typeof Schema.String;
23
- }>;
14
+ declare const McpInvocationError_base: Schema.Class<McpInvocationError, Schema.TaggedStruct<"McpInvocationError", {
15
+ readonly toolName: Schema.String;
16
+ readonly message: Schema.String;
17
+ }>, import("effect/Cause").YieldableError>;
24
18
  export declare class McpInvocationError extends McpInvocationError_base {
25
19
  }
26
- declare const McpOAuthError_base: Schema.TaggedErrorClass<McpOAuthError, "McpOAuthError", {
27
- readonly _tag: Schema.tag<"McpOAuthError">;
28
- } & {
29
- message: typeof Schema.String;
30
- }>;
20
+ declare const McpOAuthError_base: Schema.Class<McpOAuthError, Schema.TaggedStruct<"McpOAuthError", {
21
+ readonly message: Schema.String;
22
+ }>, import("effect/Cause").YieldableError>;
31
23
  export declare class McpOAuthError extends McpOAuthError_base {
32
24
  }
33
25
  export {};
@@ -1,3 +1,3 @@
1
- export { mcpPlugin, type McpPluginExtension } from "./plugin";
2
- export { makeKvBindingStore, type McpBindingStore, type McpStoredSource } from "./binding-store";
3
- export { withConfigFile } from "./config-file-store";
1
+ export { mcpPlugin, type McpPluginExtension, type McpPluginOptions, type McpSourceConfig, type McpRemoteSourceConfig, type McpStdioSourceConfig, type McpProbeResult, type McpUpdateSourceInput, } from "./plugin";
2
+ export { makeMcpStore, mcpSchema, type McpBindingStore, type McpSchema, type McpStoredSource, } from "./binding-store";
3
+ export { McpConnectionAuth } from "./types";
@@ -1,19 +1,20 @@
1
- import { Effect, type ScopedCache } from "effect";
2
- import { type ToolInvoker, type ScopeId, type SecretId } from "@executor-js/sdk";
3
- import type { McpBindingStore } from "./binding-store";
4
- import { McpConnectionError } from "./errors";
5
- import { type McpConnection } from "./connection";
6
- type Secrets = {
7
- readonly resolve: (secretId: SecretId, scopeId: ScopeId) => Effect.Effect<string, unknown>;
8
- };
9
- export declare const makeMcpInvoker: (opts: {
10
- readonly bindingStore: McpBindingStore;
11
- readonly secrets: Secrets;
12
- readonly scopeId: ScopeId;
1
+ import { Effect, ScopedCache } from "effect";
2
+ import { type Elicit } from "@executor-js/sdk/core";
3
+ import { McpConnectionError, McpInvocationError } from "./errors";
4
+ import type { McpConnection } from "./connection";
5
+ import type { McpStoredSourceData } from "./types";
6
+ export interface InvokeMcpToolInput {
7
+ readonly toolId: string;
8
+ readonly toolName: string;
9
+ readonly args: unknown;
10
+ readonly sourceData: McpStoredSourceData;
11
+ /** Innermost executor scope id at invoke time. Mixed into the
12
+ * connection cache key so per-user OAuth/secret resolution doesn't
13
+ * collapse multiple users onto one shared connection. */
14
+ readonly invokerScope: string;
15
+ readonly resolveConnector: () => Effect.Effect<McpConnection, McpConnectionError>;
13
16
  readonly connectionCache: ScopedCache.ScopedCache<string, McpConnection, McpConnectionError>;
14
- /** Shared map between cache lookup and invoker — set connector before cache.get */
15
17
  readonly pendingConnectors: Map<string, Effect.Effect<McpConnection, McpConnectionError>>;
16
- }) => ToolInvoker & {
17
- readonly closeConnections: () => Effect.Effect<void>;
18
- };
19
- export {};
18
+ readonly elicit: Elicit;
19
+ }
20
+ export declare const invokeMcpTool: (input: InvokeMcpToolInput) => Effect.Effect<unknown, McpConnectionError | McpInvocationError>;
@@ -1,9 +1,11 @@
1
+ import { McpToolAnnotations } from "./types";
1
2
  export interface McpToolManifestEntry {
2
3
  readonly toolId: string;
3
4
  readonly toolName: string;
4
5
  readonly description: string | null;
5
6
  readonly inputSchema?: unknown;
6
7
  readonly outputSchema?: unknown;
8
+ readonly annotations?: McpToolAnnotations;
7
9
  }
8
10
  export interface McpServerMetadata {
9
11
  readonly name: string | null;
@@ -13,6 +15,7 @@ export interface McpToolManifest {
13
15
  readonly server: McpServerMetadata | null;
14
16
  readonly tools: readonly McpToolManifestEntry[];
15
17
  }
18
+ export declare const isListToolsResult: (value: unknown) => boolean;
16
19
  export declare const joinToolPath: (namespace: string | undefined, toolId: string) => string;
17
20
  export declare const extractManifestFromListToolsResult: (listToolsResult: unknown, metadata?: {
18
21
  serverInfo?: unknown;
@@ -0,0 +1 @@
1
+ export {};