fastmcp 4.20.3 → 4.20.4
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/FastMCP.cjs +2 -2
- package/dist/FastMCP.js +1 -1
- package/dist/{chunk-KBWJEPOD.js → chunk-2UDJ6Y3G.js} +2 -2
- package/dist/chunk-2UDJ6Y3G.js.map +1 -0
- package/dist/{chunk-X4AKKWFD.cjs → chunk-XU6TVDEG.cjs} +2 -2
- package/dist/{chunk-X4AKKWFD.cjs.map → chunk-XU6TVDEG.cjs.map} +1 -1
- package/dist/examples/custom-routes.cjs +2 -2
- package/dist/examples/custom-routes.js +1 -1
- package/dist/openapi/index.cjs +5 -5
- package/dist/openapi/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KBWJEPOD.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXU6TVDEGcjs = require('../chunk-XU6TVDEG.cjs');
|
|
5
5
|
require('../chunk-YO76IUZ6.cjs');
|
|
6
6
|
|
|
7
7
|
// src/examples/custom-routes.ts
|
|
@@ -11,7 +11,7 @@ var users = /* @__PURE__ */ new Map([
|
|
|
11
11
|
["2", { email: "bob@example.com", id: "2", name: "Bob" }]
|
|
12
12
|
]);
|
|
13
13
|
var requestCount = 0;
|
|
14
|
-
var server = new (0,
|
|
14
|
+
var server = new (0, _chunkXU6TVDEGcjs.FastMCP)({
|
|
15
15
|
// Simple authentication - in production, use proper tokens/JWTs
|
|
16
16
|
authenticate: async (req) => {
|
|
17
17
|
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 _chunkXU6TVDEGcjs = require('../chunk-XU6TVDEG.cjs');
|
|
6
6
|
require('../chunk-YO76IUZ6.cjs');
|
|
7
7
|
|
|
8
8
|
// src/openapi/loadSpec.ts
|
|
@@ -122,7 +122,7 @@ async function executeRequest(options) {
|
|
|
122
122
|
});
|
|
123
123
|
const text = await response.text();
|
|
124
124
|
if (!response.ok) {
|
|
125
|
-
throw new (0,
|
|
125
|
+
throw new (0, _chunkXU6TVDEGcjs.UserError)(
|
|
126
126
|
`${options.route.method.toUpperCase()} ${path} failed with ${response.status}: ${text.slice(0, 2e3)}`
|
|
127
127
|
);
|
|
128
128
|
}
|
|
@@ -629,7 +629,7 @@ async function fromOpenAPI(options) {
|
|
|
629
629
|
const selected = selectRoutes(routes, options);
|
|
630
630
|
const names = generateNames(selected, options.mcpNames);
|
|
631
631
|
const sharedDefs = buildSharedDefs(document);
|
|
632
|
-
const server = _nullishCoalesce(options.server, () => ( new (0,
|
|
632
|
+
const server = _nullishCoalesce(options.server, () => ( new (0, _chunkXU6TVDEGcjs.FastMCP)({
|
|
633
633
|
name: _nullishCoalesce(_nullishCoalesce(options.name, () => ( _optionalChain([document, 'access', _27 => _27.info, 'optionalAccess', _28 => _28.title]))), () => ( "OpenAPI Server")),
|
|
634
634
|
version: _nullishCoalesce(options.version, () => ( "1.0.0"))
|
|
635
635
|
})));
|
|
@@ -675,7 +675,7 @@ async function fromOpenAPI(options) {
|
|
|
675
675
|
continue;
|
|
676
676
|
}
|
|
677
677
|
const outputSchemaJson = buildOutputSchema(route, sharedDefs);
|
|
678
|
-
const outputSchema = outputSchemaJson ?
|
|
678
|
+
const outputSchema = outputSchemaJson ? _chunkXU6TVDEGcjs.jsonSchemaAdapter.call(void 0, outputSchemaJson) : void 0;
|
|
679
679
|
server.addTool({
|
|
680
680
|
description: _nullishCoalesce(route.summary, () => ( `${route.method.toUpperCase()} ${route.path}`)),
|
|
681
681
|
execute: async (args) => {
|
|
@@ -688,7 +688,7 @@ async function fromOpenAPI(options) {
|
|
|
688
688
|
return resolveToolResult(result, outputSchema);
|
|
689
689
|
},
|
|
690
690
|
name,
|
|
691
|
-
parameters:
|
|
691
|
+
parameters: _chunkXU6TVDEGcjs.jsonSchemaAdapter.call(void 0, flatSchema),
|
|
692
692
|
...outputSchema ? { outputSchema } : {}
|
|
693
693
|
});
|
|
694
694
|
}
|
package/dist/openapi/index.js
CHANGED