fastmcp 4.22.8 → 4.22.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/FastMCP.cjs +2 -2
- package/dist/FastMCP.d.cts +2 -1
- package/dist/FastMCP.d.ts +2 -1
- package/dist/FastMCP.js +1 -1
- package/dist/bin/fastmcp.cjs +1 -1
- package/dist/bin/fastmcp.cjs.map +1 -1
- package/dist/bin/fastmcp.js +1 -1
- package/dist/bin/fastmcp.js.map +1 -1
- package/dist/{chunk-44X25GBU.cjs → chunk-RE2YJZA6.cjs} +110 -75
- package/dist/chunk-RE2YJZA6.cjs.map +1 -0
- package/dist/{chunk-76QWMCYJ.js → chunk-RVBVCLCO.js} +87 -52
- package/dist/chunk-RVBVCLCO.js.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-44X25GBU.cjs.map +0 -1
- package/dist/chunk-76QWMCYJ.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkRE2YJZA6cjs = require('../chunk-RE2YJZA6.cjs');
|
|
5
5
|
require('../chunk-YLLBANV4.cjs');
|
|
6
6
|
require('../chunk-O22SYZMC.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, _chunkRE2YJZA6cjs.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 _chunkRE2YJZA6cjs = require('../chunk-RE2YJZA6.cjs');
|
|
6
6
|
require('../chunk-YLLBANV4.cjs');
|
|
7
7
|
require('../chunk-O22SYZMC.cjs');
|
|
8
8
|
|
|
@@ -135,7 +135,7 @@ async function executeRequest(options) {
|
|
|
135
135
|
});
|
|
136
136
|
const text = await response.text();
|
|
137
137
|
if (!response.ok) {
|
|
138
|
-
throw new (0,
|
|
138
|
+
throw new (0, _chunkRE2YJZA6cjs.UserError)(
|
|
139
139
|
`${options.route.method.toUpperCase()} ${path} failed with ${response.status}: ${text.slice(0, 2e3)}`
|
|
140
140
|
);
|
|
141
141
|
}
|
|
@@ -237,7 +237,7 @@ function assertNoSubstitutedDotSegments(route, resolvedPath) {
|
|
|
237
237
|
const templateSegments = new Set(route.path.split("/"));
|
|
238
238
|
for (const segment of resolvedPath.split("/")) {
|
|
239
239
|
if ((segment === "." || segment === "..") && !templateSegments.has(segment)) {
|
|
240
|
-
throw new (0,
|
|
240
|
+
throw new (0, _chunkRE2YJZA6cjs.UserError)(
|
|
241
241
|
`${route.method.toUpperCase()} ${route.path}: path parameter values must not produce a "${segment}" path segment.`
|
|
242
242
|
);
|
|
243
243
|
}
|
|
@@ -752,7 +752,7 @@ async function fromOpenAPI(options) {
|
|
|
752
752
|
const selected = selectRoutes(routes, options);
|
|
753
753
|
const names = generateNames(selected, options.mcpNames);
|
|
754
754
|
const sharedDefs = buildSharedDefs(document);
|
|
755
|
-
const server = _nullishCoalesce(options.server, () => ( new (0,
|
|
755
|
+
const server = _nullishCoalesce(options.server, () => ( new (0, _chunkRE2YJZA6cjs.FastMCP)({
|
|
756
756
|
name: _nullishCoalesce(_nullishCoalesce(options.name, () => ( _optionalChain([document, 'access', _29 => _29.info, 'optionalAccess', _30 => _30.title]))), () => ( "OpenAPI Server")),
|
|
757
757
|
version: _nullishCoalesce(options.version, () => ( "1.0.0"))
|
|
758
758
|
})));
|
|
@@ -798,7 +798,7 @@ async function fromOpenAPI(options) {
|
|
|
798
798
|
continue;
|
|
799
799
|
}
|
|
800
800
|
const outputSchemaJson = buildOutputSchema(route, sharedDefs);
|
|
801
|
-
const outputSchema = outputSchemaJson ?
|
|
801
|
+
const outputSchema = outputSchemaJson ? _chunkRE2YJZA6cjs.jsonSchemaAdapter.call(void 0, outputSchemaJson) : void 0;
|
|
802
802
|
server.addTool({
|
|
803
803
|
description: _nullishCoalesce(route.summary, () => ( `${route.method.toUpperCase()} ${route.path}`)),
|
|
804
804
|
execute: async (args) => {
|
|
@@ -811,7 +811,7 @@ async function fromOpenAPI(options) {
|
|
|
811
811
|
return resolveToolResult(result, outputSchema);
|
|
812
812
|
},
|
|
813
813
|
name,
|
|
814
|
-
parameters:
|
|
814
|
+
parameters: _chunkRE2YJZA6cjs.jsonSchemaAdapter.call(void 0, flatSchema),
|
|
815
815
|
...outputSchema ? { outputSchema } : {}
|
|
816
816
|
});
|
|
817
817
|
}
|
package/dist/openapi/index.js
CHANGED