Skip to main content
Glama

FastMCP

by yamato-snow
fastmcp.ts1.88 kB
#!/usr/bin/env node /** * FastMCP CLI ツール * * このファイルは、FastMCPサーバーを簡単に起動・デバッグするためのコマンドラインインターフェースを提供します。 * 主に以下の2つのコマンドを提供します: * - dev: 開発用サーバーを起動(mcp-cliを使用) * - inspect: MCPインスペクターを使ってサーバーを検査 */ import yargs from "yargs"; import { hideBin } from "yargs/helpers"; import { execa } from "execa"; await yargs(hideBin(process.argv)) .scriptName("fastmcp") .command( "dev <file>", "Start a development server", (yargs) => { return yargs.positional("file", { type: "string", describe: "The path to the server file", demandOption: true, }); }, async (argv) => { try { // mcp-cliを使用してサーバーファイルを実行 // 標準入出力を継承してインタラクティブに操作できるようにする await execa({ stdin: "inherit", stdout: "inherit", stderr: "inherit", })`npx @wong2/mcp-cli npx tsx ${argv.file}`; } catch { process.exit(1); } }, ) .command( "inspect <file>", "Inspect a server file", (yargs) => { return yargs.positional("file", { type: "string", describe: "The path to the server file", demandOption: true, }); }, async (argv) => { try { // MCP Inspectorを使用してサーバーを検査 // ウェブUIを通じてサーバーの機能をテストできる await execa({ stdout: "inherit", stderr: "inherit", })`npx @modelcontextprotocol/inspector npx tsx ${argv.file}`; } catch { process.exit(1); } }, ) .help() .parseAsync();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yamato-snow/2025_McpLab_FastMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server