fastmcp 1.5.6 → 1.5.7
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 +6 -1
- package/dist/bin/fastmcp.js +1 -1
- package/dist/bin/fastmcp.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/bin/fastmcp.ts +1 -1
- package/src/examples/addition.ts +26 -0
package/README.md
CHANGED
|
@@ -53,7 +53,12 @@ server.start({
|
|
|
53
53
|
You can test the server in terminal with:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
|
|
56
|
+
git clone https://github.com/punkpeye/fastmcp.git
|
|
57
|
+
cd fastmcp
|
|
58
|
+
# Test the addition server example using CLI:
|
|
59
|
+
npx fastmcp dev src/examples/addition.ts
|
|
60
|
+
# Test the additition server example using MCP Inspector:
|
|
61
|
+
npx fastmcp inspect src/examples/additition.ts
|
|
57
62
|
```
|
|
58
63
|
|
|
59
64
|
### SSE
|
package/dist/bin/fastmcp.js
CHANGED
|
@@ -36,7 +36,7 @@ await yargs(hideBin(process.argv)).scriptName("fastmcp").command(
|
|
|
36
36
|
await $({
|
|
37
37
|
stdout: "inherit",
|
|
38
38
|
stderr: "inherit"
|
|
39
|
-
})`npx @modelcontextprotocol/inspector
|
|
39
|
+
})`npx @modelcontextprotocol/inspector npx tsx ${argv.file}`;
|
|
40
40
|
}
|
|
41
41
|
).help().parseAsync();
|
|
42
42
|
//# sourceMappingURL=fastmcp.js.map
|
package/dist/bin/fastmcp.js.map
CHANGED
|
@@ -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
|
|
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"]}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
package/src/bin/fastmcp.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a complete example of an MCP server.
|
|
3
|
+
*/
|
|
4
|
+
import { FastMCP } from "../FastMCP.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
const server = new FastMCP({
|
|
8
|
+
name: "Addition",
|
|
9
|
+
version: "1.0.0",
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
server.addTool({
|
|
13
|
+
name: "add",
|
|
14
|
+
description: "Add two numbers",
|
|
15
|
+
parameters: z.object({
|
|
16
|
+
a: z.number(),
|
|
17
|
+
b: z.number(),
|
|
18
|
+
}),
|
|
19
|
+
execute: async (args) => {
|
|
20
|
+
return String(args.a + args.b);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
server.start({
|
|
25
|
+
transportType: "stdio",
|
|
26
|
+
});
|