fastmcp 4.24.0 → 4.24.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.
- package/README.md +2 -1
- package/dist/FastMCP.cjs +2 -2
- package/dist/FastMCP.js +1 -1
- package/dist/{chunk-5JRRZ7MN.js → chunk-D2CVYAA5.js} +2 -2
- package/dist/chunk-D2CVYAA5.js.map +1 -0
- package/dist/{chunk-JMH7WDO2.cjs → chunk-XPGMRMMN.cjs} +2 -2
- package/dist/chunk-XPGMRMMN.cjs.map +1 -0
- package/dist/examples/custom-routes.cjs +2 -2
- package/dist/examples/custom-routes.js +1 -1
- package/dist/openapi/index.cjs +6 -6
- package/dist/openapi/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5JRRZ7MN.js.map +0 -1
- package/dist/chunk-JMH7WDO2.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXPGMRMMNcjs = require('../chunk-XPGMRMMN.cjs');
|
|
5
5
|
require('../chunk-BV4PWTT6.cjs');
|
|
6
6
|
require('../chunk-6TDYSPLC.cjs');
|
|
7
7
|
|
|
@@ -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, _chunkXPGMRMMNcjs.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,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkXPGMRMMNcjs = require('../chunk-XPGMRMMN.cjs');
|
|
6
6
|
require('../chunk-BV4PWTT6.cjs');
|
|
7
7
|
require('../chunk-6TDYSPLC.cjs');
|
|
8
8
|
|
|
@@ -141,7 +141,7 @@ async function executeRequest(options) {
|
|
|
141
141
|
});
|
|
142
142
|
const text = await response.text();
|
|
143
143
|
if (!response.ok) {
|
|
144
|
-
throw new (0,
|
|
144
|
+
throw new (0, _chunkXPGMRMMNcjs.UserError)(
|
|
145
145
|
`${options.route.method.toUpperCase()} ${path} failed with ${response.status}: ${text.slice(0, 2e3)}`
|
|
146
146
|
);
|
|
147
147
|
}
|
|
@@ -243,7 +243,7 @@ function assertNoSubstitutedDotSegments(route, resolvedPath) {
|
|
|
243
243
|
const templateSegments = new Set(route.path.split("/"));
|
|
244
244
|
for (const segment of resolvedPath.split("/")) {
|
|
245
245
|
if ((segment === "." || segment === "..") && !templateSegments.has(segment)) {
|
|
246
|
-
throw new (0,
|
|
246
|
+
throw new (0, _chunkXPGMRMMNcjs.UserError)(
|
|
247
247
|
`${route.method.toUpperCase()} ${route.path}: path parameter values must not produce a "${segment}" path segment.`
|
|
248
248
|
);
|
|
249
249
|
}
|
|
@@ -783,7 +783,7 @@ async function fromOpenAPI(options) {
|
|
|
783
783
|
const selected = selectRoutes(routes, options);
|
|
784
784
|
const names = generateNames(selected, options.mcpNames);
|
|
785
785
|
const sharedDefs = buildSharedDefs(document);
|
|
786
|
-
const server = _nullishCoalesce(options.server, () => ( new (0,
|
|
786
|
+
const server = _nullishCoalesce(options.server, () => ( new (0, _chunkXPGMRMMNcjs.FastMCP)({
|
|
787
787
|
name: _nullishCoalesce(_nullishCoalesce(options.name, () => ( _optionalChain([document, 'access', _31 => _31.info, 'optionalAccess', _32 => _32.title]))), () => ( "OpenAPI Server")),
|
|
788
788
|
version: _nullishCoalesce(options.version, () => ( "1.0.0"))
|
|
789
789
|
})));
|
|
@@ -829,7 +829,7 @@ async function fromOpenAPI(options) {
|
|
|
829
829
|
continue;
|
|
830
830
|
}
|
|
831
831
|
const outputSchemaJson = buildOutputSchema(route, sharedDefs);
|
|
832
|
-
const outputSchema = outputSchemaJson ?
|
|
832
|
+
const outputSchema = outputSchemaJson ? _chunkXPGMRMMNcjs.jsonSchemaAdapter.call(void 0, outputSchemaJson) : void 0;
|
|
833
833
|
server.addTool({
|
|
834
834
|
description: _nullishCoalesce(route.summary, () => ( `${route.method.toUpperCase()} ${route.path}`)),
|
|
835
835
|
execute: async (args) => {
|
|
@@ -842,7 +842,7 @@ async function fromOpenAPI(options) {
|
|
|
842
842
|
return resolveToolResult(result, outputSchema);
|
|
843
843
|
},
|
|
844
844
|
name,
|
|
845
|
-
parameters:
|
|
845
|
+
parameters: _chunkXPGMRMMNcjs.jsonSchemaAdapter.call(void 0, flatSchema),
|
|
846
846
|
...outputSchema ? { outputSchema } : {}
|
|
847
847
|
});
|
|
848
848
|
}
|
package/dist/openapi/index.js
CHANGED