@frockbot/plugin-mcp 0.3.1 → 0.3.3
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/package.json +8 -8
- package/src/agent.test.ts +9 -3
- package/src/backend.ts +14 -0
- package/src/user.ts +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/plugin-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@frockbot/configuration-core": "0.3.
|
|
29
|
-
"@frockbot/connection-core": "0.3.
|
|
30
|
-
"@frockbot/kernel-contracts": "0.3.
|
|
31
|
-
"@frockbot/plugin-credentials": "0.3.
|
|
32
|
-
"@frockbot/plugin-settings": "0.3.
|
|
33
|
-
"@frockbot/plugin-tools": "0.3.
|
|
34
|
-
"@frockbot/plugin-web": "0.3.
|
|
28
|
+
"@frockbot/configuration-core": "0.3.3",
|
|
29
|
+
"@frockbot/connection-core": "0.3.3",
|
|
30
|
+
"@frockbot/kernel-contracts": "0.3.3",
|
|
31
|
+
"@frockbot/plugin-credentials": "0.3.3",
|
|
32
|
+
"@frockbot/plugin-settings": "0.3.3",
|
|
33
|
+
"@frockbot/plugin-tools": "0.3.3",
|
|
34
|
+
"@frockbot/plugin-web": "0.3.3",
|
|
35
35
|
"cordis": "4.0.0-rc.8"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
package/src/agent.test.ts
CHANGED
|
@@ -177,6 +177,8 @@ describe("mounting one enabled Capability", () => {
|
|
|
177
177
|
|
|
178
178
|
expect(schemas.map((schema) => schema.name)).toEqual([
|
|
179
179
|
"mcp__example__echo",
|
|
180
|
+
"get_dynamic_tools",
|
|
181
|
+
"call_dynamic_tool",
|
|
180
182
|
]);
|
|
181
183
|
expect(schemas[0]!.inputSchema).toEqual({
|
|
182
184
|
type: "object",
|
|
@@ -189,7 +191,7 @@ describe("mounting one enabled Capability", () => {
|
|
|
189
191
|
|
|
190
192
|
for (const turnType of ["chat", "automation", "subagent"] as const) {
|
|
191
193
|
expect(root.tools.schemas({ turnType }).map((tool) => tool.name)).toEqual(
|
|
192
|
-
["mcp__example__echo"],
|
|
194
|
+
["mcp__example__echo", "get_dynamic_tools", "call_dynamic_tool"],
|
|
193
195
|
);
|
|
194
196
|
}
|
|
195
197
|
});
|
|
@@ -260,7 +262,9 @@ describe("mounting one enabled Capability", () => {
|
|
|
260
262
|
});
|
|
261
263
|
|
|
262
264
|
expect(mounted).toBe(false);
|
|
263
|
-
expect(
|
|
265
|
+
expect(
|
|
266
|
+
root.tools.schemas({ turnType: "chat" }).map((tool) => tool.name),
|
|
267
|
+
).toEqual(["get_dynamic_tools", "call_dynamic_tool"]);
|
|
264
268
|
expect(failures[0]).toContain("401");
|
|
265
269
|
});
|
|
266
270
|
|
|
@@ -327,7 +331,9 @@ describe("the durable lifecycle a mount participates in", () => {
|
|
|
327
331
|
}),
|
|
328
332
|
});
|
|
329
333
|
|
|
330
|
-
const
|
|
334
|
+
const schema = root.tools
|
|
335
|
+
.schemas({ turnType: "chat" })
|
|
336
|
+
.find((candidate) => candidate.name === "mcp__example__echo");
|
|
331
337
|
expect(schema?.name).toBe("mcp__example__echo");
|
|
332
338
|
// The instructions reach the model in the exact normalized request the
|
|
333
339
|
// session log records, which is the only place a User can prove it.
|
package/src/backend.ts
CHANGED
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
} from "./records.js";
|
|
32
32
|
import { MCP_PACKAGE_ID } from "./agent.js";
|
|
33
33
|
import { mcpAuthorizationConnectionIdV1 } from "./oauth-records.js";
|
|
34
|
+
import { defineGatewayContribution } from "@frockbot/kernel-contracts/contributions";
|
|
34
35
|
|
|
35
36
|
export const MCP_SERVERS_ROUTE = "/api/mcp/servers";
|
|
36
37
|
export const MCP_CONNECTIONS_ROUTE = "/api/plugins/mcp/connections";
|
|
@@ -488,3 +489,16 @@ export namespace createMcpBackendContribution {
|
|
|
488
489
|
return () => lifecycle.mount(createMcpBackendContribution(host));
|
|
489
490
|
}
|
|
490
491
|
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* The manifest's gateway `backend` entry, resolved by specifier. The
|
|
495
|
+
* application looks this descriptor up in its Contribution table; it never
|
|
496
|
+
* branches on which Package it belongs to.
|
|
497
|
+
*/
|
|
498
|
+
export const backendContribution = defineGatewayContribution<
|
|
499
|
+
McpGatewayHost,
|
|
500
|
+
McpBackendRouteContribution
|
|
501
|
+
>({
|
|
502
|
+
specifier: "@frockbot/plugin-mcp/backend",
|
|
503
|
+
create: createMcpBackendContribution.plugin,
|
|
504
|
+
});
|
package/src/user.ts
CHANGED
|
@@ -92,6 +92,7 @@ import {
|
|
|
92
92
|
type McpServerStateV1,
|
|
93
93
|
type McpServerStatusViewV1,
|
|
94
94
|
} from "./records.js";
|
|
95
|
+
import { defineUserBackendContribution } from "@frockbot/kernel-contracts/contributions";
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* The global `fetch`, bound. A bare reference to it throws "Illegal
|
|
@@ -2029,3 +2030,25 @@ export function createMcpUserBackendPlugin(
|
|
|
2029
2030
|
): Plugin {
|
|
2030
2031
|
return () => lifecycle.mount(createMcpUserBackendContribution(host));
|
|
2031
2032
|
}
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* What an application hands this Contribution: the User's MCP server records and lifecycle commands, under the
|
|
2036
|
+
* Package's own key so one wide host object can satisfy every Package's slice
|
|
2037
|
+
* without their fields colliding.
|
|
2038
|
+
*/
|
|
2039
|
+
export interface McpUserApplicationHostV1 {
|
|
2040
|
+
mcp: McpUserBackendHost;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
/**
|
|
2044
|
+
* The manifest's `user` entry, resolved by specifier. The
|
|
2045
|
+
* application looks this descriptor up in its Contribution table; it never
|
|
2046
|
+
* branches on which Package it belongs to.
|
|
2047
|
+
*/
|
|
2048
|
+
export const userContribution = defineUserBackendContribution<
|
|
2049
|
+
McpUserApplicationHostV1,
|
|
2050
|
+
McpUserBackendContribution
|
|
2051
|
+
>({
|
|
2052
|
+
specifier: "@frockbot/plugin-mcp/user",
|
|
2053
|
+
create: (host, lifecycle) => createMcpUserBackendPlugin(host.mcp, lifecycle),
|
|
2054
|
+
});
|