fastmcp 1.5.7 → 1.5.9

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 CHANGED
@@ -55,10 +55,13 @@ You can test the server in terminal with:
55
55
  ```bash
56
56
  git clone https://github.com/punkpeye/fastmcp.git
57
57
  cd fastmcp
58
+
59
+ npm install
60
+
58
61
  # Test the addition server example using CLI:
59
62
  npx fastmcp dev src/examples/addition.ts
60
- # Test the additition server example using MCP Inspector:
61
- npx fastmcp inspect src/examples/additition.ts
63
+ # Test the addition server example using MCP Inspector:
64
+ npx fastmcp inspect src/examples/addition.ts
62
65
  ```
63
66
 
64
67
  ### SSE
@@ -3,7 +3,7 @@
3
3
  // src/bin/fastmcp.ts
4
4
  import yargs from "yargs";
5
5
  import { hideBin } from "yargs/helpers";
6
- import { $ } from "execa";
6
+ import { execa } from "execa";
7
7
  await yargs(hideBin(process.argv)).scriptName("fastmcp").command(
8
8
  "dev <file>",
9
9
  "Start a development server",
@@ -15,12 +15,15 @@ await yargs(hideBin(process.argv)).scriptName("fastmcp").command(
15
15
  });
16
16
  },
17
17
  async (argv) => {
18
- const command = argv.file.endsWith(".ts") ? ["npx", "tsx", argv.file] : ["node", argv.file];
19
- await $({
20
- stdin: "inherit",
21
- stdout: "inherit",
22
- stderr: "inherit"
23
- })`npx @wong2/mcp-cli ${command}`;
18
+ try {
19
+ await execa({
20
+ stdin: "inherit",
21
+ stdout: "inherit",
22
+ stderr: "inherit"
23
+ })`npx @wong2/mcp-cli tsx ${argv.file}`;
24
+ } catch {
25
+ process.exit(1);
26
+ }
24
27
  }
25
28
  ).command(
26
29
  "inspect <file>",
@@ -33,10 +36,14 @@ await yargs(hideBin(process.argv)).scriptName("fastmcp").command(
33
36
  });
34
37
  },
35
38
  async (argv) => {
36
- await $({
37
- stdout: "inherit",
38
- stderr: "inherit"
39
- })`npx @modelcontextprotocol/inspector npx tsx ${argv.file}`;
39
+ try {
40
+ await execa({
41
+ stdout: "inherit",
42
+ stderr: "inherit"
43
+ })`npx @modelcontextprotocol/inspector npx tsx ${argv.file}`;
44
+ } catch {
45
+ process.exit(1);
46
+ }
40
47
  }
41
48
  ).help().parseAsync();
42
49
  //# sourceMappingURL=fastmcp.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bin/fastmcp.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { $ } from \"execa\";\n\nawait yargs(hideBin(process.argv))\n .scriptName(\"fastmcp\")\n .command(\n \"dev <file>\",\n \"Start a development server\",\n (yargs) => {\n return yargs.positional(\"file\", {\n type: \"string\",\n describe: \"The path to the server file\",\n demandOption: true,\n });\n },\n async (argv) => {\n const command = argv.file.endsWith(\".ts\")\n ? [\"npx\", \"tsx\", argv.file]\n : [\"node\", argv.file];\n\n await $({\n stdin: \"inherit\",\n stdout: \"inherit\",\n stderr: \"inherit\",\n })`npx @wong2/mcp-cli ${command}`;\n },\n )\n .command(\n \"inspect <file>\",\n \"Inspect a server file\",\n (yargs) => {\n return yargs.positional(\"file\", {\n type: \"string\",\n describe: \"The path to the server file\",\n demandOption: true,\n });\n },\n async (argv) => {\n await $({\n stdout: \"inherit\",\n stderr: \"inherit\",\n })`npx @modelcontextprotocol/inspector npx tsx ${argv.file}`;\n },\n )\n .help()\n .parseAsync();\n"],"mappings":";;;AAEA,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,SAAS;AAElB,MAAM,MAAM,QAAQ,QAAQ,IAAI,CAAC,EAC9B,WAAW,SAAS,EACpB;AAAA,EACC;AAAA,EACA;AAAA,EACA,CAACA,WAAU;AACT,WAAOA,OAAM,WAAW,QAAQ;AAAA,MAC9B,MAAM;AAAA,MACN,UAAU;AAAA,MACV,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,OAAO,SAAS;AACd,UAAM,UAAU,KAAK,KAAK,SAAS,KAAK,IACpC,CAAC,OAAO,OAAO,KAAK,IAAI,IACxB,CAAC,QAAQ,KAAK,IAAI;AAEtB,UAAM,EAAE;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV,CAAC,uBAAuB,OAAO;AAAA,EACjC;AACF,EACC;AAAA,EACC;AAAA,EACA;AAAA,EACA,CAACA,WAAU;AACT,WAAOA,OAAM,WAAW,QAAQ;AAAA,MAC9B,MAAM;AAAA,MACN,UAAU;AAAA,MACV,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,OAAO,SAAS;AACd,UAAM,EAAE;AAAA,MACN,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV,CAAC,gDAAgD,KAAK,IAAI;AAAA,EAC5D;AACF,EACC,KAAK,EACL,WAAW;","names":["yargs"]}
