fastmcp 4.27.0 → 4.28.1

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.
Files changed (43) hide show
  1. package/dist/FastMCP.cjs +4 -4
  2. package/dist/FastMCP.d.cts +2 -2
  3. package/dist/FastMCP.d.ts +2 -2
  4. package/dist/FastMCP.js +3 -3
  5. package/dist/{OAuthProvider-CUfrAKTR.d.cts → OAuthProvider-DvIxa9N1.d.cts} +8 -5
  6. package/dist/{OAuthProvider-CUfrAKTR.d.ts → OAuthProvider-DvIxa9N1.d.ts} +8 -5
  7. package/dist/auth/index.cjs +2 -2
  8. package/dist/auth/index.d.cts +2 -2
  9. package/dist/auth/index.d.ts +2 -2
  10. package/dist/auth/index.js +1 -1
  11. package/dist/{chunk-SQ5JIDOQ.cjs → chunk-2ABBQFJB.cjs} +28 -13
  12. package/dist/chunk-2ABBQFJB.cjs.map +1 -0
  13. package/dist/chunk-2NZFMD6I.cjs +120 -0
  14. package/dist/chunk-2NZFMD6I.cjs.map +1 -0
  15. package/dist/{chunk-PKJVR5H3.cjs → chunk-3FM67CFK.cjs} +58 -49
  16. package/dist/chunk-3FM67CFK.cjs.map +1 -0
  17. package/dist/chunk-AM3HVK4Z.js +120 -0
  18. package/dist/chunk-AM3HVK4Z.js.map +1 -0
  19. package/dist/{chunk-TCXNF2SR.js → chunk-NRATQX66.js} +22 -7
  20. package/dist/chunk-NRATQX66.js.map +1 -0
  21. package/dist/{chunk-6L7ORLPC.js → chunk-PWSYODM5.js} +49 -40
  22. package/dist/chunk-PWSYODM5.js.map +1 -0
  23. package/dist/edge/index.cjs +114 -65
  24. package/dist/edge/index.cjs.map +1 -1
  25. package/dist/edge/index.js +90 -41
  26. package/dist/edge/index.js.map +1 -1
  27. package/dist/examples/custom-routes.cjs +4 -4
  28. package/dist/examples/custom-routes.js +3 -3
  29. package/dist/openapi/index.cjs +26 -15
  30. package/dist/openapi/index.cjs.map +1 -1
  31. package/dist/openapi/index.d.cts +4 -4
  32. package/dist/openapi/index.d.ts +4 -4
  33. package/dist/openapi/index.js +20 -9
  34. package/dist/openapi/index.js.map +1 -1
  35. package/package.json +1 -1
  36. package/dist/chunk-6L7ORLPC.js.map +0 -1
  37. package/dist/chunk-6TDYSPLC.cjs +0 -44
  38. package/dist/chunk-6TDYSPLC.cjs.map +0 -1
  39. package/dist/chunk-OKKFL2M4.js +0 -44
  40. package/dist/chunk-OKKFL2M4.js.map +0 -1
  41. package/dist/chunk-PKJVR5H3.cjs.map +0 -1
  42. package/dist/chunk-SQ5JIDOQ.cjs.map +0 -1
  43. package/dist/chunk-TCXNF2SR.js.map +0 -1
