@mcpc-tech/core 0.3.7 → 0.3.9
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/index.mjs +122 -122
- package/package.json +3 -4
- package/types/src/compose.d.ts +2 -3
- package/types/src/compose.d.ts.map +1 -1
- package/types/src/service/tools.d.ts +30 -3
- package/types/src/service/tools.d.ts.map +1 -1
- package/types/src/set-up-mcp-compose.d.ts.map +1 -1
- package/types/src/utils/common/mcp.d.ts +2 -3
- package/types/src/utils/common/mcp.d.ts.map +1 -1
package/index.mjs
CHANGED
|
@@ -205,31 +205,6 @@ import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
|
205
205
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
206
206
|
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
207
207
|
|
|
208
|
-
// __mcpc__core_latest/node_modules/@mcpc/core/src/utils/common/registory.js
|
|
209
|
-
function connectToSmitheryServer(smitheryConfig) {
|
|
210
|
-
const serverUrl = new URL(smitheryConfig.deploymentUrl);
|
|
211
|
-
serverUrl.searchParams.set("config", btoa(JSON.stringify(smitheryConfig.config)));
|
|
212
|
-
serverUrl.searchParams.set("api_key", smitheryConfig?.smitheryApiKey ?? smitheryConfig?.config?.smitheryApiKey);
|
|
213
|
-
return {
|
|
214
|
-
url: serverUrl.toString()
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function smitheryToolNameCompatibale(name, scope) {
|
|
218
|
-
if (!name.startsWith("toolbox_")) {
|
|
219
|
-
return {
|
|
220
|
-
toolNameWithScope: `${scope}.${name}`,
|
|
221
|
-
toolName: name
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
const [, ...toolNames] = name.split("_");
|
|
225
|
-
const toolName = toolNames.join("_");
|
|
226
|
-
const toolNameWithScope = `${scope}.${toolName}`;
|
|
227
|
-
return {
|
|
228
|
-
toolNameWithScope,
|
|
229
|
-
toolName
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
|
|
233
208
|
// __mcpc__core_latest/node_modules/@mcpc/core/src/utils/common/config.js
|
|
234
209
|
import process2 from "node:process";
|
|
235
210
|
var GEMINI_PREFERRED_FORMAT = process2.env.GEMINI_PREFERRED_FORMAT === "0" ? false : true;
|
|
@@ -274,27 +249,38 @@ function optionalObject(obj, condition) {
|
|
|
274
249
|
function sanitizePropertyKey(name) {
|
|
275
250
|
return name.replace(/[@.,/\\:;!?#$%^&*()[\]{}]/g, "_").substring(0, 64);
|
|
276
251
|
}
|
|
277
|
-
var
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
|
|
252
|
+
var createModelCompatibleJSONSchema = (schema) => {
|
|
253
|
+
const validatorOnlyKeys = [
|
|
254
|
+
"errorMessage"
|
|
255
|
+
];
|
|
256
|
+
const geminiRestrictedKeys = GEMINI_PREFERRED_FORMAT ? [
|
|
257
|
+
"additionalProperties"
|
|
258
|
+
] : [];
|
|
259
|
+
const keysToRemove = /* @__PURE__ */ new Set([
|
|
260
|
+
...validatorOnlyKeys,
|
|
261
|
+
...geminiRestrictedKeys
|
|
262
|
+
]);
|
|
263
|
+
let cleanSchema = schema;
|
|
264
|
+
if (GEMINI_PREFERRED_FORMAT) {
|
|
265
|
+
const { oneOf: _oneOf, allOf: _allOf, anyOf: _anyOf, ...rest2 } = schema;
|
|
266
|
+
cleanSchema = rest2;
|
|
267
|
+
}
|
|
268
|
+
const cleanRecursively = (obj) => {
|
|
283
269
|
if (Array.isArray(obj)) {
|
|
284
|
-
return obj.map(
|
|
270
|
+
return obj.map(cleanRecursively);
|
|
285
271
|
}
|
|
286
272
|
if (obj && typeof obj === "object") {
|
|
287
273
|
const result = {};
|
|
288
274
|
for (const [key, value] of Object.entries(obj)) {
|
|
289
|
-
if (key
|
|
290
|
-
result[key] =
|
|
275
|
+
if (!keysToRemove.has(key)) {
|
|
276
|
+
result[key] = cleanRecursively(value);
|
|
291
277
|
}
|
|
292
278
|
}
|
|
293
279
|
return result;
|
|
294
280
|
}
|
|
295
281
|
return obj;
|
|
296
282
|
};
|
|
297
|
-
return
|
|
283
|
+
return cleanRecursively(cleanSchema);
|
|
298
284
|
};
|
|
299
285
|
|
|
300
286
|
// __mcpc__core_latest/node_modules/@mcpc/core/src/utils/common/mcp.js
|
|
@@ -441,7 +427,8 @@ async function composeMcpDepTools(mcpConfig, filterIn) {
|
|
|
441
427
|
allClients[serverId] = client;
|
|
442
428
|
const { tools } = await client.listTools();
|
|
443
429
|
tools.forEach((tool) => {
|
|
444
|
-
const
|
|
430
|
+
const toolNameWithScope = `${name}.${tool.name}`;
|
|
431
|
+
const internalToolName = tool.name;
|
|
445
432
|
const rawToolId = `${serverId}_${internalToolName}`;
|
|
446
433
|
const toolId = sanitizePropertyKey(rawToolId);
|
|
447
434
|
if (filterIn && !filterIn({
|
|
@@ -1033,19 +1020,32 @@ ${JSON.stringify(steps, null, 2)}`;
|
|
|
1033
1020
|
// __mcpc__core_latest/node_modules/@mcpc/core/src/utils/schema-validator.js
|
|
1034
1021
|
import { Ajv } from "ajv";
|
|
1035
1022
|
import addFormats from "ajv-formats";
|
|
1023
|
+
import ajvErrors from "ajv-errors";
|
|
1036
1024
|
import { AggregateAjvError } from "@segment/ajv-human-errors";
|
|
1037
1025
|
var ajv = new Ajv({
|
|
1038
1026
|
allErrors: true,
|
|
1039
1027
|
verbose: true
|
|
1040
1028
|
});
|
|
1041
1029
|
addFormats.default(ajv);
|
|
1030
|
+
ajvErrors.default(ajv);
|
|
1042
1031
|
function validateSchema(args, schema) {
|
|
1043
1032
|
const validate = ajv.compile(schema);
|
|
1044
1033
|
if (!validate(args)) {
|
|
1045
|
-
const errors =
|
|
1034
|
+
const errors = validate.errors;
|
|
1035
|
+
const customErrors = errors.filter((err) => err.keyword === "errorMessage");
|
|
1036
|
+
if (customErrors.length > 0) {
|
|
1037
|
+
const messages = [
|
|
1038
|
+
...new Set(customErrors.map((err) => err.message))
|
|
1039
|
+
];
|
|
1040
|
+
return {
|
|
1041
|
+
valid: false,
|
|
1042
|
+
error: messages.join("; ")
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
1045
|
+
const aggregateError = new AggregateAjvError(errors);
|
|
1046
1046
|
return {
|
|
1047
1047
|
valid: false,
|
|
1048
|
-
error:
|
|
1048
|
+
error: aggregateError.message
|
|
1049
1049
|
};
|
|
1050
1050
|
}
|
|
1051
1051
|
return {
|
|
@@ -1196,11 +1196,17 @@ var AgenticExecutor = class {
|
|
|
1196
1196
|
});
|
|
1197
1197
|
endSpan(executeSpan);
|
|
1198
1198
|
}
|
|
1199
|
-
const
|
|
1199
|
+
const result = {
|
|
1200
1200
|
content: []
|
|
1201
1201
|
};
|
|
1202
|
-
this.appendToolSchemas(
|
|
1203
|
-
|
|
1202
|
+
this.appendToolSchemas(result, definitionsOf, hasDefinitions);
|
|
1203
|
+
if (result.content.length === 0 && definitionsOf.length > 0) {
|
|
1204
|
+
result.content.push({
|
|
1205
|
+
type: "text",
|
|
1206
|
+
text: `All requested tool schemas are already in hasDefinitions. You can now call a tool using "${this.USE_TOOL_KEY}".`
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
return result;
|
|
1204
1210
|
}
|
|
1205
1211
|
if (executeSpan) {
|
|
1206
1212
|
try {
|
|
@@ -1250,8 +1256,8 @@ var AgenticExecutor = class {
|
|
|
1250
1256
|
selectTool: useTool
|
|
1251
1257
|
});
|
|
1252
1258
|
try {
|
|
1253
|
-
const
|
|
1254
|
-
const callToolResult =
|
|
1259
|
+
const result = await this.server.callTool(useTool, args[useTool]);
|
|
1260
|
+
const callToolResult = result ?? {
|
|
1255
1261
|
content: []
|
|
1256
1262
|
};
|
|
1257
1263
|
this.appendToolSchemas(callToolResult, definitionsOf, hasDefinitions);
|
|
@@ -1292,16 +1298,15 @@ var AgenticExecutor = class {
|
|
|
1292
1298
|
});
|
|
1293
1299
|
endSpan(executeSpan);
|
|
1294
1300
|
}
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1301
|
+
return {
|
|
1302
|
+
content: [
|
|
1303
|
+
{
|
|
1304
|
+
type: "text",
|
|
1305
|
+
text: `Tool "${useTool}" not found. Available tools: ${this.allToolNames.join(", ")}.`
|
|
1306
|
+
}
|
|
1307
|
+
],
|
|
1308
|
+
isError: true
|
|
1302
1309
|
};
|
|
1303
|
-
this.appendToolSchemas(result, definitionsOf, hasDefinitions);
|
|
1304
|
-
return result;
|
|
1305
1310
|
} catch (error) {
|
|
1306
1311
|
if (executeSpan) {
|
|
1307
1312
|
endSpan(executeSpan, error);
|
|
@@ -1529,7 +1534,10 @@ Workflow step definitions - provide ONLY on initial call.
|
|
|
1529
1534
|
decision: () => ({
|
|
1530
1535
|
type: "string",
|
|
1531
1536
|
enum: Object.values(DECISION_OPTIONS),
|
|
1532
|
-
description: `**Step control: \`${DECISION_OPTIONS.PROCEED}\` = next step, \`${DECISION_OPTIONS.RETRY}\` = retry/repeat current, \`${DECISION_OPTIONS.COMPLETE}\` = finish workflow
|
|
1537
|
+
description: `**Step control: \`${DECISION_OPTIONS.PROCEED}\` = next step, \`${DECISION_OPTIONS.RETRY}\` = retry/repeat current, \`${DECISION_OPTIONS.COMPLETE}\` = finish workflow**`,
|
|
1538
|
+
errorMessage: {
|
|
1539
|
+
enum: `Invalid decision. Must be one of: ${Object.values(DECISION_OPTIONS).join(", ")}.`
|
|
1540
|
+
}
|
|
1533
1541
|
}),
|
|
1534
1542
|
action: () => ({
|
|
1535
1543
|
type: "string",
|
|
@@ -1537,7 +1545,10 @@ Workflow step definitions - provide ONLY on initial call.
|
|
|
1537
1545
|
enum: allToolNames,
|
|
1538
1546
|
required: [
|
|
1539
1547
|
"action"
|
|
1540
|
-
]
|
|
1548
|
+
],
|
|
1549
|
+
errorMessage: {
|
|
1550
|
+
enum: `Invalid action. Must be one of: ${allToolNames.join(", ")}.`
|
|
1551
|
+
}
|
|
1541
1552
|
}),
|
|
1542
1553
|
forTool: function() {
|
|
1543
1554
|
return this.common({});
|
|
@@ -1579,58 +1590,17 @@ Workflow step definitions - provide ONLY on initial call.
|
|
|
1579
1590
|
required: [
|
|
1580
1591
|
"userRequest",
|
|
1581
1592
|
"context"
|
|
1582
|
-
]
|
|
1593
|
+
],
|
|
1594
|
+
errorMessage: {
|
|
1595
|
+
required: {
|
|
1596
|
+
userRequest: "Missing required field 'userRequest'. Please provide a clear task description.",
|
|
1597
|
+
context: "Missing required field 'context'. Please provide relevant context (e.g., current working directory)."
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1583
1600
|
};
|
|
1584
1601
|
},
|
|
1585
1602
|
forAgentic: function(toolNameToDetailList, _sampling = false, USE_TOOL_KEY = "useTool") {
|
|
1586
1603
|
const allOf = [
|
|
1587
|
-
// When hasDefinitions is empty, definitionsOf must be provided
|
|
1588
|
-
{
|
|
1589
|
-
if: {
|
|
1590
|
-
properties: {
|
|
1591
|
-
hasDefinitions: {
|
|
1592
|
-
type: "array",
|
|
1593
|
-
maxItems: 0
|
|
1594
|
-
}
|
|
1595
|
-
},
|
|
1596
|
-
required: [
|
|
1597
|
-
"hasDefinitions"
|
|
1598
|
-
]
|
|
1599
|
-
},
|
|
1600
|
-
then: {
|
|
1601
|
-
required: [
|
|
1602
|
-
"definitionsOf"
|
|
1603
|
-
]
|
|
1604
|
-
}
|
|
1605
|
-
},
|
|
1606
|
-
// When useTool is present, hasDefinitions must contain that tool
|
|
1607
|
-
...toolNameToDetailList.map(([toolName, _toolDetail]) => {
|
|
1608
|
-
return {
|
|
1609
|
-
if: {
|
|
1610
|
-
properties: {
|
|
1611
|
-
[USE_TOOL_KEY]: {
|
|
1612
|
-
const: toolName
|
|
1613
|
-
}
|
|
1614
|
-
},
|
|
1615
|
-
required: [
|
|
1616
|
-
USE_TOOL_KEY
|
|
1617
|
-
]
|
|
1618
|
-
},
|
|
1619
|
-
then: {
|
|
1620
|
-
properties: {
|
|
1621
|
-
hasDefinitions: {
|
|
1622
|
-
type: "array",
|
|
1623
|
-
contains: {
|
|
1624
|
-
const: toolName
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
},
|
|
1628
|
-
required: [
|
|
1629
|
-
"hasDefinitions"
|
|
1630
|
-
]
|
|
1631
|
-
}
|
|
1632
|
-
};
|
|
1633
|
-
}),
|
|
1634
1604
|
// When a specific tool is selected, its parameters must be provided
|
|
1635
1605
|
...toolNameToDetailList.map(([toolName, _toolDetail]) => {
|
|
1636
1606
|
return {
|
|
@@ -1647,7 +1617,12 @@ Workflow step definitions - provide ONLY on initial call.
|
|
|
1647
1617
|
then: {
|
|
1648
1618
|
required: [
|
|
1649
1619
|
toolName
|
|
1650
|
-
]
|
|
1620
|
+
],
|
|
1621
|
+
errorMessage: {
|
|
1622
|
+
required: {
|
|
1623
|
+
[toolName]: `Tool "${toolName}" is selected but its parameters are missing. Please provide "${toolName}": { ...parameters }.`
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1651
1626
|
}
|
|
1652
1627
|
};
|
|
1653
1628
|
})
|
|
@@ -1663,7 +1638,10 @@ Workflow step definitions - provide ONLY on initial call.
|
|
|
1663
1638
|
[USE_TOOL_KEY]: {
|
|
1664
1639
|
type: "string",
|
|
1665
1640
|
enum: allToolNames,
|
|
1666
|
-
description: useToolDescription
|
|
1641
|
+
description: useToolDescription,
|
|
1642
|
+
errorMessage: {
|
|
1643
|
+
enum: `Invalid tool name. Available tools: ${allToolNames.join(", ")}.`
|
|
1644
|
+
}
|
|
1667
1645
|
},
|
|
1668
1646
|
hasDefinitions: {
|
|
1669
1647
|
type: "array",
|
|
@@ -1686,6 +1664,41 @@ Workflow step definitions - provide ONLY on initial call.
|
|
|
1686
1664
|
if (allOf.length > 0) {
|
|
1687
1665
|
schema.allOf = allOf;
|
|
1688
1666
|
}
|
|
1667
|
+
if (allToolNames.length > 0) {
|
|
1668
|
+
const thenClause = {
|
|
1669
|
+
required: [
|
|
1670
|
+
USE_TOOL_KEY
|
|
1671
|
+
],
|
|
1672
|
+
errorMessage: {
|
|
1673
|
+
required: {
|
|
1674
|
+
[USE_TOOL_KEY]: `No tool selected. Please specify "${USE_TOOL_KEY}" to select one of: ${allToolNames.join(", ")}. Or use "definitionsOf" with tool names to get their schemas first.`
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
Object.assign(schema, {
|
|
1679
|
+
if: {
|
|
1680
|
+
// definitionsOf is not provided OR is empty array
|
|
1681
|
+
anyOf: [
|
|
1682
|
+
{
|
|
1683
|
+
not: {
|
|
1684
|
+
required: [
|
|
1685
|
+
"definitionsOf"
|
|
1686
|
+
]
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
properties: {
|
|
1691
|
+
definitionsOf: {
|
|
1692
|
+
type: "array",
|
|
1693
|
+
maxItems: 0
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
]
|
|
1698
|
+
},
|
|
1699
|
+
then: thenClause
|
|
1700
|
+
});
|
|
1701
|
+
}
|
|
1689
1702
|
return schema;
|
|
1690
1703
|
},
|
|
1691
1704
|
forNextState: function(state) {
|
|
@@ -1743,7 +1756,7 @@ function registerAgenticTool(server, { description, name, allToolNames, depGroup
|
|
|
1743
1756
|
type: "object",
|
|
1744
1757
|
properties: {}
|
|
1745
1758
|
};
|
|
1746
|
-
server.tool(name, description, jsonSchema(
|
|
1759
|
+
server.tool(name, description, jsonSchema(createModelCompatibleJSONSchema(schema)), async (args) => {
|
|
1747
1760
|
return await agenticExecutor.execute(args, schema);
|
|
1748
1761
|
});
|
|
1749
1762
|
}
|
|
@@ -2258,7 +2271,7 @@ function registerAgenticWorkflowTool(server, { description, name, allToolNames,
|
|
|
2258
2271
|
});
|
|
2259
2272
|
const argsDef = createArgsDef.forTool();
|
|
2260
2273
|
const toolDescription = createArgsDef.forToolDescription(baseDescription, workflowState);
|
|
2261
|
-
server.tool(name, toolDescription, jsonSchema(
|
|
2274
|
+
server.tool(name, toolDescription, jsonSchema(createModelCompatibleJSONSchema(argsDef)), async (args) => {
|
|
2262
2275
|
try {
|
|
2263
2276
|
return await workflowExecutor.execute(args, workflowState);
|
|
2264
2277
|
} catch (error) {
|
|
@@ -2780,7 +2793,7 @@ function registerAgenticSamplingTool(server, { description, name, allToolNames,
|
|
|
2780
2793
|
type: "object",
|
|
2781
2794
|
properties: {}
|
|
2782
2795
|
};
|
|
2783
|
-
server.tool(name, description, jsonSchema(
|
|
2796
|
+
server.tool(name, description, jsonSchema(createModelCompatibleJSONSchema(schema)), async (args) => {
|
|
2784
2797
|
return await samplingExecutor.executeSampling(args, schema);
|
|
2785
2798
|
});
|
|
2786
2799
|
}
|
|
@@ -2894,7 +2907,7 @@ function registerWorkflowSamplingTool(server, { description, name, allToolNames,
|
|
|
2894
2907
|
type: "object",
|
|
2895
2908
|
properties: {}
|
|
2896
2909
|
};
|
|
2897
|
-
server.tool(name, baseDescription, jsonSchema(
|
|
2910
|
+
server.tool(name, baseDescription, jsonSchema(createModelCompatibleJSONSchema(schema)), async (args) => {
|
|
2898
2911
|
try {
|
|
2899
2912
|
return await workflowSamplingExecutor.executeWorkflowSampling(args, schema, workflowState);
|
|
2900
2913
|
} catch (error) {
|
|
@@ -4073,20 +4086,7 @@ function convertToAISDKTools(server, helpers) {
|
|
|
4073
4086
|
|
|
4074
4087
|
// __mcpc__core_latest/node_modules/@mcpc/core/src/set-up-mcp-compose.js
|
|
4075
4088
|
function parseMcpcConfigs(conf) {
|
|
4076
|
-
|
|
4077
|
-
const newMcpcConfigs = [];
|
|
4078
|
-
for (const mcpcConfig of mcpcConfigs) {
|
|
4079
|
-
if (mcpcConfig?.deps?.mcpServers) {
|
|
4080
|
-
for (const [name, config] of Object.entries(mcpcConfig.deps.mcpServers)) {
|
|
4081
|
-
if (config.smitheryConfig) {
|
|
4082
|
-
const streamConfig = connectToSmitheryServer(config.smitheryConfig);
|
|
4083
|
-
mcpcConfig.deps.mcpServers[name] = streamConfig;
|
|
4084
|
-
}
|
|
4085
|
-
}
|
|
4086
|
-
}
|
|
4087
|
-
newMcpcConfigs.push(mcpcConfig);
|
|
4088
|
-
}
|
|
4089
|
-
return newMcpcConfigs;
|
|
4089
|
+
return conf ?? [];
|
|
4090
4090
|
}
|
|
4091
4091
|
async function mcpc(serverConf, composeConf, setupCallback) {
|
|
4092
4092
|
const server = new ComposableMCPServer(...serverConf);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcpc-tech/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"homepage": "https://jsr.io/@mcpc/core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
"@opentelemetry/semantic-conventions": "^1.29.0",
|
|
15
15
|
"@segment/ajv-human-errors": "^2.15.0",
|
|
16
16
|
"ajv": "^8.17.1",
|
|
17
|
+
"ajv-errors": "^3.0.0",
|
|
17
18
|
"ajv-formats": "^3.0.1",
|
|
18
19
|
"cheerio": "^1.0.0",
|
|
19
|
-
"json-schema-to-zod": "^2.6.1",
|
|
20
20
|
"json-schema-traverse": "^1.0.0",
|
|
21
|
-
"jsonrepair": "^3.13.0"
|
|
22
|
-
"zod": "^3.24.2"
|
|
21
|
+
"jsonrepair": "^3.13.0"
|
|
23
22
|
},
|
|
24
23
|
"exports": {
|
|
25
24
|
".": {
|
package/types/src/compose.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type Implementation, type Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
2
|
import { type Schema } from "./utils/schema.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { MCPSetting } from "./service/tools.js";
|
|
4
4
|
import { Server, type ServerOptions } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
|
-
import type z from "zod";
|
|
6
5
|
import type { ComposeDefinition } from "./set-up-mcp-compose.js";
|
|
7
6
|
import type { JSONSchema, ToolCallback } from "./types.js";
|
|
8
7
|
import type { ToolConfig, ToolPlugin } from "./plugin-types.js";
|
|
@@ -75,6 +74,6 @@ export declare class ComposableMCPServer extends Server {
|
|
|
75
74
|
/**
|
|
76
75
|
* Close the server and ensure all plugins are disposed
|
|
77
76
|
*/ override close(): Promise<void>;
|
|
78
|
-
compose(name: string | null, description: string, depsConfig?:
|
|
77
|
+
compose(name: string | null, description: string, depsConfig?: MCPSetting, options?: ComposeDefinition["options"]): Promise<void>;
|
|
79
78
|
}
|
|
80
79
|
//# sourceMappingURL=compose.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sources":["../../src/compose.ts"],"names":[],"mappings":"AAAA,SAGE,KAAK,cAAc,EAGnB,KAAK,IAAI,6CAC6C;AACxD,SAAwC,KAAK,MAAM,4BAA4B;AAC/E,cAAc,
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sources":["../../src/compose.ts"],"names":[],"mappings":"AAAA,SAGE,KAAK,cAAc,EAGnB,KAAK,IAAI,6CAC6C;AACxD,SAAwC,KAAK,MAAM,4BAA4B;AAC/E,cAAc,UAAU,6BAA6B;AACrD,SACE,MAAM,EACN,KAAK,aAAa,oDAC2C;AAG/D,cAAc,iBAAiB,kCAAkC;AACjE,cAAc,UAAU,EAAE,YAAY,qBAAqB;AAM3D,cAA4B,UAAU,EAAE,UAAU,4BAA4B;AAe9E,OAAO,cAAM,4BAA4B;EACvC,QAAQ,mBAA6B;EACrC,QAAQ,iBAAyB;EACjC,QAAQ,YAAsC;EAG9C,IAAI,mBAAmB,IAAI,MAAM,EAAE,MAAM;EAIzC,YAAY,aAAa,cAAc,EAAE,SAAS,aAAa;EAiB/D;;GAEC,GACD,AAAM,sBAAsB,QAAQ,IAAI;UAqB1B;UAsDN;EAIR,KAAK,GACH,MAAM,MAAM,EACZ,aAAa,MAAM,EACnB,cAAc,OAAO,KAAK,UAAU,EACpC,KAAK,MAAM,GAAG,QAAQ,OAAO,KAAK,OAAO,EACzC;IAAW,WAAW,OAAO;IAAE,UAAU;GAAmB;EA+D9D;;GAEC,GACD,gBAAgB,MAAM,MAAM,GAAG,eAAe,SAAS;EAIvD;;GAEC,GACD,eAAe,QAAQ,MAAM,GAAG,aAAa,SAAS;EAItD;;GAEC,GACD,AAAM,SAAS,MAAM,MAAM,EAAE,MAAM,OAAO,GAAG,QAAQ,OAAO;EAyB5D;;GAEC,GACD,sBAAsB,MAAM;EAI5B;;GAEC,GACD,kBAAkB;EAIlB;;GAEC,GACD,sBAAsB,MAAM;EAI5B;;GAEC,GACD,wBAAwB,MAAM;EAM9B;;GAEC,GACD,oBACE,MAAM,MAAM;IACT,aAAa,MAAM;IAAE,QAAQ;MAAe,SAAS;EAI1D;;GAEC,GACD,aAAa,MAAM,MAAM,GAAG,OAAO;EAInC;;GAEC,GACD,WAAW,UAAU,MAAM,EAAE,QAAQ,UAAU,GAAG,IAAI;EAItD;;GAEC,GACD,cAAc,UAAU,MAAM,GAAG,aAAa,SAAS;EAIvD;;GAEC,GACD,iBAAiB,UAAU,MAAM,GAAG,OAAO;EAI3C;;GAEC,GACD,AAAM,UAAU,QAAQ,UAAU,GAAG,QAAQ,IAAI;EAIjD;;GAEC,GACD,AAAM,mBACJ,YAAY,MAAM,EAClB;IAAW,QAAQ,OAAO;GAAoB,GAC7C,QAAQ,IAAI;UAOD;EAOd;;GAEC,GACD,AAAM,kBAAkB,QAAQ,IAAI;EAIpC;;GAEC,GACD,SAAe,SAAS,QAAQ,IAAI;EAK9B,QACJ,MAAM,MAAM,GAAG,IAAI,EACnB,aAAa,MAAM,EACnB,aAAY,UAA+B,EAC3C,UAAS,kBAAkB,UAAgC;AA2R/D"}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
interface BaseServerConfig {
|
|
2
|
+
autoApprove?: string[];
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
disabledReason?: string;
|
|
5
|
+
toolCallTimeout?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface StdioServerConfig extends BaseServerConfig {
|
|
8
|
+
command: string;
|
|
9
|
+
args?: string[];
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
transportType?: "stdio";
|
|
12
|
+
}
|
|
13
|
+
export interface SseServerConfig extends BaseServerConfig {
|
|
14
|
+
url: string;
|
|
15
|
+
transportType?: "sse";
|
|
16
|
+
headers?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export interface StreamableHTTPServerConfig extends BaseServerConfig {
|
|
19
|
+
url: string;
|
|
20
|
+
transportType?: "streamable-http";
|
|
21
|
+
headers?: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
export interface InMemoryServerConfig extends BaseServerConfig {
|
|
24
|
+
transportType: "memory";
|
|
25
|
+
server: any;
|
|
26
|
+
}
|
|
27
|
+
export type McpServerConfig = StdioServerConfig | SseServerConfig | StreamableHTTPServerConfig | InMemoryServerConfig;
|
|
28
|
+
export type MCPSetting = {
|
|
29
|
+
mcpServers: Record<string, McpServerConfig>;
|
|
30
|
+
};
|
|
4
31
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sources":["../../../src/service/tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sources":["../../../src/service/tools.ts"],"names":[],"mappings":"UACU;EACR,cAAc,MAAM;EACpB,WAAW,OAAO;EAClB,iBAAiB,MAAM;EACvB,kBAAkB,MAAM;;AAG1B,iBAAiB,0BAA0B;EACzC,SAAS,MAAM;EACf,OAAO,MAAM;EACb,MAAM,OAAO,MAAM,EAAE,MAAM;EAC3B,gBAAgB;;AAGlB,iBAAiB,wBAAwB;EACvC,KAAK,MAAM;EACX,gBAAgB;EAChB,UAAU,OAAO,MAAM,EAAE,MAAM;;AAGjC,iBAAiB,mCAAmC;EAClD,KAAK,MAAM;EACX,gBAAgB;EAChB,UAAU,OAAO,MAAM,EAAE,MAAM;;AAGjC,iBAAiB,6BAA6B;EAC5C,eAAe;EACf,QAAQ,GAAG;;AAIb,YAAY,kBACR,oBACA,kBACA,6BACA;AAEJ,YAAY;EACV,YAAY,OAAO,MAAM,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-up-mcp-compose.d.ts","sources":["../../src/set-up-mcp-compose.ts"],"names":[],"mappings":"AAAA,SAAS,mBAAmB,oBAAoB;
|
|
1
|
+
{"version":3,"file":"set-up-mcp-compose.d.ts","sources":["../../src/set-up-mcp-compose.ts"],"names":[],"mappings":"AAAA,SAAS,mBAAmB,oBAAoB;AAChD,cAAc,QAAQ,2BAA2B;AACjD,cAAc,UAAU,6BAA6B;AACrD,cAAc,cAAc,qBAAqB;AACjD,cAAc,UAAU,4BAA4B;AACpD,cAAc,UAAU,qBAAqB;AAC7C,cAAc,aAAa,6BAA6B;AAExD,iBAAiB;EACf;;;GAGC,GACD,MAAM,MAAM,GAAG,IAAI;EACnB;;GAEC,GACD,cAAc,MAAM;EACpB,OAAO;EAEP;;;;;;;;;;;GAWC,GACD,WAAW,aAAa,MAAM;EAE9B;IACE;;;;;;;KAOC,GACD,OAAO;IAEP;;;KAGC,GACD,iBAAiB;IAEjB;;;;;KAKC,GACD,QAAQ;IAER;;;;;KAKC,GACD,oBAAoB,MAAM;IAE1B;;;;;KAKC,GACD;;;KAGC,GACD,OAAO,MAAM;;;AAMjB,iBAAiB;GACd,KAAK,MAAM,GAAG;;AAGjB,OAAO,iBAAS,iBACd,OAAO,mBAAmB,GACzB;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DC,GACD,OAAO,iBAAe,KACpB,YAAY,6BAA6B,oBAAoB,EAC7D,cAAc,mBAAmB,EACjC,iBAAiB,QAAQ,wBAAwB,IAAI,GAAG,QAAQ,IAAI,CAAC,GACpE,QAAQ,oBAAoB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare function composeMcpDepTools(mcpConfig: z.input<typeof McpSettingsSchema> | z.infer<typeof McpSettingsSchema>, filterIn?: (params: {
|
|
1
|
+
import type { MCPSetting } from "../../service/tools.js";
|
|
2
|
+
export declare function composeMcpDepTools(mcpConfig: MCPSetting, filterIn?: (params: {
|
|
4
3
|
action: string;
|
|
5
4
|
tool: any;
|
|
6
5
|
mcpName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sources":["../../../../src/utils/common/mcp.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sources":["../../../../src/utils/common/mcp.ts"],"names":[],"mappings":"AAKA,cAA+B,UAAU,iCAAiC;AAwL1E,OAAO,iBAAe,mBACpB,WAAW,UAAU,EACrB,YAAY;EACV,QAAQ,MAAM;EACd,MAAM,GAAG;EACT,SAAS,MAAM;EACf,mBAAmB,MAAM;EACzB,kBAAkB,MAAM;EACxB,QAAQ,MAAM;MACV,OAAO,GACZ,QAAQ,OAAO,MAAM,EAAE,GAAG"}
|