@prefecthq/fastmcp-ts 1.7.0 → 1.7.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/dist/cli/index.cjs +27 -7
- package/dist/cli/index.cjs.map +1 -1
- package/dist/client.js +23 -3
- package/dist/client.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -1180,7 +1180,7 @@ var init_version = __esm({
|
|
|
1180
1180
|
async run({ args }) {
|
|
1181
1181
|
if (args.json) setJsonMode(true);
|
|
1182
1182
|
const data = {
|
|
1183
|
-
fastmcp: "1.7.
|
|
1183
|
+
fastmcp: "1.7.2",
|
|
1184
1184
|
"mcp-sdk": "2.0.0",
|
|
1185
1185
|
node: process.version,
|
|
1186
1186
|
platform: `${process.platform} ${process.arch}`
|
|
@@ -29421,7 +29421,7 @@ var init_package = __esm({
|
|
|
29421
29421
|
"package.json"() {
|
|
29422
29422
|
package_default = {
|
|
29423
29423
|
name: "@prefecthq/fastmcp-ts",
|
|
29424
|
-
version: "1.7.
|
|
29424
|
+
version: "1.7.2",
|
|
29425
29425
|
description: "\u{1F3CE}\uFE0F The official FastMCP TypeScript library - build MCP servers and clients, fast \u{1F3CE}\uFE0F",
|
|
29426
29426
|
type: "module",
|
|
29427
29427
|
exports: {
|
|
@@ -30371,6 +30371,20 @@ function buildHttpOptions(auth2, extraHeaders = {}) {
|
|
|
30371
30371
|
eventSourceInit: { headers: staticHeaders }
|
|
30372
30372
|
};
|
|
30373
30373
|
}
|
|
30374
|
+
function parseHttpUrl(input) {
|
|
30375
|
+
if (!URL.canParse(input)) {
|
|
30376
|
+
throw new Error(
|
|
30377
|
+
`"${input}" is not a valid URL. URL strings must be http: or https:. ${STDIO_HINT}`
|
|
30378
|
+
);
|
|
30379
|
+
}
|
|
30380
|
+
const url2 = new URL(input);
|
|
30381
|
+
if (url2.protocol !== "http:" && url2.protocol !== "https:") {
|
|
30382
|
+
throw new Error(
|
|
30383
|
+
`"${input}" has unsupported scheme "${url2.protocol}". URL strings must be http: or https:. ${STDIO_HINT}`
|
|
30384
|
+
);
|
|
30385
|
+
}
|
|
30386
|
+
return url2;
|
|
30387
|
+
}
|
|
30374
30388
|
function urlToTransport(url2, auth2, extraHeaders = {}, legacySSE = false) {
|
|
30375
30389
|
const { requestInit, fetch: customFetch, eventSourceInit, authProvider } = buildHttpOptions(auth2, extraHeaders);
|
|
30376
30390
|
const segments = url2.pathname.split("/");
|
|
@@ -30412,6 +30426,11 @@ function modernFetchTransport(entry) {
|
|
|
30412
30426
|
});
|
|
30413
30427
|
}
|
|
30414
30428
|
async function resolveEntryTransport(entry, auth2, options) {
|
|
30429
|
+
if (typeof entry !== "object" || entry === null) {
|
|
30430
|
+
throw new Error(
|
|
30431
|
+
`mcpServers entry ${JSON.stringify(entry)} must be an object with a "url" or "command" key. ${STDIO_HINT}`
|
|
30432
|
+
);
|
|
30433
|
+
}
|
|
30415
30434
|
if (isMcpServerLike(entry)) {
|
|
30416
30435
|
if (isPinnedModern(options?.versionNegotiation) && entry._modernFetch) {
|
|
30417
30436
|
return { transport: modernFetchTransport(entry) };
|
|
@@ -30424,7 +30443,7 @@ async function resolveEntryTransport(entry, auth2, options) {
|
|
|
30424
30443
|
}
|
|
30425
30444
|
const entryAuth = resolveEntryAuth(entry.auth) ?? auth2;
|
|
30426
30445
|
if ("url" in entry) {
|
|
30427
|
-
const url2 =
|
|
30446
|
+
const url2 = parseHttpUrl(entry.url);
|
|
30428
30447
|
const extraHeaders = entry.headers ?? {};
|
|
30429
30448
|
return { transport: urlToTransport(url2, entryAuth, extraHeaders, options?.legacySSE) };
|
|
30430
30449
|
}
|
|
@@ -30454,7 +30473,7 @@ async function resolveTransport(input, auth2, options) {
|
|
|
30454
30473
|
};
|
|
30455
30474
|
}
|
|
30456
30475
|
if (typeof input === "string") {
|
|
30457
|
-
const url2 =
|
|
30476
|
+
const url2 = parseHttpUrl(input);
|
|
30458
30477
|
return { transport: urlToTransport(url2, auth2, {}, options?.legacySSE) };
|
|
30459
30478
|
}
|
|
30460
30479
|
if (typeof input === "object" && input !== null && "start" in input && typeof input.start === "function") {
|
|
@@ -30480,7 +30499,7 @@ async function resolveTransport(input, auth2, options) {
|
|
|
30480
30499
|
"Unrecognized transport input: expected a URL string, FastMCP server instance, mcpServers config object, StdioTransport, or SDK Transport"
|
|
30481
30500
|
);
|
|
30482
30501
|
}
|
|
30483
|
-
var StdioTransport, sseDeprecationWarned, IN_PROCESS_BASE_URL;
|
|
30502
|
+
var StdioTransport, STDIO_HINT, sseDeprecationWarned, IN_PROCESS_BASE_URL;
|
|
30484
30503
|
var init_transports = __esm({
|
|
30485
30504
|
"src/client/transports.ts"() {
|
|
30486
30505
|
"use strict";
|
|
@@ -30498,6 +30517,7 @@ var init_transports = __esm({
|
|
|
30498
30517
|
this.cwd = options?.cwd;
|
|
30499
30518
|
}
|
|
30500
30519
|
};
|
|
30520
|
+
STDIO_HINT = `To run a local server script over stdio, pass an explicit StdioTransport (e.g. new StdioTransport('node', ['server.js'])) or an mcpServers entry with a "command" key.`;
|
|
30501
30521
|
sseDeprecationWarned = false;
|
|
30502
30522
|
IN_PROCESS_BASE_URL = "http://in-process.local/mcp";
|
|
30503
30523
|
}
|
|
@@ -33793,7 +33813,7 @@ var init_inspect = __esm({
|
|
|
33793
33813
|
// only case Python's inspect supports); over --url/--command the
|
|
33794
33814
|
// generation is unknowable from the wire.
|
|
33795
33815
|
generation: mode.kind === "inprocess" ? 2 : null,
|
|
33796
|
-
fastmcpVersion: "1.7.
|
|
33816
|
+
fastmcpVersion: "1.7.2",
|
|
33797
33817
|
mcpVersion: "2.0.0",
|
|
33798
33818
|
tools: tools2,
|
|
33799
33819
|
prompts: prompts2,
|
|
@@ -47322,7 +47342,7 @@ init_format();
|
|
|
47322
47342
|
var main = defineCommand({
|
|
47323
47343
|
meta: {
|
|
47324
47344
|
name: "fastmcp",
|
|
47325
|
-
version: "1.7.
|
|
47345
|
+
version: "1.7.2",
|
|
47326
47346
|
description: "FastMCP CLI \u2014 build, run, and manage MCP servers"
|
|
47327
47347
|
},
|
|
47328
47348
|
args: {
|