fastmcp 4.29.1 → 4.29.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/README.md +0 -7
- package/dist/FastMCP.cjs +3 -3
- package/dist/FastMCP.js +2 -2
- package/dist/auth/index.cjs +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{chunk-RWPENEKV.js → chunk-PA3GWZUK.js} +9 -10
- package/dist/{chunk-RWPENEKV.js.map → chunk-PA3GWZUK.js.map} +1 -1
- package/dist/{chunk-VN5SZ6IE.js → chunk-T7EFBHCA.js} +2 -2
- package/dist/{chunk-5EEESM57.cjs → chunk-TN6CWWVW.cjs} +5 -5
- package/dist/{chunk-5EEESM57.cjs.map → chunk-TN6CWWVW.cjs.map} +1 -1
- package/dist/{chunk-UHJQUSUX.cjs → chunk-XP4NENWX.cjs} +9 -10
- package/dist/chunk-XP4NENWX.cjs.map +1 -0
- package/dist/examples/custom-routes.cjs +3 -3
- package/dist/examples/custom-routes.js +2 -2
- package/dist/openapi/index.cjs +8 -8
- package/dist/openapi/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-UHJQUSUX.cjs.map +0 -1
- /package/dist/{chunk-VN5SZ6IE.js.map → chunk-T7EFBHCA.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var _chunkTN6CWWVWcjs = require('../chunk-TN6CWWVW.cjs');
|
|
5
|
+
require('../chunk-XP4NENWX.cjs');
|
|
6
6
|
require('../chunk-FBDPX4H2.cjs');
|
|
7
7
|
|
|
8
8
|
// src/examples/custom-routes.ts
|
|
@@ -12,7 +12,7 @@ var users = /* @__PURE__ */ new Map([
|
|
|
12
12
|
["2", { email: "bob@example.com", id: "2", name: "Bob" }]
|
|
13
13
|
]);
|
|
14
14
|
var requestCount = 0;
|
|
15
|
-
var server = new (0,
|
|
15
|
+
var server = new (0, _chunkTN6CWWVWcjs.FastMCP)({
|
|
16
16
|
// Simple authentication - in production, use proper tokens/JWTs
|
|
17
17
|
authenticate: async (req) => {
|
|
18
18
|
const authHeader = req.headers.authorization;
|
package/dist/openapi/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-
|
|
5
|
+
var _chunkTN6CWWVWcjs = require('../chunk-TN6CWWVW.cjs');
|
|
6
|
+
require('../chunk-XP4NENWX.cjs');
|
|
7
7
|
require('../chunk-FBDPX4H2.cjs');
|
|
8
8
|
|
|
9
9
|
// src/openapi/loadSpec.ts
|
|
@@ -632,7 +632,7 @@ function assertNoSubstitutedDotSegments(route, resolvedPath) {
|
|
|
632
632
|
const templateSegments = new Set(route.path.split("/"));
|
|
633
633
|
for (const segment of resolvedPath.split("/")) {
|
|
634
634
|
if ((segment === "." || segment === "..") && !templateSegments.has(segment)) {
|
|
635
|
-
throw new (0,
|
|
635
|
+
throw new (0, _chunkTN6CWWVWcjs.UserError)(
|
|
636
636
|
`${route.method.toUpperCase()} ${route.path}: path parameter values must not produce a "${segment}" path segment.`
|
|
637
637
|
);
|
|
638
638
|
}
|
|
@@ -645,7 +645,7 @@ function encodeCookieValue(mapping, value) {
|
|
|
645
645
|
return encodePathComponent(text);
|
|
646
646
|
}
|
|
647
647
|
if (/[;,]/.test(text)) {
|
|
648
|
-
throw new (0,
|
|
648
|
+
throw new (0, _chunkTN6CWWVWcjs.UserError)(
|
|
649
649
|
`Cookie parameter "${mapping.name}" uses style "cookie" and its value contains ";" or ","`
|
|
650
650
|
);
|
|
651
651
|
}
|
|
@@ -780,7 +780,7 @@ async function fetchResponse(options) {
|
|
|
780
780
|
});
|
|
781
781
|
if (!response.ok) {
|
|
782
782
|
const text = await response.text();
|
|
783
|
-
throw new (0,
|
|
783
|
+
throw new (0, _chunkTN6CWWVWcjs.UserError)(
|
|
784
784
|
`${options.route.method.toUpperCase()} ${path} failed with ${response.status}: ${text.slice(0, 2e3)}`
|
|
785
785
|
);
|
|
786
786
|
}
|
|
@@ -1043,7 +1043,7 @@ async function fromOpenAPI(options) {
|
|
|
1043
1043
|
const selected = selectRoutes(routes, options);
|
|
1044
1044
|
const names = generateNames(selected, options.mcpNames);
|
|
1045
1045
|
const sharedDefs = buildSharedDefs(document);
|
|
1046
|
-
const server = _nullishCoalesce(options.server, () => ( new (0,
|
|
1046
|
+
const server = _nullishCoalesce(options.server, () => ( new (0, _chunkTN6CWWVWcjs.FastMCP)({
|
|
1047
1047
|
name: _nullishCoalesce(_nullishCoalesce(options.name, () => ( _optionalChain([document, 'access', _45 => _45.info, 'optionalAccess', _46 => _46.title]))), () => ( "OpenAPI Server")),
|
|
1048
1048
|
version: _nullishCoalesce(options.version, () => ( "1.0.0"))
|
|
1049
1049
|
})));
|
|
@@ -1089,7 +1089,7 @@ async function fromOpenAPI(options) {
|
|
|
1089
1089
|
continue;
|
|
1090
1090
|
}
|
|
1091
1091
|
const outputSchemaJson = buildOutputSchema(route, sharedDefs);
|
|
1092
|
-
const outputSchema = outputSchemaJson ?
|
|
1092
|
+
const outputSchema = outputSchemaJson ? _chunkTN6CWWVWcjs.jsonSchemaAdapter.call(void 0, outputSchemaJson) : void 0;
|
|
1093
1093
|
server.addTool({
|
|
1094
1094
|
description: _nullishCoalesce(route.summary, () => ( `${route.method.toUpperCase()} ${route.path}`)),
|
|
1095
1095
|
execute: async (args, context) => {
|
|
@@ -1104,7 +1104,7 @@ async function fromOpenAPI(options) {
|
|
|
1104
1104
|
return resolveToolResult(result, outputSchema);
|
|
1105
1105
|
},
|
|
1106
1106
|
name,
|
|
1107
|
-
parameters:
|
|
1107
|
+
parameters: _chunkTN6CWWVWcjs.jsonSchemaAdapter.call(void 0, flatSchema),
|
|
1108
1108
|
...outputSchema ? { outputSchema } : {}
|
|
1109
1109
|
});
|
|
1110
1110
|
}
|
package/dist/openapi/index.js
CHANGED