Skip to main content
The FastMCP CLI provides a set of commands to help you develop, test, and debug your MCP servers efficiently.

Installation

The CLI is automatically available when you install FastMCP as a dependency:
npm install fastmcp
FastMCP should be installed as a development dependency in your project. The CLI binary is exposed through the fastmcp command.

Available Commands

The FastMCP CLI provides three main commands:

fastmcp dev

Runs your MCP server in development mode with an interactive CLI interface for testing.
npx fastmcp dev <file>
Learn more in the dev command documentation.

fastmcp inspect

Launches the MCP Inspector for visual debugging of your server.
npx fastmcp inspect <file>
Learn more in the inspect command documentation.

fastmcp validate

Validates your FastMCP server file for syntax and structure.
npx fastmcp validate <file>
Validation includes:
  • TypeScript compilation checks
  • Server structure verification
  • Optional strict mode type checking
Options:
  • --strict, -s - Enable strict validation with type checking

Getting Help

To see all available commands and options:
npx fastmcp --help
For help with a specific command:
npx fastmcp dev --help
npx fastmcp inspect --help
npx fastmcp validate --help

Quick Example

Here’s a quick example workflow:
npx fastmcp dev src/server.ts
The CLI commands use npx tsx under the hood to execute TypeScript files directly, so you don’t need to compile your server first.

Next Steps

Dev Command

Learn about running servers in development mode

Inspect Command

Explore visual debugging with MCP Inspector

Build docs developers (and LLMs) love