deadbyte-mcp 0.15.49 → 0.15.50
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/MANIFEST.SHA256 +82 -78
- package/PROVENANCE.json +3 -3
- package/README.txt +18 -18
- package/RELEASE.json +5 -5
- package/SBOM.cdx.json +2 -2
- package/TEST-MATRIX.json +2 -2
- package/docs/R130-SDK-SECURITY-PATCH.md +34 -0
- package/node_modules/@modelcontextprotocol/client/README.md +1 -7
- package/node_modules/@modelcontextprotocol/client/dist/{index-BCtJi0p5.d.mts → index-B-4n9P0J.d.mts} +5 -1
- package/node_modules/@modelcontextprotocol/client/dist/index-B-4n9P0J.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/{index-CEk3qkZM.d.cts → index-J2FaQ-KY.d.cts} +5 -1
- package/node_modules/@modelcontextprotocol/client/dist/index-J2FaQ-KY.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +175 -76
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +214 -35
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +214 -35
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +175 -76
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/{src-D0qEN74R.cjs → src-DpAS0jfg.cjs} +125 -11
- package/node_modules/@modelcontextprotocol/client/dist/src-DpAS0jfg.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/{src-DDAAhLnO.mjs → src-WCy6ifGf.mjs} +102 -12
- package/node_modules/@modelcontextprotocol/client/dist/src-WCy6ifGf.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +1 -1
- package/node_modules/@modelcontextprotocol/client/package.json +5 -5
- package/node_modules/@modelcontextprotocol/core/dist/{auth--n_Yzytt.d.cts → auth-Anm-lwWi.d.mts} +9 -8
- package/node_modules/@modelcontextprotocol/core/dist/{auth--n_Yzytt.d.cts.map → auth-Anm-lwWi.d.mts.map} +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/{auth-CGP0BDVq.mjs → auth-BNDyLTqp.mjs} +5 -3
- package/node_modules/@modelcontextprotocol/core/dist/{auth-CGP0BDVq.mjs.map → auth-BNDyLTqp.mjs.map} +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/{auth-4-zilcqg.cjs → auth-D1CeV_Jr.cjs} +5 -3
- package/node_modules/@modelcontextprotocol/core/dist/{auth-4-zilcqg.cjs.map → auth-D1CeV_Jr.cjs.map} +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/{auth-YUQV3RRv.d.mts → auth-V9XJSCfa.d.cts} +9 -8
- package/node_modules/@modelcontextprotocol/core/dist/{auth-YUQV3RRv.d.mts.map → auth-V9XJSCfa.d.cts.map} +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +1 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +1 -1
- package/node_modules/@modelcontextprotocol/core/package.json +2 -2
- package/node_modules/@modelcontextprotocol/server/README.md +1 -7
- package/node_modules/@modelcontextprotocol/server/dist/{createMcpHandler-Bt6U_Fqb.d.mts → createMcpHandler-D4NN8WsG.d.mts} +35 -13
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D4NN8WsG.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/{createMcpHandler-BLVe3qmU.d.cts → createMcpHandler-DZmmlN8e.d.cts} +35 -13
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DZmmlN8e.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs +32 -5
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -1
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +41 -5
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -1
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +41 -5
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -1
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs +32 -5
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -1
- package/node_modules/@modelcontextprotocol/server/dist/{mcp-DUcCQSTW.cjs → mcp-BumlNux0.cjs} +73 -23
- package/node_modules/@modelcontextprotocol/server/dist/mcp-BumlNux0.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/{mcp-Dw2OlZ1f.mjs → mcp-DIH4cS6P.mjs} +73 -23
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +1 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +1 -1
- package/node_modules/@modelcontextprotocol/server/dist/{src-CgFsfg3E.cjs → src-BhnGYybN.cjs} +29 -11
- package/node_modules/@modelcontextprotocol/server/dist/src-BhnGYybN.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/{src-D-y6h4N7.mjs → src-Cqbh3MYc.mjs} +29 -11
- package/node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +2 -2
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +1 -1
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +1 -1
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +2 -2
- package/node_modules/@modelcontextprotocol/server/package.json +4 -4
- package/node_modules/which/CHANGELOG.md +166 -0
- package/package.json +3 -3
- package/src/version.mjs +1 -1
- package/test/r129-sdk-security-baseline.test.mjs +38 -0
- package/test/r130-release-security-contract.test.mjs +28 -0
- package/test/r59-tool-surface-compat.test.mjs +1 -1
- package/test/r74-prepublish-contract.test.mjs +2 -2
- package/node_modules/@modelcontextprotocol/client/dist/index-BCtJi0p5.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/index-CEk3qkZM.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/src-D0qEN74R.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/src-DDAAhLnO.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BLVe3qmU.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-Bt6U_Fqb.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DUcCQSTW.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/mcp-Dw2OlZ1f.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/src-CgFsfg3E.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/src-D-y6h4N7.mjs.map +0 -1
package/node_modules/@modelcontextprotocol/server/dist/{mcp-DUcCQSTW.cjs → mcp-BumlNux0.cjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-Bnu9O96Y.cjs');
|
|
2
|
-
const require_src = require('./src-
|
|
2
|
+
const require_src = require('./src-BhnGYybN.cjs');
|
|
3
3
|
let _modelcontextprotocol_server__shims = require("@modelcontextprotocol/server/_shims");
|
|
4
4
|
let _modelcontextprotocol_core_internal = require("@modelcontextprotocol/core/internal");
|
|
5
5
|
|
|
@@ -287,6 +287,10 @@ function createListenRouter(options) {
|
|
|
287
287
|
params: { notifications: honored }
|
|
288
288
|
}, subscriptionId);
|
|
289
289
|
writeNotification(ack.method, ack.params);
|
|
290
|
+
if (Object.keys(honored).length === 0) {
|
|
291
|
+
teardown(true);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
290
294
|
unsubscribe = bus.subscribe((event) => {
|
|
291
295
|
if (closed || !listenFilterAccepts(honored, event)) return;
|
|
292
296
|
const note = stampSubscriptionId(serverEventToNotification(event), subscriptionId);
|
|
@@ -351,7 +355,7 @@ var StdioListenRouter = class {
|
|
|
351
355
|
_serverCapabilities;
|
|
352
356
|
/**
|
|
353
357
|
* The serving instance's identity, stamped onto the graceful-close
|
|
354
|
-
* results' `_meta` (the spec's `
|
|
358
|
+
* results' `_meta` (the spec's `SubscriptionsListenResultMetaObject` extends
|
|
355
359
|
* `ResultMetaObject`). Handed over together with the capabilities.
|
|
356
360
|
*/
|
|
357
361
|
_serverInfo;
|
|
@@ -478,6 +482,15 @@ function notificationToServerEvent(method, uri) {
|
|
|
478
482
|
|
|
479
483
|
//#endregion
|
|
480
484
|
//#region src/server/middleware/bearerAuth.ts
|
|
485
|
+
function comparableResource(value) {
|
|
486
|
+
const text = String(value);
|
|
487
|
+
const hash = text.indexOf("#");
|
|
488
|
+
return (hash === -1 ? text : text.slice(0, hash)).replace(/\/$/, "");
|
|
489
|
+
}
|
|
490
|
+
function sameResource(reported, expected) {
|
|
491
|
+
if (!reported) return false;
|
|
492
|
+
return comparableResource(reported) === comparableResource(expected);
|
|
493
|
+
}
|
|
481
494
|
function headerQuotedValue(value) {
|
|
482
495
|
return value.replaceAll(/[\\"]/g, String.raw`\$&`).replaceAll(/[^\u0020-\u007E]/g, " ");
|
|
483
496
|
}
|
|
@@ -501,7 +514,8 @@ function buildWwwAuthenticateHeader(errorCode, description, requiredScopes, reso
|
|
|
501
514
|
* the verified {@link AuthInfo}.
|
|
502
515
|
*
|
|
503
516
|
* The runtime-neutral core of Bearer authentication: it parses the header,
|
|
504
|
-
* runs the verifier,
|
|
517
|
+
* runs the verifier, compares the token's resource with `expectedResource`,
|
|
518
|
+
* enforces `requiredScopes`, and rejects tokens without an
|
|
505
519
|
* expiration or past it. On any failure it throws an {@link OAuthError} —
|
|
506
520
|
* pass that to {@link bearerAuthChallengeResponse} for the matching HTTP
|
|
507
521
|
* answer, or use {@link requireBearerAuth} to get both steps as one call.
|
|
@@ -510,11 +524,12 @@ function buildWwwAuthenticateHeader(errorCode, description, requiredScopes, reso
|
|
|
510
524
|
* `@modelcontextprotocol/express` feeds it `req.headers.authorization`.
|
|
511
525
|
*/
|
|
512
526
|
async function verifyBearerToken(authorizationHeader, options) {
|
|
513
|
-
const { verifier, requiredScopes = [] } = options;
|
|
527
|
+
const { verifier, requiredScopes = [], expectedResource } = options;
|
|
514
528
|
if (!authorizationHeader) throw new require_src.OAuthError(require_src.OAuthErrorCode.InvalidToken, "Missing Authorization header");
|
|
515
529
|
const [type, token] = authorizationHeader.split(" ");
|
|
516
530
|
if (type?.toLowerCase() !== "bearer" || !token) throw new require_src.OAuthError(require_src.OAuthErrorCode.InvalidToken, "Invalid Authorization header format, expected 'Bearer TOKEN'");
|
|
517
531
|
const authInfo = await verifier.verifyAccessToken(token);
|
|
532
|
+
if (expectedResource !== void 0 && !sameResource(authInfo.resource, expectedResource)) throw new require_src.OAuthError(require_src.OAuthErrorCode.InvalidToken, "Token was not issued for this resource");
|
|
518
533
|
if (requiredScopes.length > 0) {
|
|
519
534
|
if (!requiredScopes.every((scope) => authInfo.scopes.includes(scope))) throw new require_src.OAuthError(require_src.OAuthErrorCode.InsufficientScope, "Insufficient scope");
|
|
520
535
|
}
|
|
@@ -582,11 +597,12 @@ function bearerAuthChallengeResponse(error, options) {
|
|
|
582
597
|
* ```
|
|
583
598
|
*/
|
|
584
599
|
function requireBearerAuth(options) {
|
|
585
|
-
const { verifier, requiredScopes = [], resourceMetadataUrl } = options;
|
|
600
|
+
const { verifier, requiredScopes = [], resourceMetadataUrl, expectedResource } = options;
|
|
586
601
|
const resolved = {
|
|
587
602
|
verifier,
|
|
588
603
|
requiredScopes,
|
|
589
|
-
resourceMetadataUrl
|
|
604
|
+
resourceMetadataUrl,
|
|
605
|
+
expectedResource
|
|
590
606
|
};
|
|
591
607
|
return async (request) => {
|
|
592
608
|
const [authorizationHeader] = (request.headers.get("authorization") ?? "").split(",");
|
|
@@ -968,7 +984,7 @@ function installModernOnlyHandlers(server, servedModernVersions) {
|
|
|
968
984
|
* Package-internal: the instance's implementation identity, for the serving
|
|
969
985
|
* entries to stamp onto entry-built results (the `subscriptions/listen`
|
|
970
986
|
* graceful-close result — built outside the encode seam, but the spec's
|
|
971
|
-
* `
|
|
987
|
+
* `SubscriptionsListenResultMetaObject` extends `ResultMetaObject`, so it carries
|
|
972
988
|
* the serverInfo SHOULD like every other result). Not public API.
|
|
973
989
|
*/
|
|
974
990
|
function serverIdentityOf(server) {
|
|
@@ -1039,6 +1055,11 @@ var Server = class extends require_src.Protocol {
|
|
|
1039
1055
|
if (require_src.modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler("server/discover", () => this._ondiscover());
|
|
1040
1056
|
if (this._capabilities.logging) this._registerLoggingHandler();
|
|
1041
1057
|
}
|
|
1058
|
+
/** Attaches to the given transport; rejects while this instance is connected to another one. */
|
|
1059
|
+
async connect(transport) {
|
|
1060
|
+
if (this.transport !== void 0) throw new require_src.SdkError(require_src.SdkErrorCode.AlreadyConnected, "Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");
|
|
1061
|
+
await super.connect(transport);
|
|
1062
|
+
}
|
|
1042
1063
|
/**
|
|
1043
1064
|
* Registers the built-in `logging/setLevel` request handler.
|
|
1044
1065
|
*
|
|
@@ -1600,6 +1621,30 @@ function discoverAdvertisedCapabilities(capabilities) {
|
|
|
1600
1621
|
|
|
1601
1622
|
//#endregion
|
|
1602
1623
|
//#region src/server/mcp.ts
|
|
1624
|
+
function toolInputElementCount(value, max) {
|
|
1625
|
+
let count = 0;
|
|
1626
|
+
const stack = [value];
|
|
1627
|
+
while (stack.length > 0) {
|
|
1628
|
+
const node = stack.pop();
|
|
1629
|
+
if (node === null || typeof node !== "object") continue;
|
|
1630
|
+
if (Array.isArray(node)) for (const child of node) {
|
|
1631
|
+
if (++count > max) return count;
|
|
1632
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
1633
|
+
}
|
|
1634
|
+
else for (const key in node) {
|
|
1635
|
+
if (!Object.prototype.hasOwnProperty.call(node, key)) continue;
|
|
1636
|
+
if (++count > max) return count;
|
|
1637
|
+
const child = node[key];
|
|
1638
|
+
if (child !== null && typeof child === "object") stack.push(child);
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
return count;
|
|
1642
|
+
}
|
|
1643
|
+
function resolveMaxToolInputElements(value) {
|
|
1644
|
+
if (value === void 0 || value === Infinity) return void 0;
|
|
1645
|
+
if (typeof value !== "number" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
|
|
1646
|
+
return value;
|
|
1647
|
+
}
|
|
1603
1648
|
/**
|
|
1604
1649
|
* High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
|
|
1605
1650
|
* For advanced usage (like sending notifications or setting custom request handlers), use the underlying
|
|
@@ -1618,16 +1663,12 @@ var McpServer = class {
|
|
|
1618
1663
|
* The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
|
|
1619
1664
|
*/
|
|
1620
1665
|
server;
|
|
1666
|
+
_maxToolInputElements;
|
|
1621
1667
|
_registeredResources = {};
|
|
1622
1668
|
_registeredResourceTemplates = {};
|
|
1623
1669
|
_registeredTools = {};
|
|
1624
1670
|
_registeredPrompts = {};
|
|
1625
|
-
/**
|
|
1626
|
-
* Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
|
|
1627
|
-
* registration-time scan and the pre-dispatch validation step share one
|
|
1628
|
-
* conversion instead of paying it twice per request under the
|
|
1629
|
-
* per-request-factory `createMcpHandler` model.
|
|
1630
|
-
*/
|
|
1671
|
+
/** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
|
|
1631
1672
|
_toolInputSchemaJson = {};
|
|
1632
1673
|
/**
|
|
1633
1674
|
* The JSON-serialized `inputSchema` of a registered tool, or `undefined`
|
|
@@ -1652,6 +1693,7 @@ var McpServer = class {
|
|
|
1652
1693
|
}
|
|
1653
1694
|
constructor(serverInfo, options) {
|
|
1654
1695
|
this.server = new Server(serverInfo, options);
|
|
1696
|
+
this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
|
|
1655
1697
|
if (options?.capabilities?.tools) this.setToolRequestHandlers();
|
|
1656
1698
|
if (options?.capabilities?.resources) this.setResourceRequestHandlers();
|
|
1657
1699
|
if (options?.capabilities?.prompts) this.setPromptRequestHandlers();
|
|
@@ -1723,7 +1765,7 @@ var McpServer = class {
|
|
|
1723
1765
|
name,
|
|
1724
1766
|
title: tool.title,
|
|
1725
1767
|
description: tool.description,
|
|
1726
|
-
inputSchema: tool.inputSchema ?
|
|
1768
|
+
inputSchema: tool.inputSchema ? convertListedInputSchema(name, tool.inputSchema) : EMPTY_OBJECT_JSON_SCHEMA,
|
|
1727
1769
|
annotations: tool.annotations,
|
|
1728
1770
|
icons: tool.icons,
|
|
1729
1771
|
execution: tool.execution,
|
|
@@ -1768,6 +1810,7 @@ var McpServer = class {
|
|
|
1768
1810
|
* Validates tool input arguments against the tool's input schema.
|
|
1769
1811
|
*/
|
|
1770
1812
|
async validateToolInput(tool, args, toolName) {
|
|
1813
|
+
if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
|
|
1771
1814
|
if (!tool.inputSchema) return;
|
|
1772
1815
|
const parseResult = await require_src.validateStandardSchema(tool.inputSchema, args ?? {});
|
|
1773
1816
|
if (!parseResult.success) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);
|
|
@@ -2041,19 +2084,19 @@ var McpServer = class {
|
|
|
2041
2084
|
}
|
|
2042
2085
|
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {
|
|
2043
2086
|
require_src.validateAndWarnToolName(name);
|
|
2044
|
-
if (inputSchema !== void 0) try {
|
|
2045
|
-
const json = require_src.standardSchemaToJsonSchema(inputSchema, "input");
|
|
2046
|
-
this._toolInputSchemaJson[name] = json;
|
|
2047
|
-
const scan = require_src.scanXMcpHeaderDeclarations(json);
|
|
2048
|
-
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
2049
|
-
} catch {}
|
|
2050
2087
|
let currentHandler = handler;
|
|
2088
|
+
let outputSchemaJson;
|
|
2051
2089
|
const registeredTool = {
|
|
2052
2090
|
title,
|
|
2053
2091
|
description,
|
|
2054
2092
|
inputSchema,
|
|
2055
2093
|
outputSchema,
|
|
2056
|
-
outputSchemaJson
|
|
2094
|
+
get outputSchemaJson() {
|
|
2095
|
+
return outputSchemaJson ??= convertOutputSchemaJson(registeredTool.outputSchema);
|
|
2096
|
+
},
|
|
2097
|
+
set outputSchemaJson(value) {
|
|
2098
|
+
outputSchemaJson = value;
|
|
2099
|
+
},
|
|
2057
2100
|
annotations,
|
|
2058
2101
|
icons,
|
|
2059
2102
|
execution,
|
|
@@ -2214,6 +2257,13 @@ const EMPTY_OBJECT_JSON_SCHEMA = {
|
|
|
2214
2257
|
type: "object",
|
|
2215
2258
|
properties: {}
|
|
2216
2259
|
};
|
|
2260
|
+
/** Converts a tool's `inputSchema` for `tools/list` and warns on an invalid SEP-2243 `x-mcp-header` declaration. */
|
|
2261
|
+
function convertListedInputSchema(name, inputSchema) {
|
|
2262
|
+
const json = require_src.standardSchemaToJsonSchema(inputSchema, "input");
|
|
2263
|
+
const scan = require_src.scanXMcpHeaderDeclarations(json);
|
|
2264
|
+
if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
|
|
2265
|
+
return json;
|
|
2266
|
+
}
|
|
2217
2267
|
/**
|
|
2218
2268
|
* Convert a registered `outputSchema` to JSON Schema, memoised on {@link RegisteredTool.outputSchemaJson}
|
|
2219
2269
|
* so `tools/call` passes the SAME advertised schema to the wire codec's `projectCallToolResult` that
|
|
@@ -2236,7 +2286,7 @@ function createPromptHandler(name, argsSchema, callback) {
|
|
|
2236
2286
|
if (argsSchema) {
|
|
2237
2287
|
const typedCallback = callback;
|
|
2238
2288
|
return async (args, ctx) => {
|
|
2239
|
-
const parseResult = await require_src.validateStandardSchema(argsSchema, args);
|
|
2289
|
+
const parseResult = await require_src.validateStandardSchema(argsSchema, args ?? {});
|
|
2240
2290
|
if (!parseResult.success) throw new require_src.ProtocolError(require_src.ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name}: ${parseResult.error}`);
|
|
2241
2291
|
return typedCallback(parseResult.data, ctx);
|
|
2242
2292
|
};
|
|
@@ -2424,4 +2474,4 @@ Object.defineProperty(exports, 'verifyBearerToken', {
|
|
|
2424
2474
|
return verifyBearerToken;
|
|
2425
2475
|
}
|
|
2426
2476
|
});
|
|
2427
|
-
//# sourceMappingURL=mcp-
|
|
2477
|
+
//# sourceMappingURL=mcp-BumlNux0.cjs.map
|