@@ -0,0 +1,120 @@
1
+ // src/strictInputSchema.ts
2
+ import { z } from "zod";
3
+ function objectRootSchema(schema) {
4
+ return schema.type === void 0 ? { ...schema, type: "object" } : schema;
5
+ }
6
+ function strictInputSchema(schema, nested = false) {
7
+ const { $ref, additionalProperties, allOf, anyOf, oneOf, properties } = schema;
8
+ if (!nested && ($ref || allOf || anyOf || oneOf)) {
9
+ return objectRootSchema(schema);
10
+ }
11
+ const keepsAdditionalProperties = Object.keys(properties ?? {}).length === 0 && (typeof additionalProperties === "object" || additionalProperties === true || nested && additionalProperties === void 0 && !properties);
12
+ const strict = {
13
+ ...schema,
14
+ ...keepsAdditionalProperties ? {} : { additionalProperties: false },
15
+ ...properties && {
16
+ properties: Object.fromEntries(
17
+ Object.entries(properties).map(([key, value]) => [
18
+ key,
19
+ typeof value === "object" && value.type === "object" ? strictInputSchema(value, true) : value
20
+ ])
21
+ )
22
+ }
23
+ };
24
+ return nested ? strict : objectRootSchema(strict);
25
+ }
26
+ function zodInputSchema(schema, target) {
27
+ const jsonSchema = z.toJSONSchema(schema, {
28
+ io: "input",
29
+ target
30
+ });
31
+ const definitionsKey = target === "draft-7" ? "definitions" : "$defs";
32
+ const definitions = {};
33
+ const operands = /* @__PURE__ */ new Map();
34
+ const closeObjects = (value, operand = false) => {
35
+ if (!value || typeof value !== "object") return value;
36
+ const result = { ...value };
37
+ if (operand && typeof result.$ref === "string" && (result.$ref === "#" || result.$ref.startsWith("#/"))) {
38
+ const reference = result.$ref;
39
+ let name = operands.get(reference);
40
+ if (!name) {
41
+ const path = decodeURIComponent(reference.slice(1)).split("/").slice(1);
42
+ const referenced = path.reduce(
43
+ (node, key) => node && typeof node === "object" ? node[key.replace(/~1/g, "/").replace(/~0/g, "~")] : void 0,
44
+ jsonSchema
45
+ );
46
+ if (referenced && typeof referenced === "object") {
47
+ name = `__fastmcp_operand_${operands.size}`;
48
+ const existing = jsonSchema[definitionsKey];
49
+ while (Object.hasOwn(existing ?? {}, name) || Object.hasOwn(definitions, name))
50
+ name += "_";
51
+ operands.set(reference, name);
52
+ const copy = { ...referenced };
53
+ delete copy.$schema;
54
+ delete copy.$defs;
55
+ delete copy.definitions;
56
+ definitions[name] = closeObjects(copy, true);
57
+ }
58
+ }
59
+ if (name) result.$ref = `#/${definitionsKey}/${name}`;
60
+ }
61
+ if (!operand && result.type === "object" && result.properties !== void 0 && result.additionalProperties === void 0) {
62
+ result.additionalProperties = false;
63
+ }
64
+ for (const keyword of ["allOf", "anyOf", "oneOf"]) {
65
+ const branches = result[keyword];
66
+ if (Array.isArray(branches)) {
67
+ result[keyword] = branches.map(
68
+ (branch) => closeObjects(
69
+ branch,
70
+ operand || keyword === "allOf" && branches.length > 1
71
+ )
72
+ );
73
+ }
74
+ }
75
+ for (const keyword of [
76
+ "$defs",
77
+ "definitions",
78
+ "patternProperties",
79
+ "properties"
80
+ ]) {
81
+ const children = result[keyword];
82
+ if (children && typeof children === "object") {
83
+ result[keyword] = Object.fromEntries(
84
+ Object.entries(children).map(([key, child]) => [
85
+ key,
86
+ closeObjects(child)
87
+ ])
88
+ );
89
+ }
90
+ }
91
+ for (const keyword of [
92
+ "additionalItems",
93
+ "additionalProperties",
94
+ "items",
95
+ "prefixItems",
96
+ "propertyNames"
97
+ ]) {
98
+ const child = result[keyword];
99
+ if (child !== void 0) {
100
+ result[keyword] = Array.isArray(child) ? child.map((item) => closeObjects(item)) : closeObjects(child);
101
+ }
102
+ }
103
+ return result;
104
+ };
105
+ const closed = closeObjects(jsonSchema);
106
+ if (operands.size > 0) {
107
+ closed[definitionsKey] = {
108
+ ...closed[definitionsKey],
109
+ ...definitions
110
+ };
111
+ }
112
+ return closed;
113
+ }
114
+
115
+ export {
116
+ objectRootSchema,
117
+ strictInputSchema,
118
+ zodInputSchema
119
+ };
120
+ //# sourceMappingURL=chunk-AM3HVK4Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/strictInputSchema.ts"],"sourcesContent":["import type { JsonSchema } from \"xsschema\";\n\nimport { z } from \"zod\";\n\n/**\n * Gives a tool's input or output schema the `type: \"object\"` MCP requires at\n * its root, unless it states a type of its own. A union of objects converts to\n * a bare `anyOf` or `oneOf`, and the SDK client rejects a whole `tools/list`\n * that contains one, so a single such tool would hide every other. Arguments\n * and structured content are always objects, so this only rules out values a\n * tool can never be sent or return.\n */\nexport function objectRootSchema(schema: JsonSchema): JsonSchema {\n return schema.type === undefined ? { ...schema, type: \"object\" } : schema;\n}\n\n/**\n * Closes tool input objects to undeclared keys, like xsschema's\n * `strictJsonSchema`, except for objects made only of additional properties.\n * Closing one of those advertises an object that accepts nothing but `{}`,\n * while the tool's own validation still takes any key, so it keeps whatever\n * `additionalProperties` it declared — or none:\n *\n * - a dictionary, whose `additionalProperties` is a schema (`z.record()`, an\n * OpenAPI map), keeps its value schema;\n * - a free-form object, which declares `additionalProperties: true`, or, as an\n * argument, is a bare `{ type: \"object\" }` (OpenAPI's usual spelling), stays\n * open.\n *\n * A plain object that declares an empty `properties`, or a bare one at the\n * top of the input, is still closed: that is how a schema says \"no keys\" —\n * `z.object({})`, or a tool without arguments. Root schemas with `allOf`,\n * `anyOf`, `oneOf`, or `$ref` are left as declared, even with their own\n * `properties`: `additionalProperties` only sees adjacent properties, so\n * adding it would reject keys declared by a branch or reference target.\n *\n * The root is given an object type (see `objectRootSchema`).\n *\n * Shared by both runtimes, so a tool's advertised input schema does not depend\n * on whether it is served by `FastMCP` or `EdgeFastMCP`.\n */\nexport function strictInputSchema(\n schema: JsonSchema,\n nested = false,\n): JsonSchema {\n const { $ref, additionalProperties, allOf, anyOf, oneOf, properties } =\n schema;\n\n if (!nested && ($ref || allOf || anyOf || oneOf)) {\n return objectRootSchema(schema);\n }\n\n const keepsAdditionalProperties =\n Object.keys(properties ?? {}).length === 0 &&\n (typeof additionalProperties === \"object\" ||\n additionalProperties === true ||\n (nested && additionalProperties === undefined && !properties));\n\n const strict = {\n ...schema,\n ...(keepsAdditionalProperties ? {} : { additionalProperties: false }),\n ...(properties && {\n properties: Object.fromEntries(\n Object.entries(properties).map(([key, value]) => [\n key,\n typeof value === \"object\" && value.type === \"object\"\n ? strictInputSchema(value, true)\n : value,\n ]),\n ),\n }),\n };\n\n return nested ? strict : objectRootSchema(strict);\n}\n\n/**\n * Converts Zod 4 tool parameters by what a call may send (`io: \"input\"`), so a\n * transformed field advertises the type it parses and a defaulted one is\n * optional. Close ordinary object occurrences after conversion, but leave\n * intersection operands open to each other's keys. Child values start a new\n * closure context; explicit catchalls, including .strict(), stay as declared.\n */\nexport function zodInputSchema(\n schema: z.ZodType,\n target?: \"draft-7\",\n): JsonSchema {\n const jsonSchema = z.toJSONSchema(schema, {\n io: \"input\",\n target,\n }) as Record<string, unknown>;\n const definitionsKey = target === \"draft-7\" ? \"definitions\" : \"$defs\";\n const definitions: Record<string, unknown> = {};\n const operands = new Map<string, string>();\n\n const closeObjects = (value: unknown, operand = false): unknown => {\n if (!value || typeof value !== \"object\") return value;\n const result = { ...(value as Record<string, unknown>) };\n\n if (\n operand &&\n typeof result.$ref === \"string\" &&\n (result.$ref === \"#\" || result.$ref.startsWith(\"#/\"))\n ) {\n const reference = result.$ref;\n let name = operands.get(reference);\n if (!name) {\n const path = decodeURIComponent(reference.slice(1)).split(\"/\").slice(1);\n const referenced = path.reduce<unknown>(\n (node, key) =>\n node && typeof node === \"object\"\n ? (node as Record<string, unknown>)[\n key.replace(/~1/g, \"/\").replace(/~0/g, \"~\")\n ]\n : undefined,\n jsonSchema,\n );\n if (referenced && typeof referenced === \"object\") {\n name = `__fastmcp_operand_${operands.size}`;\n const existing = jsonSchema[definitionsKey] as object | undefined;\n while (\n Object.hasOwn(existing ?? {}, name) ||\n Object.hasOwn(definitions, name)\n )\n name += \"_\";\n // Reserve the reference before descending, including through child values.\n operands.set(reference, name);\n const copy = { ...(referenced as Record<string, unknown>) };\n delete copy.$schema;\n delete copy.$defs;\n delete copy.definitions;\n definitions[name] = closeObjects(copy, true);\n }\n }\n if (name) result.$ref = `#/${definitionsKey}/${name}`;\n }\n\n if (\n !operand &&\n result.type === \"object\" &&\n result.properties !== undefined &&\n result.additionalProperties === undefined\n ) {\n result.additionalProperties = false;\n }\n\n for (const keyword of [\"allOf\", \"anyOf\", \"oneOf\"]) {\n const branches = result[keyword];\n if (Array.isArray(branches)) {\n // A single allOf branch is Zod's draft-7 reference wrapper, not\n // an intersection. Only intersections introduce a new exemption.\n result[keyword] = branches.map((branch) =>\n closeObjects(\n branch,\n operand || (keyword === \"allOf\" && branches.length > 1),\n ),\n );\n }\n }\n\n for (const keyword of [\n \"$defs\",\n \"definitions\",\n \"patternProperties\",\n \"properties\",\n ]) {\n const children = result[keyword];\n if (children && typeof children === \"object\") {\n result[keyword] = Object.fromEntries(\n Object.entries(children).map(([key, child]) => [\n key,\n closeObjects(child),\n ]),\n );\n }\n }\n for (const keyword of [\n \"additionalItems\",\n \"additionalProperties\",\n \"items\",\n \"prefixItems\",\n \"propertyNames\",\n ]) {\n const child = result[keyword];\n if (child !== undefined) {\n result[keyword] = Array.isArray(child)\n ? child.map((item) => closeObjects(item))\n : closeObjects(child);\n }\n }\n return result;\n };\n\n const closed = closeObjects(jsonSchema) as Record<string, unknown>;\n if (operands.size > 0) {\n closed[definitionsKey] = {\n ...(closed[definitionsKey] as Record<string, unknown>),\n ...definitions,\n };\n }\n return closed as Json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AAW,WAAW;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,GAAG;AACD,YAAM,WAAW,OAAO,OAAO;AAC/B,UAAI,YAAY,OAAO,aAAa,UAAU;AAC5C,eAAO,OAAO,IAAI,OAAO;AAAA,UACvB,OAAO,QAAQ,QAAQ,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAAA,YAC7C;AAAA,YACA,aAAa,KAAK;AAAA,UACpB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AACA,eAAW,WAAW;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,GAAG;AACD,YAAM,QAAQ,OAAO,OAAO;AAC5B,UAAI,UAAU,QAAW;AACvB,eAAO,OAAO,IAAI,MAAM,QAAQ,KAAK,IACjC,MAAM,IAAI,CAAC,SAAS,aAAa,IAAI,CAAC,IACtC,aAAa,KAAK;AAAA,MACxB;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,aAAa,UAAU;AACtC,MAAI,SAAS,OAAO,GAAG;AACrB,WAAO,cAAc,IAAI;AAAA,MACvB,GAAI,OAAO,cAAc;AAAA,MACzB,GAAG;AAAA,IACL;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  cancelResponseBody
3
- } from "./chunk-6L7ORLPC.js";
3
+ } from "./chunk-PWSYODM5.js";
4
4
  import {
5
5
  objectRootSchema,
6
6
  strictInputSchema,
7
7
  zodInputSchema
8
- } from "./chunk-OKKFL2M4.js";
8
+ } from "./chunk-AM3HVK4Z.js";
9
9
 
