@questpie/mcp 3.28.8 → 3.28.10
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/dist/{create-server-Ty80vPGh.mjs → create-server-DvumhdI_.mjs} +33 -6
- package/dist/index.mjs +3 -3
- package/dist/{mcp-BVefYLQh.mjs → mcp-uf7du4OS.mjs} +1 -1
- package/dist/modules/mcp.mjs +1 -1
- package/dist/{stdio-CiEieZ1y.mjs → stdio-HmbmENQN.mjs} +1 -1
- package/dist/stdio.mjs +1 -1
- package/package.json +5 -5
|
@@ -615,13 +615,37 @@ const PUBLIC_ERROR_CODES = new Set([
|
|
|
615
615
|
var McpPublicError = class extends Error {
|
|
616
616
|
code;
|
|
617
617
|
correlationId;
|
|
618
|
-
|
|
619
|
-
|
|
618
|
+
/** Caller-safe text appended to the public message; see {@link mcpInvalidInputError}. */
|
|
619
|
+
detail;
|
|
620
|
+
constructor(code, correlationId = randomUUID(), detail) {
|
|
621
|
+
super(`${publicMessage(code, detail)} (${code}; correlationId=${correlationId})`);
|
|
620
622
|
this.name = "McpPublicError";
|
|
621
623
|
this.code = code;
|
|
622
624
|
this.correlationId = correlationId;
|
|
625
|
+
this.detail = detail;
|
|
623
626
|
}
|
|
624
627
|
};
|
|
628
|
+
const MAX_INPUT_ISSUES = 8;
|
|
629
|
+
const MAX_ISSUE_PATH_SEGMENT_CHARS = 128;
|
|
630
|
+
const MAX_ISSUE_MESSAGE_CHARS = 200;
|
|
631
|
+
const MAX_INPUT_DETAIL_CHARS = 4096;
|
|
632
|
+
/**
|
|
633
|
+
* The caller's own arguments failed the tool's input schema. Zod's own
|
|
634
|
+
* messages name only schema facts and the caller's keys, so the paths and
|
|
635
|
+
* messages go back to the caller — without them it can only guess which field
|
|
636
|
+
* to fix. Messages an app writes in `refine`/`superRefine`/`addIssue` are
|
|
637
|
+
* returned verbatim, exactly as the MCP SDK already returns them over HTTP;
|
|
638
|
+
* they must not carry server data. Only the input parse may use this: a
|
|
639
|
+
* ZodError thrown later, inside a handler, stays the opaque `invalid_input`.
|
|
640
|
+
*/
|
|
641
|
+
function mcpInvalidInputError(error, correlationId) {
|
|
642
|
+
const issues = error.issues.slice(0, MAX_INPUT_ISSUES).map((issue) => {
|
|
643
|
+
return `${issue.path.map((segment) => String(segment).slice(0, MAX_ISSUE_PATH_SEGMENT_CHARS)).join(".") || "(root)"}: ${issue.message.slice(0, MAX_ISSUE_MESSAGE_CHARS)}`;
|
|
644
|
+
});
|
|
645
|
+
const omitted = error.issues.length - issues.length;
|
|
646
|
+
if (omitted > 0) issues.push(`(${omitted} more)`);
|
|
647
|
+
return new McpPublicError("invalid_input", correlationId, `invalid input — ${issues.join("; ")}`.slice(0, MAX_INPUT_DETAIL_CHARS));
|
|
648
|
+
}
|
|
625
649
|
var McpAccessDeniedError = class extends Error {
|
|
626
650
|
constructor() {
|
|
627
651
|
super("MCP access denied");
|
|
@@ -762,8 +786,9 @@ function snapshotBoundedMcpValue(value, limits, code, correlationId = randomUUID
|
|
|
762
786
|
if (!snapshot.ok) throw new McpPublicError(code, correlationId);
|
|
763
787
|
return snapshot.value;
|
|
764
788
|
}
|
|
765
|
-
function publicMessage(code) {
|
|
766
|
-
|
|
789
|
+
function publicMessage(code, detail) {
|
|
790
|
+
if (code === "access_denied") return "MCP access denied";
|
|
791
|
+
return detail ? `MCP operation failed: ${detail}` : "MCP operation failed";
|
|
767
792
|
}
|
|
768
793
|
function classifyError(error, correlationId) {
|
|
769
794
|
if (!!error && (typeof error === "object" || typeof error === "function") && types.isProxy(error)) return new McpPublicError("internal", correlationId);
|
|
@@ -825,7 +850,7 @@ function toMcpToolError(error) {
|
|
|
825
850
|
isError: true,
|
|
826
851
|
content: [{
|
|
827
852
|
type: "text",
|
|
828
|
-
text: publicMessage(resolved.code)
|
|
853
|
+
text: publicMessage(resolved.code, resolved.detail)
|
|
829
854
|
}],
|
|
830
855
|
_meta: { [PUBLIC_ERROR_META_KEY]: {
|
|
831
856
|
code: resolved.code,
|
|
@@ -1989,7 +2014,9 @@ async function executeCustomToolCall(scope, toolName, tool, input, extra) {
|
|
|
1989
2014
|
},
|
|
1990
2015
|
concurrencyKey: () => workloadAuthorization?.concurrencyKey,
|
|
1991
2016
|
invoke: async ({ ctx, signal, requestId, correlationId }) => {
|
|
1992
|
-
const
|
|
2017
|
+
const parsed = await (tool.config.inputSchema ?? z.object({}).strict()).safeParseAsync(input);
|
|
2018
|
+
if (!parsed.success) throw mcpInvalidInputError(parsed.error, correlationId);
|
|
2019
|
+
const parsedInput = parsed.data;
|
|
1993
2020
|
const invoke = () => tool.handler({
|
|
1994
2021
|
input: parsedInput,
|
|
1995
2022
|
ctx,
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as scopesFromContext, _ as resolveMcpCatalog, a as customToolWorkloadIdentity, b as requiredScopesForOperation, c as createWorkloadMcpBoundary, f as McpAccessDeniedError, g as toMcpToolError, h as mcpPublicErrorCode, i as customToolDescriptor, l as createRuntimeScope, m as assertBoundedMcpValue, n as createWorkloadMcpServer, o as executeCustomToolCall, p as McpPublicError, r as customToolAllows, s as authorizeWorkload, t as createMcpServer, u as createWorkloadMcpRelease, v as defaultOperationScope, w as mcpTool, x as scopeGateAllows, y as normalizeRequiredScopes } from "./create-server-
|
|
2
|
-
import { n as mcp_default, t as mcpModule } from "./mcp-
|
|
1
|
+
import { S as scopesFromContext, _ as resolveMcpCatalog, a as customToolWorkloadIdentity, b as requiredScopesForOperation, c as createWorkloadMcpBoundary, f as McpAccessDeniedError, g as toMcpToolError, h as mcpPublicErrorCode, i as customToolDescriptor, l as createRuntimeScope, m as assertBoundedMcpValue, n as createWorkloadMcpServer, o as executeCustomToolCall, p as McpPublicError, r as customToolAllows, s as authorizeWorkload, t as createMcpServer, u as createWorkloadMcpRelease, v as defaultOperationScope, w as mcpTool, x as scopeGateAllows, y as normalizeRequiredScopes } from "./create-server-DvumhdI_.mjs";
|
|
2
|
+
import { n as mcp_default, t as mcpModule } from "./mcp-uf7du4OS.mjs";
|
|
3
3
|
import { t as mcpPlugin } from "./plugin-BZQe1pji.mjs";
|
|
4
|
-
import { t as startStdioServer } from "./stdio-
|
|
4
|
+
import { t as startStdioServer } from "./stdio-HmbmENQN.mjs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
|
|
7
7
|
//#region src/server/workload-tool-port.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as validateMcpPrincipal, d as getAppMcpRelease, m as assertBoundedMcpValue, t as createMcpServer } from "./create-server-
|
|
1
|
+
import { C as validateMcpPrincipal, d as getAppMcpRelease, m as assertBoundedMcpValue, t as createMcpServer } from "./create-server-DvumhdI_.mjs";
|
|
2
2
|
import { t as mcpPlugin } from "./plugin-BZQe1pji.mjs";
|
|
3
3
|
import { route } from "questpie";
|
|
4
4
|
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
package/dist/modules/mcp.mjs
CHANGED
package/dist/stdio.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@questpie/mcp",
|
|
3
|
-
"version": "3.28.
|
|
3
|
+
"version": "3.28.10",
|
|
4
4
|
"description": "Model Context Protocol server for QUESTPIE apps, under the app's own access rules",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
73
|
-
"questpie": "^3.28.
|
|
73
|
+
"questpie": "^3.28.10",
|
|
74
74
|
"zod": "^4.2.1"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@better-auth/oauth-provider": "^1.
|
|
78
|
-
"better-auth": "^1.
|
|
77
|
+
"@better-auth/oauth-provider": "^1.7.4",
|
|
78
|
+
"better-auth": "^1.7.4",
|
|
79
79
|
"bun-types": "latest",
|
|
80
80
|
"tsdown": "^0.18.3"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"questpie": "^3.28.
|
|
83
|
+
"questpie": "^3.28.10"
|
|
84
84
|
}
|
|
85
85
|
}
|