@bluehive/sdk-mcp 0.1.0-alpha.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/LICENSE +201 -0
- package/README.md +188 -0
- package/compat.d.mts +56 -0
- package/compat.d.mts.map +1 -0
- package/compat.d.ts +56 -0
- package/compat.d.ts.map +1 -0
- package/compat.js +382 -0
- package/compat.js.map +1 -0
- package/compat.mjs +373 -0
- package/compat.mjs.map +1 -0
- package/dynamic-tools.d.mts +12 -0
- package/dynamic-tools.d.mts.map +1 -0
- package/dynamic-tools.d.ts +12 -0
- package/dynamic-tools.d.ts.map +1 -0
- package/dynamic-tools.js +135 -0
- package/dynamic-tools.js.map +1 -0
- package/dynamic-tools.mjs +132 -0
- package/dynamic-tools.mjs.map +1 -0
- package/index.d.mts +3 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +86 -0
- package/index.js.map +1 -0
- package/index.mjs +84 -0
- package/index.mjs.map +1 -0
- package/options.d.mts +14 -0
- package/options.d.mts.map +1 -0
- package/options.d.ts +14 -0
- package/options.d.ts.map +1 -0
- package/options.js +296 -0
- package/options.js.map +1 -0
- package/options.mjs +290 -0
- package/options.mjs.map +1 -0
- package/package.json +121 -0
- package/server.d.mts +47 -0
- package/server.d.mts.map +1 -0
- package/server.d.ts +47 -0
- package/server.d.ts.map +1 -0
- package/server.js +114 -0
- package/server.js.map +1 -0
- package/server.mjs +101 -0
- package/server.mjs.map +1 -0
- package/src/compat.ts +478 -0
- package/src/dynamic-tools.ts +153 -0
- package/src/index.ts +104 -0
- package/src/options.ts +319 -0
- package/src/server.ts +145 -0
- package/src/tools/database/check-health-database.ts +31 -0
- package/src/tools/fax/list-providers-fax.ts +31 -0
- package/src/tools/fax/retrieve-status-fax.ts +36 -0
- package/src/tools/fax/send-fax.ts +76 -0
- package/src/tools/health/check-health.ts +31 -0
- package/src/tools/index.ts +83 -0
- package/src/tools/providers/lookup-providers.ts +49 -0
- package/src/tools/types.ts +103 -0
- package/src/tools/version/retrieve-version.ts +31 -0
- package/src/tools.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/tools/database/check-health-database.d.mts +45 -0
- package/tools/database/check-health-database.d.mts.map +1 -0
- package/tools/database/check-health-database.d.ts +45 -0
- package/tools/database/check-health-database.d.ts.map +1 -0
- package/tools/database/check-health-database.js +27 -0
- package/tools/database/check-health-database.js.map +1 -0
- package/tools/database/check-health-database.mjs +23 -0
- package/tools/database/check-health-database.mjs.map +1 -0
- package/tools/fax/list-providers-fax.d.mts +45 -0
- package/tools/fax/list-providers-fax.d.mts.map +1 -0
- package/tools/fax/list-providers-fax.d.ts +45 -0
- package/tools/fax/list-providers-fax.d.ts.map +1 -0
- package/tools/fax/list-providers-fax.js +27 -0
- package/tools/fax/list-providers-fax.js.map +1 -0
- package/tools/fax/list-providers-fax.mjs +23 -0
- package/tools/fax/list-providers-fax.mjs.map +1 -0
- package/tools/fax/retrieve-status-fax.d.mts +45 -0
- package/tools/fax/retrieve-status-fax.d.mts.map +1 -0
- package/tools/fax/retrieve-status-fax.d.ts +45 -0
- package/tools/fax/retrieve-status-fax.d.ts.map +1 -0
- package/tools/fax/retrieve-status-fax.js +32 -0
- package/tools/fax/retrieve-status-fax.js.map +1 -0
- package/tools/fax/retrieve-status-fax.mjs +28 -0
- package/tools/fax/retrieve-status-fax.mjs.map +1 -0
- package/tools/fax/send-fax.d.mts +45 -0
- package/tools/fax/send-fax.d.mts.map +1 -0
- package/tools/fax/send-fax.d.ts +45 -0
- package/tools/fax/send-fax.d.ts.map +1 -0
- package/tools/fax/send-fax.js +72 -0
- package/tools/fax/send-fax.js.map +1 -0
- package/tools/fax/send-fax.mjs +68 -0
- package/tools/fax/send-fax.mjs.map +1 -0
- package/tools/health/check-health.d.mts +45 -0
- package/tools/health/check-health.d.mts.map +1 -0
- package/tools/health/check-health.d.ts +45 -0
- package/tools/health/check-health.d.ts.map +1 -0
- package/tools/health/check-health.js +27 -0
- package/tools/health/check-health.js.map +1 -0
- package/tools/health/check-health.mjs +23 -0
- package/tools/health/check-health.mjs.map +1 -0
- package/tools/index.d.mts +10 -0
- package/tools/index.d.mts.map +1 -0
- package/tools/index.d.ts +10 -0
- package/tools/index.d.ts.map +1 -0
- package/tools/index.js +67 -0
- package/tools/index.js.map +1 -0
- package/tools/index.mjs +60 -0
- package/tools/index.mjs.map +1 -0
- package/tools/providers/lookup-providers.d.mts +45 -0
- package/tools/providers/lookup-providers.d.mts.map +1 -0
- package/tools/providers/lookup-providers.d.ts +45 -0
- package/tools/providers/lookup-providers.d.ts.map +1 -0
- package/tools/providers/lookup-providers.js +45 -0
- package/tools/providers/lookup-providers.js.map +1 -0
- package/tools/providers/lookup-providers.mjs +41 -0
- package/tools/providers/lookup-providers.mjs.map +1 -0
- package/tools/types.d.mts +51 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +51 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +46 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +42 -0
- package/tools/types.mjs.map +1 -0
- package/tools/version/retrieve-version.d.mts +45 -0
- package/tools/version/retrieve-version.d.mts.map +1 -0
- package/tools/version/retrieve-version.d.ts +45 -0
- package/tools/version/retrieve-version.d.ts.map +1 -0
- package/tools/version/retrieve-version.js +27 -0
- package/tools/version/retrieve-version.js.map +1 -0
- package/tools/version/retrieve-version.mjs +23 -0
- package/tools/version/retrieve-version.mjs.map +1 -0
- package/tools.d.mts +2 -0
- package/tools.d.mts.map +1 -0
- package/tools.d.ts +2 -0
- package/tools.d.ts.map +1 -0
- package/tools.js +18 -0
- package/tools.js.map +1 -0
- package/tools.mjs +2 -0
- package/tools.mjs.map +1 -0
package/options.js
ADDED
@@ -0,0 +1,296 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.parseOptions = parseOptions;
|
7
|
+
const yargs_1 = __importDefault(require("yargs"));
|
8
|
+
const helpers_1 = require("yargs/helpers");
|
9
|
+
const tools_1 = require("./tools.js");
|
10
|
+
const compat_1 = require("./compat.js");
|
11
|
+
const CAPABILITY_CHOICES = [
|
12
|
+
'top-level-unions',
|
13
|
+
'valid-json',
|
14
|
+
'refs',
|
15
|
+
'unions',
|
16
|
+
'formats',
|
17
|
+
'tool-name-length',
|
18
|
+
];
|
19
|
+
function parseCapabilityValue(cap) {
|
20
|
+
if (cap.startsWith('tool-name-length=')) {
|
21
|
+
const parts = cap.split('=');
|
22
|
+
if (parts.length === 2) {
|
23
|
+
const length = parseInt(parts[1], 10);
|
24
|
+
if (!isNaN(length)) {
|
25
|
+
return { name: 'tool-name-length', value: length };
|
26
|
+
}
|
27
|
+
throw new Error(`Invalid tool-name-length value: ${parts[1]}. Expected a number.`);
|
28
|
+
}
|
29
|
+
throw new Error(`Invalid format for tool-name-length. Expected tool-name-length=N.`);
|
30
|
+
}
|
31
|
+
if (!CAPABILITY_CHOICES.includes(cap)) {
|
32
|
+
throw new Error(`Unknown capability: ${cap}. Valid capabilities are: ${CAPABILITY_CHOICES.join(', ')}`);
|
33
|
+
}
|
34
|
+
return { name: cap };
|
35
|
+
}
|
36
|
+
function parseOptions() {
|
37
|
+
const opts = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
38
|
+
.option('tools', {
|
39
|
+
type: 'string',
|
40
|
+
array: true,
|
41
|
+
choices: ['dynamic', 'all'],
|
42
|
+
description: 'Use dynamic tools or all tools',
|
43
|
+
})
|
44
|
+
.option('no-tools', {
|
45
|
+
type: 'string',
|
46
|
+
array: true,
|
47
|
+
choices: ['dynamic', 'all'],
|
48
|
+
description: 'Do not use any dynamic or all tools',
|
49
|
+
})
|
50
|
+
.option('tool', {
|
51
|
+
type: 'string',
|
52
|
+
array: true,
|
53
|
+
description: 'Include tools matching the specified names',
|
54
|
+
})
|
55
|
+
.option('resource', {
|
56
|
+
type: 'string',
|
57
|
+
array: true,
|
58
|
+
description: 'Include tools matching the specified resources',
|
59
|
+
})
|
60
|
+
.option('operation', {
|
61
|
+
type: 'string',
|
62
|
+
array: true,
|
63
|
+
choices: ['read', 'write'],
|
64
|
+
description: 'Include tools matching the specified operations',
|
65
|
+
})
|
66
|
+
.option('tag', {
|
67
|
+
type: 'string',
|
68
|
+
array: true,
|
69
|
+
description: 'Include tools with the specified tags',
|
70
|
+
})
|
71
|
+
.option('no-tool', {
|
72
|
+
type: 'string',
|
73
|
+
array: true,
|
74
|
+
description: 'Exclude tools matching the specified names',
|
75
|
+
})
|
76
|
+
.option('no-resource', {
|
77
|
+
type: 'string',
|
78
|
+
array: true,
|
79
|
+
description: 'Exclude tools matching the specified resources',
|
80
|
+
})
|
81
|
+
.option('no-operation', {
|
82
|
+
type: 'string',
|
83
|
+
array: true,
|
84
|
+
description: 'Exclude tools matching the specified operations',
|
85
|
+
})
|
86
|
+
.option('no-tag', {
|
87
|
+
type: 'string',
|
88
|
+
array: true,
|
89
|
+
description: 'Exclude tools with the specified tags',
|
90
|
+
})
|
91
|
+
.option('list', {
|
92
|
+
type: 'boolean',
|
93
|
+
description: 'List all tools and exit',
|
94
|
+
})
|
95
|
+
.option('client', {
|
96
|
+
type: 'string',
|
97
|
+
choices: Object.keys(compat_1.knownClients),
|
98
|
+
description: 'Specify the MCP client being used',
|
99
|
+
})
|
100
|
+
.option('capability', {
|
101
|
+
type: 'string',
|
102
|
+
array: true,
|
103
|
+
description: 'Specify client capabilities',
|
104
|
+
coerce: (values) => {
|
105
|
+
return values.flatMap((v) => v.split(','));
|
106
|
+
},
|
107
|
+
})
|
108
|
+
.option('no-capability', {
|
109
|
+
type: 'string',
|
110
|
+
array: true,
|
111
|
+
description: 'Unset client capabilities',
|
112
|
+
choices: CAPABILITY_CHOICES,
|
113
|
+
coerce: (values) => {
|
114
|
+
return values.flatMap((v) => v.split(','));
|
115
|
+
},
|
116
|
+
})
|
117
|
+
.option('describe-capabilities', {
|
118
|
+
type: 'boolean',
|
119
|
+
description: 'Print detailed explanation of client capabilities and exit',
|
120
|
+
})
|
121
|
+
.help();
|
122
|
+
for (const [command, desc] of examples()) {
|
123
|
+
opts.example(command, desc);
|
124
|
+
}
|
125
|
+
const argv = opts.parseSync();
|
126
|
+
// Handle describe-capabilities flag
|
127
|
+
if (argv.describeCapabilities) {
|
128
|
+
console.log(getCapabilitiesExplanation());
|
129
|
+
process.exit(0);
|
130
|
+
}
|
131
|
+
const filters = [];
|
132
|
+
// Helper function to support comma-separated values
|
133
|
+
const splitValues = (values) => {
|
134
|
+
if (!values)
|
135
|
+
return [];
|
136
|
+
return values.flatMap((v) => v.split(','));
|
137
|
+
};
|
138
|
+
for (const tag of splitValues(argv.tag)) {
|
139
|
+
filters.push({ type: 'tag', op: 'include', value: tag });
|
140
|
+
}
|
141
|
+
for (const tag of splitValues(argv.noTag)) {
|
142
|
+
filters.push({ type: 'tag', op: 'exclude', value: tag });
|
143
|
+
}
|
144
|
+
for (const resource of splitValues(argv.resource)) {
|
145
|
+
filters.push({ type: 'resource', op: 'include', value: resource });
|
146
|
+
}
|
147
|
+
for (const resource of splitValues(argv.noResource)) {
|
148
|
+
filters.push({ type: 'resource', op: 'exclude', value: resource });
|
149
|
+
}
|
150
|
+
for (const tool of splitValues(argv.tool)) {
|
151
|
+
filters.push({ type: 'tool', op: 'include', value: tool });
|
152
|
+
}
|
153
|
+
for (const tool of splitValues(argv.noTool)) {
|
154
|
+
filters.push({ type: 'tool', op: 'exclude', value: tool });
|
155
|
+
}
|
156
|
+
for (const operation of splitValues(argv.operation)) {
|
157
|
+
filters.push({ type: 'operation', op: 'include', value: operation });
|
158
|
+
}
|
159
|
+
for (const operation of splitValues(argv.noOperation)) {
|
160
|
+
filters.push({ type: 'operation', op: 'exclude', value: operation });
|
161
|
+
}
|
162
|
+
// Parse client capabilities
|
163
|
+
const clientCapabilities = {
|
164
|
+
topLevelUnions: true,
|
165
|
+
validJson: true,
|
166
|
+
refs: true,
|
167
|
+
unions: true,
|
168
|
+
formats: true,
|
169
|
+
toolNameLength: undefined,
|
170
|
+
};
|
171
|
+
// Apply individual capability overrides
|
172
|
+
if (Array.isArray(argv.capability)) {
|
173
|
+
for (const cap of argv.capability) {
|
174
|
+
const parsedCap = parseCapabilityValue(cap);
|
175
|
+
if (parsedCap.name === 'top-level-unions') {
|
176
|
+
clientCapabilities.topLevelUnions = true;
|
177
|
+
}
|
178
|
+
else if (parsedCap.name === 'valid-json') {
|
179
|
+
clientCapabilities.validJson = true;
|
180
|
+
}
|
181
|
+
else if (parsedCap.name === 'refs') {
|
182
|
+
clientCapabilities.refs = true;
|
183
|
+
}
|
184
|
+
else if (parsedCap.name === 'unions') {
|
185
|
+
clientCapabilities.unions = true;
|
186
|
+
}
|
187
|
+
else if (parsedCap.name === 'formats') {
|
188
|
+
clientCapabilities.formats = true;
|
189
|
+
}
|
190
|
+
else if (parsedCap.name === 'tool-name-length') {
|
191
|
+
clientCapabilities.toolNameLength = parsedCap.value;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
}
|
195
|
+
// Handle no-capability options to unset capabilities
|
196
|
+
if (Array.isArray(argv.noCapability)) {
|
197
|
+
for (const cap of argv.noCapability) {
|
198
|
+
if (cap === 'top-level-unions') {
|
199
|
+
clientCapabilities.topLevelUnions = false;
|
200
|
+
}
|
201
|
+
else if (cap === 'valid-json') {
|
202
|
+
clientCapabilities.validJson = false;
|
203
|
+
}
|
204
|
+
else if (cap === 'refs') {
|
205
|
+
clientCapabilities.refs = false;
|
206
|
+
}
|
207
|
+
else if (cap === 'unions') {
|
208
|
+
clientCapabilities.unions = false;
|
209
|
+
}
|
210
|
+
else if (cap === 'formats') {
|
211
|
+
clientCapabilities.formats = false;
|
212
|
+
}
|
213
|
+
else if (cap === 'tool-name-length') {
|
214
|
+
clientCapabilities.toolNameLength = undefined;
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|
218
|
+
const explicitTools = Boolean(argv.tools || argv.noTools);
|
219
|
+
const includeDynamicTools = explicitTools ? argv.tools?.includes('dynamic') && !argv.noTools?.includes('dynamic') : undefined;
|
220
|
+
const includeAllTools = explicitTools ? argv.tools?.includes('all') && !argv.noTools?.includes('all') : undefined;
|
221
|
+
const client = argv.client;
|
222
|
+
return {
|
223
|
+
client: client && compat_1.knownClients[client] ? client : undefined,
|
224
|
+
includeDynamicTools,
|
225
|
+
includeAllTools,
|
226
|
+
filters,
|
227
|
+
capabilities: clientCapabilities,
|
228
|
+
list: argv.list || false,
|
229
|
+
};
|
230
|
+
}
|
231
|
+
function getCapabilitiesExplanation() {
|
232
|
+
return `
|
233
|
+
Client Capabilities Explanation:
|
234
|
+
|
235
|
+
Different Language Models (LLMs) and the MCP clients that use them have varying limitations in how they handle tool schemas. Capability flags allow you to inform the MCP server about these limitations.
|
236
|
+
|
237
|
+
When a capability flag is set to false, the MCP server will automatically adjust the tool schemas to work around that limitation, ensuring broader compatibility.
|
238
|
+
|
239
|
+
Available Capabilities:
|
240
|
+
|
241
|
+
# top-level-unions
|
242
|
+
Some clients/LLMs do not support JSON schemas with a union type (anyOf) at the root level. If a client lacks this capability, the MCP server splits tools with top-level unions into multiple separate tools, one for each variant in the union.
|
243
|
+
|
244
|
+
# refs
|
245
|
+
Some clients/LLMs do not support $ref pointers for schema reuse. If a client lacks this capability, the MCP server automatically inlines all references ($defs) directly into the schema. Properties that would cause circular references are removed during this process.
|
246
|
+
|
247
|
+
# valid-json
|
248
|
+
Some clients/LLMs may incorrectly send arguments as a JSON-encoded string instead of a proper JSON object. If a client *has* this capability, the MCP server will attempt to parse string values as JSON if the initial validation against the schema fails.
|
249
|
+
|
250
|
+
# unions
|
251
|
+
Some clients/LLMs do not support union types (anyOf) in JSON schemas. If a client lacks this capability, the MCP server removes all anyOf fields and uses only the first variant as the schema.
|
252
|
+
|
253
|
+
# formats
|
254
|
+
Some clients/LLMs do not support the 'format' keyword in JSON Schema specifications. If a client lacks this capability, the MCP server removes all format fields and appends the format information to the field's description in parentheses.
|
255
|
+
|
256
|
+
# tool-name-length=N
|
257
|
+
Some clients/LLMs impose a maximum length on tool names. If this capability is set, the MCP server will automatically truncate tool names exceeding the specified length (N), ensuring uniqueness by appending numbers if necessary.
|
258
|
+
|
259
|
+
Client Presets (--client):
|
260
|
+
Presets like '--client=openai-agents' or '--client=cursor' automatically configure these capabilities based on current known limitations of those clients, simplifying setup.
|
261
|
+
|
262
|
+
Current presets:
|
263
|
+
${JSON.stringify(compat_1.knownClients, null, 2)}
|
264
|
+
`;
|
265
|
+
}
|
266
|
+
function examples() {
|
267
|
+
const firstEndpoint = tools_1.endpoints[0];
|
268
|
+
const secondEndpoint = tools_1.endpoints.find((e) => e.metadata.resource !== firstEndpoint.metadata.resource) || tools_1.endpoints[1];
|
269
|
+
const tag = tools_1.endpoints.find((e) => e.metadata.tags.length > 0)?.metadata.tags[0];
|
270
|
+
const otherEndpoint = secondEndpoint || firstEndpoint;
|
271
|
+
return [
|
272
|
+
[
|
273
|
+
`--tool="${firstEndpoint.tool.name}" ${secondEndpoint ? `--tool="${secondEndpoint.tool.name}"` : ''}`,
|
274
|
+
'Include tools by name',
|
275
|
+
],
|
276
|
+
[
|
277
|
+
`--resource="${firstEndpoint.metadata.resource}" --operation="read"`,
|
278
|
+
'Filter by resource and operation',
|
279
|
+
],
|
280
|
+
[
|
281
|
+
`--resource="${otherEndpoint.metadata.resource}*" --no-tool="${otherEndpoint.tool.name}"`,
|
282
|
+
'Use resource wildcards and exclusions',
|
283
|
+
],
|
284
|
+
[`--client="cursor"`, 'Adjust schemas to be more compatible with Cursor'],
|
285
|
+
[
|
286
|
+
`--capability="top-level-unions" --capability="tool-name-length=40"`,
|
287
|
+
'Specify individual client capabilities',
|
288
|
+
],
|
289
|
+
[
|
290
|
+
`--client="cursor" --no-capability="tool-name-length"`,
|
291
|
+
'Use cursor client preset but remove tool name length limit',
|
292
|
+
],
|
293
|
+
...(tag ? [[`--tag="${tag}"`, 'Filter based on tags']] : []),
|
294
|
+
];
|
295
|
+
}
|
296
|
+
//# sourceMappingURL=options.js.map
|
package/options.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":";;;;;AA8CA,oCA2MC;AAzPD,kDAA0B;AAC1B,2CAAwC;AACxC,sCAA4C;AAC5C,wCAAwE;AAcxE,MAAM,kBAAkB,GAAG;IACzB,kBAAkB;IAClB,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,SAAS;IACT,kBAAkB;CACV,CAAC;AAIX,SAAS,oBAAoB,CAAC,GAAW;IACvC,IAAI,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC,CAAC;YACvC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnB,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;YACrD,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;IACD,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAiB,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,6BAA6B,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1G,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,GAAiB,EAAE,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,UAAU,GAAG,GAAG,EAAE,sBAAsB,CAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACjF,CAAC;AACJ,CAAC"}
|
package/options.mjs
ADDED
@@ -0,0 +1,290 @@
|
|
1
|
+
import yargs from 'yargs';
|
2
|
+
import { hideBin } from 'yargs/helpers';
|
3
|
+
import { endpoints } from "./tools.mjs";
|
4
|
+
import { knownClients } from "./compat.mjs";
|
5
|
+
const CAPABILITY_CHOICES = [
|
6
|
+
'top-level-unions',
|
7
|
+
'valid-json',
|
8
|
+
'refs',
|
9
|
+
'unions',
|
10
|
+
'formats',
|
11
|
+
'tool-name-length',
|
12
|
+
];
|
13
|
+
function parseCapabilityValue(cap) {
|
14
|
+
if (cap.startsWith('tool-name-length=')) {
|
15
|
+
const parts = cap.split('=');
|
16
|
+
if (parts.length === 2) {
|
17
|
+
const length = parseInt(parts[1], 10);
|
18
|
+
if (!isNaN(length)) {
|
19
|
+
return { name: 'tool-name-length', value: length };
|
20
|
+
}
|
21
|
+
throw new Error(`Invalid tool-name-length value: ${parts[1]}. Expected a number.`);
|
22
|
+
}
|
23
|
+
throw new Error(`Invalid format for tool-name-length. Expected tool-name-length=N.`);
|
24
|
+
}
|
25
|
+
if (!CAPABILITY_CHOICES.includes(cap)) {
|
26
|
+
throw new Error(`Unknown capability: ${cap}. Valid capabilities are: ${CAPABILITY_CHOICES.join(', ')}`);
|
27
|
+
}
|
28
|
+
return { name: cap };
|
29
|
+
}
|
30
|
+
export function parseOptions() {
|
31
|
+
const opts = yargs(hideBin(process.argv))
|
32
|
+
.option('tools', {
|
33
|
+
type: 'string',
|
34
|
+
array: true,
|
35
|
+
choices: ['dynamic', 'all'],
|
36
|
+
description: 'Use dynamic tools or all tools',
|
37
|
+
})
|
38
|
+
.option('no-tools', {
|
39
|
+
type: 'string',
|
40
|
+
array: true,
|
41
|
+
choices: ['dynamic', 'all'],
|
42
|
+
description: 'Do not use any dynamic or all tools',
|
43
|
+
})
|
44
|
+
.option('tool', {
|
45
|
+
type: 'string',
|
46
|
+
array: true,
|
47
|
+
description: 'Include tools matching the specified names',
|
48
|
+
})
|
49
|
+
.option('resource', {
|
50
|
+
type: 'string',
|
51
|
+
array: true,
|
52
|
+
description: 'Include tools matching the specified resources',
|
53
|
+
})
|
54
|
+
.option('operation', {
|
55
|
+
type: 'string',
|
56
|
+
array: true,
|
57
|
+
choices: ['read', 'write'],
|
58
|
+
description: 'Include tools matching the specified operations',
|
59
|
+
})
|
60
|
+
.option('tag', {
|
61
|
+
type: 'string',
|
62
|
+
array: true,
|
63
|
+
description: 'Include tools with the specified tags',
|
64
|
+
})
|
65
|
+
.option('no-tool', {
|
66
|
+
type: 'string',
|
67
|
+
array: true,
|
68
|
+
description: 'Exclude tools matching the specified names',
|
69
|
+
})
|
70
|
+
.option('no-resource', {
|
71
|
+
type: 'string',
|
72
|
+
array: true,
|
73
|
+
description: 'Exclude tools matching the specified resources',
|
74
|
+
})
|
75
|
+
.option('no-operation', {
|
76
|
+
type: 'string',
|
77
|
+
array: true,
|
78
|
+
description: 'Exclude tools matching the specified operations',
|
79
|
+
})
|
80
|
+
.option('no-tag', {
|
81
|
+
type: 'string',
|
82
|
+
array: true,
|
83
|
+
description: 'Exclude tools with the specified tags',
|
84
|
+
})
|
85
|
+
.option('list', {
|
86
|
+
type: 'boolean',
|
87
|
+
description: 'List all tools and exit',
|
88
|
+
})
|
89
|
+
.option('client', {
|
90
|
+
type: 'string',
|
91
|
+
choices: Object.keys(knownClients),
|
92
|
+
description: 'Specify the MCP client being used',
|
93
|
+
})
|
94
|
+
.option('capability', {
|
95
|
+
type: 'string',
|
96
|
+
array: true,
|
97
|
+
description: 'Specify client capabilities',
|
98
|
+
coerce: (values) => {
|
99
|
+
return values.flatMap((v) => v.split(','));
|
100
|
+
},
|
101
|
+
})
|
102
|
+
.option('no-capability', {
|
103
|
+
type: 'string',
|
104
|
+
array: true,
|
105
|
+
description: 'Unset client capabilities',
|
106
|
+
choices: CAPABILITY_CHOICES,
|
107
|
+
coerce: (values) => {
|
108
|
+
return values.flatMap((v) => v.split(','));
|
109
|
+
},
|
110
|
+
})
|
111
|
+
.option('describe-capabilities', {
|
112
|
+
type: 'boolean',
|
113
|
+
description: 'Print detailed explanation of client capabilities and exit',
|
114
|
+
})
|
115
|
+
.help();
|
116
|
+
for (const [command, desc] of examples()) {
|
117
|
+
opts.example(command, desc);
|
118
|
+
}
|
119
|
+
const argv = opts.parseSync();
|
120
|
+
// Handle describe-capabilities flag
|
121
|
+
if (argv.describeCapabilities) {
|
122
|
+
console.log(getCapabilitiesExplanation());
|
123
|
+
process.exit(0);
|
124
|
+
}
|
125
|
+
const filters = [];
|
126
|
+
// Helper function to support comma-separated values
|
127
|
+
const splitValues = (values) => {
|
128
|
+
if (!values)
|
129
|
+
return [];
|
130
|
+
return values.flatMap((v) => v.split(','));
|
131
|
+
};
|
132
|
+
for (const tag of splitValues(argv.tag)) {
|
133
|
+
filters.push({ type: 'tag', op: 'include', value: tag });
|
134
|
+
}
|
135
|
+
for (const tag of splitValues(argv.noTag)) {
|
136
|
+
filters.push({ type: 'tag', op: 'exclude', value: tag });
|
137
|
+
}
|
138
|
+
for (const resource of splitValues(argv.resource)) {
|
139
|
+
filters.push({ type: 'resource', op: 'include', value: resource });
|
140
|
+
}
|
141
|
+
for (const resource of splitValues(argv.noResource)) {
|
142
|
+
filters.push({ type: 'resource', op: 'exclude', value: resource });
|
143
|
+
}
|
144
|
+
for (const tool of splitValues(argv.tool)) {
|
145
|
+
filters.push({ type: 'tool', op: 'include', value: tool });
|
146
|
+
}
|
147
|
+
for (const tool of splitValues(argv.noTool)) {
|
148
|
+
filters.push({ type: 'tool', op: 'exclude', value: tool });
|
149
|
+
}
|
150
|
+
for (const operation of splitValues(argv.operation)) {
|
151
|
+
filters.push({ type: 'operation', op: 'include', value: operation });
|
152
|
+
}
|
153
|
+
for (const operation of splitValues(argv.noOperation)) {
|
154
|
+
filters.push({ type: 'operation', op: 'exclude', value: operation });
|
155
|
+
}
|
156
|
+
// Parse client capabilities
|
157
|
+
const clientCapabilities = {
|
158
|
+
topLevelUnions: true,
|
159
|
+
validJson: true,
|
160
|
+
refs: true,
|
161
|
+
unions: true,
|
162
|
+
formats: true,
|
163
|
+
toolNameLength: undefined,
|
164
|
+
};
|
165
|
+
// Apply individual capability overrides
|
166
|
+
if (Array.isArray(argv.capability)) {
|
167
|
+
for (const cap of argv.capability) {
|
168
|
+
const parsedCap = parseCapabilityValue(cap);
|
169
|
+
if (parsedCap.name === 'top-level-unions') {
|
170
|
+
clientCapabilities.topLevelUnions = true;
|
171
|
+
}
|
172
|
+
else if (parsedCap.name === 'valid-json') {
|
173
|
+
clientCapabilities.validJson = true;
|
174
|
+
}
|
175
|
+
else if (parsedCap.name === 'refs') {
|
176
|
+
clientCapabilities.refs = true;
|
177
|
+
}
|
178
|
+
else if (parsedCap.name === 'unions') {
|
179
|
+
clientCapabilities.unions = true;
|
180
|
+
}
|
181
|
+
else if (parsedCap.name === 'formats') {
|
182
|
+
clientCapabilities.formats = true;
|
183
|
+
}
|
184
|
+
else if (parsedCap.name === 'tool-name-length') {
|
185
|
+
clientCapabilities.toolNameLength = parsedCap.value;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
}
|
189
|
+
// Handle no-capability options to unset capabilities
|
190
|
+
if (Array.isArray(argv.noCapability)) {
|
191
|
+
for (const cap of argv.noCapability) {
|
192
|
+
if (cap === 'top-level-unions') {
|
193
|
+
clientCapabilities.topLevelUnions = false;
|
194
|
+
}
|
195
|
+
else if (cap === 'valid-json') {
|
196
|
+
clientCapabilities.validJson = false;
|
197
|
+
}
|
198
|
+
else if (cap === 'refs') {
|
199
|
+
clientCapabilities.refs = false;
|
200
|
+
}
|
201
|
+
else if (cap === 'unions') {
|
202
|
+
clientCapabilities.unions = false;
|
203
|
+
}
|
204
|
+
else if (cap === 'formats') {
|
205
|
+
clientCapabilities.formats = false;
|
206
|
+
}
|
207
|
+
else if (cap === 'tool-name-length') {
|
208
|
+
clientCapabilities.toolNameLength = undefined;
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
const explicitTools = Boolean(argv.tools || argv.noTools);
|
213
|
+
const includeDynamicTools = explicitTools ? argv.tools?.includes('dynamic') && !argv.noTools?.includes('dynamic') : undefined;
|
214
|
+
const includeAllTools = explicitTools ? argv.tools?.includes('all') && !argv.noTools?.includes('all') : undefined;
|
215
|
+
const client = argv.client;
|
216
|
+
return {
|
217
|
+
client: client && knownClients[client] ? client : undefined,
|
218
|
+
includeDynamicTools,
|
219
|
+
includeAllTools,
|
220
|
+
filters,
|
221
|
+
capabilities: clientCapabilities,
|
222
|
+
list: argv.list || false,
|
223
|
+
};
|
224
|
+
}
|
225
|
+
function getCapabilitiesExplanation() {
|
226
|
+
return `
|
227
|
+
Client Capabilities Explanation:
|
228
|
+
|
229
|
+
Different Language Models (LLMs) and the MCP clients that use them have varying limitations in how they handle tool schemas. Capability flags allow you to inform the MCP server about these limitations.
|
230
|
+
|
231
|
+
When a capability flag is set to false, the MCP server will automatically adjust the tool schemas to work around that limitation, ensuring broader compatibility.
|
232
|
+
|
233
|
+
Available Capabilities:
|
234
|
+
|
235
|
+
# top-level-unions
|
236
|
+
Some clients/LLMs do not support JSON schemas with a union type (anyOf) at the root level. If a client lacks this capability, the MCP server splits tools with top-level unions into multiple separate tools, one for each variant in the union.
|
237
|
+
|
238
|
+
# refs
|
239
|
+
Some clients/LLMs do not support $ref pointers for schema reuse. If a client lacks this capability, the MCP server automatically inlines all references ($defs) directly into the schema. Properties that would cause circular references are removed during this process.
|
240
|
+
|
241
|
+
# valid-json
|
242
|
+
Some clients/LLMs may incorrectly send arguments as a JSON-encoded string instead of a proper JSON object. If a client *has* this capability, the MCP server will attempt to parse string values as JSON if the initial validation against the schema fails.
|
243
|
+
|
244
|
+
# unions
|
245
|
+
Some clients/LLMs do not support union types (anyOf) in JSON schemas. If a client lacks this capability, the MCP server removes all anyOf fields and uses only the first variant as the schema.
|
246
|
+
|
247
|
+
# formats
|
248
|
+
Some clients/LLMs do not support the 'format' keyword in JSON Schema specifications. If a client lacks this capability, the MCP server removes all format fields and appends the format information to the field's description in parentheses.
|
249
|
+
|
250
|
+
# tool-name-length=N
|
251
|
+
Some clients/LLMs impose a maximum length on tool names. If this capability is set, the MCP server will automatically truncate tool names exceeding the specified length (N), ensuring uniqueness by appending numbers if necessary.
|
252
|
+
|
253
|
+
Client Presets (--client):
|
254
|
+
Presets like '--client=openai-agents' or '--client=cursor' automatically configure these capabilities based on current known limitations of those clients, simplifying setup.
|
255
|
+
|
256
|
+
Current presets:
|
257
|
+
${JSON.stringify(knownClients, null, 2)}
|
258
|
+
`;
|
259
|
+
}
|
260
|
+
function examples() {
|
261
|
+
const firstEndpoint = endpoints[0];
|
262
|
+
const secondEndpoint = endpoints.find((e) => e.metadata.resource !== firstEndpoint.metadata.resource) || endpoints[1];
|
263
|
+
const tag = endpoints.find((e) => e.metadata.tags.length > 0)?.metadata.tags[0];
|
264
|
+
const otherEndpoint = secondEndpoint || firstEndpoint;
|
265
|
+
return [
|
266
|
+
[
|
267
|
+
`--tool="${firstEndpoint.tool.name}" ${secondEndpoint ? `--tool="${secondEndpoint.tool.name}"` : ''}`,
|
268
|
+
'Include tools by name',
|
269
|
+
],
|
270
|
+
[
|
271
|
+
`--resource="${firstEndpoint.metadata.resource}" --operation="read"`,
|
272
|
+
'Filter by resource and operation',
|
273
|
+
],
|
274
|
+
[
|
275
|
+
`--resource="${otherEndpoint.metadata.resource}*" --no-tool="${otherEndpoint.tool.name}"`,
|
276
|
+
'Use resource wildcards and exclusions',
|
277
|
+
],
|
278
|
+
[`--client="cursor"`, 'Adjust schemas to be more compatible with Cursor'],
|
279
|
+
[
|
280
|
+
`--capability="top-level-unions" --capability="tool-name-length=40"`,
|
281
|
+
'Specify individual client capabilities',
|
282
|
+
],
|
283
|
+
[
|
284
|
+
`--client="cursor" --no-capability="tool-name-length"`,
|
285
|
+
'Use cursor client preset but remove tool name length limit',
|
286
|
+
],
|
287
|
+
...(tag ? [[`--tag="${tag}"`, 'Filter based on tags']] : []),
|
288
|
+
];
|
289
|
+
}
|
290
|
+
//# sourceMappingURL=options.mjs.map
|
package/options.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"options.mjs","sourceRoot":"","sources":["src/options.ts"],"names":[],"mappings":"OAAO,KAAK,MAAM,OAAO;OAClB,EAAE,OAAO,EAAE,MAAM,eAAe;OAChC,EAAE,SAAS,EAAU;OACrB,EAAsB,YAAY,EAAc;AAcvD,MAAM,kBAAkB,GAAG;IACzB,kBAAkB;IAClB,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,SAAS;IACT,kBAAkB;CACV,CAAC;AAIX,SAAS,oBAAoB,CAAC,GAAW;IACvC,IAAI,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC,CAAC;YACvC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnB,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;YACrD,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;IACD,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAiB,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,6BAA6B,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1G,CAAC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