10
10
  // src/FastMCP.ts
11
11
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -1438,6 +1438,9 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1438
1438
  )
1439
1439
  );
1440
1440
  } catch (error) {
1441
+ if (error instanceof McpError) {
1442
+ throw error;
1443
+ }
1441
1444
  const errorMessage = error instanceof Error ? error.message : String(error);
1442
1445
  throw new McpError(
1443
1446
  ErrorCode.InternalError,
@@ -1539,6 +1542,9 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1539
1542
  )
1540
1543
  );
1541
1544
  } catch (error) {
1545
+ if (error instanceof McpError) {
1546
+ throw error;
1547
+ }
1542
1548
  const errorMessage = error instanceof Error ? error.message : String(error);
1543
1549
  throw new McpError(
1544
1550
  ErrorCode.InternalError,
@@ -1731,21 +1737,28 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1731
1737
  const progressToken = request.params?._meta?.progressToken;
1732
1738
  let result;
1733
1739
  const timeoutAbort = new AbortController();
1734
- const signal = AbortSignal.any([
1740
+ const sourceSignal = AbortSignal.any([
1735
1741
  timeoutAbort.signal,
1736
1742
  this.#abortController.signal,
1737
1743
  // Only ever aborted for an explicit `notifications/cancelled`; the
1738
1744
  // session signal above is what covers a client that simply left.
1739
1745
  ...extra.signal ? [extra.signal] : []
1740
1746
  ]);
1747
+ const callAbort = new AbortController();
1748
+ const forwardAbort = () => callAbort.abort(sourceSignal.reason);
1749
+ sourceSignal.addEventListener("abort", forwardAbort, { once: true });
1750
+ if (sourceSignal.aborted) {
1751
+ forwardAbort();
1752
+ }
1753
+ const signal = callAbort.signal;
1741
1754
  const sendNotification = async (notification) => {
1742
- if (signal.aborted) {
1755
+ if (sourceSignal.aborted) {
1743
1756
  return;
1744
1757
  }
1745
1758
  try {
1746
1759
  await extra.sendNotification(notification);
1747
1760
  } catch (error) {
1748
- if (!signal.aborted) {
1761
+ if (!sourceSignal.aborted) {
1749
1762
  throw error;
1750
1763
  }
1751
1764
  }
@@ -1922,6 +1935,8 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1922
1935
  ],
1923
1936
  isError: true
1924
1937
  };
1938
+ } finally {
1939
+ sourceSignal.removeEventListener("abort", forwardAbort);
1925
1940
  }
1926
1941
  return result;
1927
1942
  }
@@ -3193,7 +3208,7 @@ var FastMCP = class extends FastMCPEventEmitter {
3193
3208
  }
3194
3209
  return;
3195
3210
  }
3196
- if (req.method === "GET" && oauthPath === "/oauth/callback") {
3211
+ if (req.method === "GET" && oauthPath === oauthProxy.getRedirectPath()) {
3197
3212
  try {
3198
3213
  const mockRequest = new Request(`http://${host}${req.url}`, {
3199
3214
  headers: cookieHeaders(req)
@@ -3691,4 +3706,4 @@ export {
3691
3706
  FastMCPSession,
3692
3707
  FastMCP
3693
3708
  };
3694
- //# sourceMappingURL=chunk-TCXNF2SR.js.map
3709
+ //# sourceMappingURL=chunk-NRATQX66.js.map