1
+ {"version":3,"sources":["../../src/bin/fastmcp.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { execa } from \"execa\";\n\nawait yargs(hideBin(process.argv))\n .scriptName(\"fastmcp\")\n .command(\n \"dev <file>\",\n \"Start a development server\",\n (yargs) => {\n return yargs.positional(\"file\", {\n type: \"string\",\n describe: \"The path to the server file\",\n demandOption: true,\n });\n },\n async (argv) => {\n try {\n await execa({\n stdin: \"inherit\",\n stdout: \"inherit\",\n stderr: \"inherit\",\n })`npx @wong2/mcp-cli tsx ${argv.file}`;\n } catch {\n process.exit(1);\n }\n },\n )\n .command(\n \"inspect <file>\",\n \"Inspect a server file\",\n (yargs) => {\n return yargs.positional(\"file\", {\n type: \"string\",\n describe: \"The path to the server file\",\n demandOption: true,\n });\n },\n async (argv) => {\n try {\n await execa({\n stdout: \"inherit\",\n stderr: \"inherit\",\n })`npx @modelcontextprotocol/inspector npx tsx ${argv.file}`;\n } catch {\n process.exit(1);\n }\n },\n )\n .help()\n .parseAsync();\n"],"mappings":";;;AAEA,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,aAAa;AAEtB,MAAM,MAAM,QAAQ,QAAQ,IAAI,CAAC,EAC9B,WAAW,SAAS,EACpB;AAAA,EACC;AAAA,EACA;AAAA,EACA,CAACA,WAAU;AACT,WAAOA,OAAM,WAAW,QAAQ;AAAA,MAC9B,MAAM;AAAA,MACN,UAAU;AAAA,MACV,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,OAAO,SAAS;AACd,QAAI;AACF,YAAM,MAAM;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,QAAQ;AAAA,MACV,CAAC,2BAA2B,KAAK,IAAI;AAAA,IACvC,QAAQ;AACN,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AACF,EACC;AAAA,EACC;AAAA,EACA;AAAA,EACA,CAACA,WAAU;AACT,WAAOA,OAAM,WAAW,QAAQ;AAAA,MAC9B,MAAM;AAAA,MACN,UAAU;AAAA,MACV,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,OAAO,SAAS;AACd,QAAI;AACF,YAAM,MAAM;AAAA,QACV,QAAQ;AAAA,QACR,QAAQ;AAAA,MACV,CAAC,gDAAgD,KAAK,IAAI;AAAA,IAC5D,QAAQ;AACN,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AACF,EACC,KAAK,EACL,WAAW;","names":["yargs"]}
package/jsr.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glama/fastmcp",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "exports": "./src/FastMCP.ts",
5
5
  "include": ["src/FastMCP.ts", "src/bin/fastmcp.ts"]
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastmcp",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "main": "dist/FastMCP.js",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -2,7 +2,7 @@
2
2
 
3
3
  import yargs from "yargs";
4
4
  import { hideBin } from "yargs/helpers";
5
- import { $ } from "execa";
5
+ import { execa } from "execa";
6
6
 
7
7
  await yargs(hideBin(process.argv))
8
8
  .scriptName("fastmcp")
@@ -17,15 +17,15 @@ await yargs(hideBin(process.argv))
17
17
  });
18
18
  },
19
19
  async (argv) => {
20
- const command = argv.file.endsWith(".ts")
21
- ? ["npx", "tsx", argv.file]
22
- : ["node", argv.file];
23
-
24
- await $({
25
- stdin: "inherit",
26
- stdout: "inherit",
27
- stderr: "inherit",
28
- })`npx @wong2/mcp-cli ${command}`;
20
+ try {
21
+ await execa({
22
+ stdin: "inherit",
23
+ stdout: "inherit",
24
+ stderr: "inherit",
25
+ })`npx @wong2/mcp-cli tsx ${argv.file}`;
26
+ } catch {
27
+ process.exit(1);
28
+ }
29
29
  },
30
30
  )
31
31
  .command(
@@ -39,10 +39,14 @@ await yargs(hideBin(process.argv))
39
39
  });
40
40
  },
41
41
  async (argv) => {
42
- await $({
43
- stdout: "inherit",
44
- stderr: "inherit",
45
- })`npx @modelcontextprotocol/inspector npx tsx ${argv.file}`;
42
+ try {
43
+ await execa({
44
+ stdout: "inherit",
45
+ stderr: "inherit",
46
+ })`npx @modelcontextprotocol/inspector npx tsx ${argv.file}`;
47
+ } catch {
48
+ process.exit(1);
49
+ }
46
50
  },
47
51
  )
48
52
  .help()
@@ -23,4 +23,4 @@ server.addTool({
23
23
 
24
24
  server.start({
25
25
  transportType: "stdio",
26
- });
26
+ });