@xyd-js/mcp-server 0.0.0-build-c15a632-20251012021711 → 0.0.0-build-2bb31f3-20251012215032
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/CHANGELOG.md +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +27 -24
- package/dist/mcp.d.ts +22 -0
- package/dist/mcp.js +169707 -0
- package/package.json +9 -5
- package/src/index.ts +0 -1
- package/src/mcp.ts +12 -7
- package/tsconfig.json +26 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# @xyd-js/mcp-server
|
|
2
2
|
|
|
3
|
-
## 0.0.0-build-
|
|
3
|
+
## 0.0.0-build-2bb31f3-20251012215032
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- update all packages
|
|
8
8
|
- Updated dependencies
|
|
9
|
-
- @xyd-js/mcp@0.0.0-build-
|
|
9
|
+
- @xyd-js/mcp@0.0.0-build-2bb31f3-20251012215032
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -37236,7 +37236,7 @@ var coerce = {
|
|
|
37236
37236
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
37237
37237
|
};
|
|
37238
37238
|
var NEVER = INVALID;
|
|
37239
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
37239
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
37240
37240
|
var LATEST_PROTOCOL_VERSION = "2025-06-18";
|
|
37241
37241
|
var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
|
|
37242
37242
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
@@ -37759,7 +37759,7 @@ class McpError extends Error {
|
|
|
37759
37759
|
}
|
|
37760
37760
|
}
|
|
37761
37761
|
|
|
37762
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
37762
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js
|
|
37763
37763
|
var import_raw_body = __toESM(require_raw_body(), 1);
|
|
37764
37764
|
var import_content_type = __toESM(require_content_type(), 1);
|
|
37765
37765
|
import { randomUUID } from "node:crypto";
|
|
@@ -38235,7 +38235,7 @@ class StreamableHTTPServerTransport {
|
|
|
38235
38235
|
}
|
|
38236
38236
|
}
|
|
38237
38237
|
|
|
38238
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
38238
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
38239
38239
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
38240
38240
|
|
|
38241
38241
|
class Protocol {
|
|
@@ -38578,7 +38578,7 @@ function mergeCapabilities(base, additional) {
|
|
|
38578
38578
|
}, { ...base });
|
|
38579
38579
|
}
|
|
38580
38580
|
|
|
38581
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
38581
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
38582
38582
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
38583
38583
|
|
|
38584
38584
|
class Server extends Protocol {
|
|
@@ -40016,7 +40016,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
40016
40016
|
}
|
|
40017
40017
|
return combined;
|
|
40018
40018
|
};
|
|
40019
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
40019
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
40020
40020
|
var McpZodTypeKind;
|
|
40021
40021
|
(function(McpZodTypeKind2) {
|
|
40022
40022
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
@@ -40069,7 +40069,7 @@ function processCreateParams2(params) {
|
|
|
40069
40069
|
return { errorMap: customMap, description };
|
|
40070
40070
|
}
|
|
40071
40071
|
|
|
40072
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
40072
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
40073
40073
|
class McpServer {
|
|
40074
40074
|
constructor(serverInfo, options) {
|
|
40075
40075
|
this._registeredResources = {};
|
|
@@ -155971,8 +155971,8 @@ var je2 = "a16o3qrr";
|
|
|
155971
155971
|
var Se2 = "a1ln4qwr";
|
|
155972
155972
|
function Ce2(e488) {
|
|
155973
155973
|
var t481, r325 = e488.properties;
|
|
155974
|
-
return import_react5.default.createElement("ul", { className: me2 }, (t481 =
|
|
155975
|
-
var r326, a443 = e489.name, o237 = e489.type, i314 =
|
|
155974
|
+
return import_react5.default.createElement("ul", { className: me2 }, (t481 = Te2(r325)) === null || t481 === undefined ? undefined : t481.map(function(e489, t482) {
|
|
155975
|
+
var r326, a443 = e489.name, o237 = e489.type, i314 = Fe2(e489), l52 = ((r326 = e489.ofProperty) === null || r326 === undefined ? undefined : r326.description) || e489.description || "", c105 = Ie2(e489.meta);
|
|
155976
155976
|
return import_react5.default.createElement("atlas-apiref-prop", { className: ve2, key: t482 }, a443 || o237 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(Oe2, { property: e489, meta: e489.meta || [] }), import_react5.default.createElement(_e2, { property: e489 }), import_react5.default.createElement(Re2, { metas: e489.meta || [] })) : null, l52 || c105 ? import_react5.default.createElement("atlas-apiref-propdescription", { className: pe2 }, import_react5.default.createElement(import_react5.default.Fragment, null, import_react5.default.createElement("div", null, l52), import_react5.default.createElement("div", null, Ie2(e489.meta)))) : null, (i314 == null ? undefined : i314.length) > 0 ? import_react5.default.createElement(Ae2, { parent: e489, properties: i314 }) : null);
|
|
155977
155977
|
}));
|
|
155978
155978
|
}
|
|
@@ -156032,7 +156032,7 @@ function Re2(e488) {
|
|
|
156032
156032
|
}));
|
|
156033
156033
|
}
|
|
156034
156034
|
function Ae2(e488) {
|
|
156035
|
-
var r325, a443 = e488.parent, o237 = e488.properties, i314 = import_react5.useState(false), l52 = g3(i314, 2), c105 = l52[0], u28 = l52[1], s187 =
|
|
156035
|
+
var r325, a443 = e488.parent, o237 = e488.properties, i314 = import_react5.useState(false), l52 = g3(i314, 2), c105 = l52[0], u28 = l52[1], s187 = Te2(o237 || []), d29 = Le2(a443), m82 = function() {
|
|
156036
156036
|
var e489;
|
|
156037
156037
|
return ((a443 == null ? undefined : a443.type) !== DEFINED_DEFINITION_PROPERTY_TYPE.ARRAY || ((e489 = a443 == null ? undefined : a443.ofProperty) === null || e489 === undefined ? undefined : e489.type) !== DEFINED_DEFINITION_PROPERTY_TYPE.ENUM) && (a443 == null ? undefined : a443.type) !== DEFINED_DEFINITION_PROPERTY_TYPE.ENUM && s187.every(function(e490) {
|
|
156038
156038
|
var n470, t481;
|
|
@@ -156047,7 +156047,7 @@ function Ae2(e488) {
|
|
|
156047
156047
|
return import_react5.default.createElement(import_react5.default.Fragment, null, (s187 == null ? undefined : s187.length) ? import_react5.default.createElement(Be2, { choiceType: d29, isArgument: v4, onClick: function() {
|
|
156048
156048
|
return u28(!c105);
|
|
156049
156049
|
}, isExpanded: c105 }) : null, import_react5.default.createElement("div", { className: "".concat(Ee2, " ").concat(c105 && be2) }, import_react5.default.createElement("div", { className: ke2 }, import_react5.default.createElement("ul", { role: "list", className: xe2 }, s187 == null ? undefined : s187.map(function(e489, t481) {
|
|
156050
|
-
var r326, a444 = e489.name, o238 = e489.type, i315 =
|
|
156050
|
+
var r326, a444 = e489.name, o238 = e489.type, i315 = Fe2(e489), l53 = ((r326 = e489.ofProperty) === null || r326 === undefined ? undefined : r326.description) || e489.description || "", c106 = Ie2(e489.meta);
|
|
156051
156051
|
return import_react5.default.createElement("atlas-apiref-prop", { className: we2, key: t481 }, a444 || o238 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(Oe2, { property: e489, meta: e489.meta || [], parentChoiceType: d29 || !!v4 }), import_react5.default.createElement(_e2, { property: e489 }), import_react5.default.createElement(Re2, { metas: e489.meta || [] })) : null, l53 || c106 ? import_react5.default.createElement("atlas-apiref-propdescription", { className: pe2 }, import_react5.default.createElement(import_react5.default.Fragment, null, import_react5.default.createElement("div", null, l53), import_react5.default.createElement("div", null, Ie2(e489.meta)))) : null, (i315 == null ? undefined : i315.length) ? import_react5.default.createElement(Ae2, { parent: e489, properties: i315 }) : null);
|
|
156052
156052
|
})))));
|
|
156053
156053
|
}
|
|
@@ -156059,11 +156059,11 @@ function Le2(e488) {
|
|
|
156059
156059
|
var n470;
|
|
156060
156060
|
return e488.type === DEFINED_DEFINITION_PROPERTY_TYPE.ARRAY && ((n470 = e488.ofProperty) === null || n470 === undefined ? undefined : n470.type) === DEFINED_DEFINITION_PROPERTY_TYPE.ENUM || (e488.ofProperty ? Le2(e488.ofProperty) : [DEFINED_DEFINITION_PROPERTY_TYPE.UNION, DEFINED_DEFINITION_PROPERTY_TYPE.XOR, DEFINED_DEFINITION_PROPERTY_TYPE.ENUM].includes(e488.type));
|
|
156061
156061
|
}
|
|
156062
|
-
function
|
|
156062
|
+
function Fe2(e488) {
|
|
156063
156063
|
var n470;
|
|
156064
|
-
return ((n470 = e488.properties) === null || n470 === undefined ? undefined : n470.length) ? e488.properties : e488.ofProperty ?
|
|
156064
|
+
return ((n470 = e488.properties) === null || n470 === undefined ? undefined : n470.length) ? e488.properties : e488.ofProperty ? Fe2(e488.ofProperty) : [];
|
|
156065
156065
|
}
|
|
156066
|
-
function
|
|
156066
|
+
function Te2(e488) {
|
|
156067
156067
|
return e488.filter(function(e489) {
|
|
156068
156068
|
var n470;
|
|
156069
156069
|
return !((n470 = e489 == null ? undefined : e489.meta) === null || n470 === undefined ? undefined : n470.some(function(e490) {
|
|
@@ -156646,10 +156646,10 @@ function Bn(e488) {
|
|
|
156646
156646
|
function Ln(e488) {
|
|
156647
156647
|
var { linesOrGroups: n470, handlers: t481, inlineAnnotations: r325, annotationStack: a443 } = e488, o237 = a443 === undefined ? [] : a443;
|
|
156648
156648
|
return n470.map(function(e489) {
|
|
156649
|
-
return Bn(e489) ? un.jsx(
|
|
156649
|
+
return Bn(e489) ? un.jsx(Tn, { group: e489, handlers: t481, inlineAnnotations: r325, annotationStack: o237 }, e489.range[0]) : un.jsx(Fn, { line: e489, handlers: t481, inlineAnnotations: r325, annotationStack: o237 }, e489.lineNumber);
|
|
156650
156650
|
});
|
|
156651
156651
|
}
|
|
156652
|
-
function
|
|
156652
|
+
function Fn(e488) {
|
|
156653
156653
|
var { line: n470, handlers: t481, inlineAnnotations: r325, annotationStack: a443 } = e488, o237 = a443 === undefined ? [] : a443, i314 = n470.lineNumber, l52 = n470.totalLines, c105 = n470.indentation, u28 = r325.filter(function(e489) {
|
|
156654
156654
|
return e489.lineNumber === i314;
|
|
156655
156655
|
}), s187 = function(e489, n471) {
|
|
@@ -156671,7 +156671,7 @@ function Tn(e488) {
|
|
|
156671
156671
|
}(t481, o237), m82 = On({ content: s187, handlers: t481, annotationStack: o237 }), v4 = { lineNumber: i314, indentation: c105, totalLines: l52, _stack: d29 };
|
|
156672
156672
|
return un.jsx(xn, { merge: v4, children: m82 }, i314);
|
|
156673
156673
|
}
|
|
156674
|
-
function
|
|
156674
|
+
function Tn(e488) {
|
|
156675
156675
|
var n470, t481 = e488.group, r325 = e488.handlers, a443 = e488.inlineAnnotations, o237 = e488.annotationStack, i314 = t481.annotation, l52 = t481.lines, c105 = i314.name, u28 = (n470 = r325.find(function(e489) {
|
|
156676
156676
|
return e489.name === c105;
|
|
156677
156677
|
})) === null || n470 === undefined ? undefined : n470.Block, s187 = Ln({ linesOrGroups: l52, handlers: r325, inlineAnnotations: a443, annotationStack: [].concat(j2(o237), [i314]) });
|
|
@@ -191750,7 +191750,7 @@ async function mcpUniformTools(server, uniformSource, token) {
|
|
|
191750
191750
|
content: [
|
|
191751
191751
|
{
|
|
191752
191752
|
type: "text",
|
|
191753
|
-
text: `Error executing ${reference.canonical}: ${error.message}`
|
|
191753
|
+
text: `Error executing ${reference.canonical}: ${error instanceof Error ? error.message : String(error)}`
|
|
191754
191754
|
}
|
|
191755
191755
|
]
|
|
191756
191756
|
};
|
|
@@ -191843,13 +191843,15 @@ async function stringToZodSchema(zodSchemaString) {
|
|
|
191843
191843
|
class MCPServer {
|
|
191844
191844
|
transports = {};
|
|
191845
191845
|
sessionTokens = {};
|
|
191846
|
-
|
|
191847
|
-
constructor(
|
|
191846
|
+
uniformSources = [];
|
|
191847
|
+
constructor(uniformSources = process.argv[2]) {
|
|
191848
191848
|
this.connect = this.connect.bind(this);
|
|
191849
191849
|
this.handleConnectionRequest = this.handleConnectionRequest.bind(this);
|
|
191850
191850
|
this.handleSessionRequest = this.handleSessionRequest.bind(this);
|
|
191851
|
-
if (
|
|
191852
|
-
this.
|
|
191851
|
+
if (uniformSources && typeof uniformSources === "string") {
|
|
191852
|
+
this.uniformSources.push(uniformSources);
|
|
191853
|
+
} else if (uniformSources && Array.isArray(uniformSources)) {
|
|
191854
|
+
this.uniformSources.push(...uniformSources);
|
|
191853
191855
|
}
|
|
191854
191856
|
}
|
|
191855
191857
|
async handleConnectionRequest(req, res) {
|
|
@@ -191908,10 +191910,11 @@ class MCPServer {
|
|
|
191908
191910
|
name: "xyd-mcp-server",
|
|
191909
191911
|
version: "1.0.0"
|
|
191910
191912
|
});
|
|
191911
|
-
|
|
191912
|
-
|
|
191913
|
+
const source = this.uniformSources[0] || "";
|
|
191914
|
+
if (this.uniformSources[0]) {
|
|
191915
|
+
await mcpUniformResources(server, source);
|
|
191913
191916
|
}
|
|
191914
|
-
await mcpUniformTools(server,
|
|
191917
|
+
await mcpUniformTools(server, source || "", token || "");
|
|
191915
191918
|
this.addSimpleTokenTool(server);
|
|
191916
191919
|
await server.connect(transport);
|
|
191917
191920
|
return transport;
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Express {
|
|
4
|
+
interface Request {
|
|
5
|
+
pendingToken?: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class MCPServer {
|
|
10
|
+
private transports;
|
|
11
|
+
private sessionTokens;
|
|
12
|
+
private uniformSources;
|
|
13
|
+
constructor(uniformSources?: string | string[]);
|
|
14
|
+
handleConnectionRequest(req: express.Request, res: express.Response): Promise<void>;
|
|
15
|
+
handleSessionRequest(req: express.Request, res: express.Response): Promise<void>;
|
|
16
|
+
private connect;
|
|
17
|
+
private addSimpleTokenTool;
|
|
18
|
+
getSessionToken(sessionId: string): string | undefined;
|
|
19
|
+
private getActiveSessionCount;
|
|
20
|
+
private cleanupSession;
|
|
21
|
+
private cleanupAllSessions;
|
|
22
|
+
}
|