---
schema: rendered-html/v1
title: "CLI - FastMCP"
source_url: https://gofastmcp.com/cli/overview
generated_at: 2026-06-11T19:37:49.169290+00:00
---




[FastMCP home page![light logo](images/gofastmcp__com__cli__overview__wordmark.avif)![dark logo](images/gofastmcp__com__cli__overview__wordmark-white.avif)](gofastmcp__com.md)







CLI

CLI





















  - [Overview](/cli/overview)
  - [Running](gofastmcp__com__cli__running.md)
  - [Install MCPs](gofastmcp__com__cli__install-mcp.md)
  - [Inspecting](gofastmcp__com__cli__inspecting.md)
  - [Client](gofastmcp__com__cli__client.md)
  - [Generate CLI](gofastmcp__com__cli__generate-cli.md)
  - [Auth](gofastmcp__com__cli__auth.md)


- [Commands at a Glance](#commands-at-a-glance)
- [Server Targets](#server-targets)
  - [Name-Based Resolution](#name-based-resolution)
- [Authentication](#authentication)
- [Transport Override](#transport-override)

CLI

# CLI


The fastmcp command-line interface


The `fastmcp` CLI is installed automatically with FastMCP. It’s the primary way to run, test, install, and interact with MCP servers from your terminal.

fastmcp --help

## [​](#commands-at-a-glance) Commands at a Glance

| Command | What it does |
| --- | --- |
| [`run`](gofastmcp__com__cli__running.md) | Run a server (local file, factory function, remote URL, or config file) |
| [`dev apps`](gofastmcp__com__cli__running.md) | Launch a browser-based preview UI for Prefab App tools |
| [`dev inspector`](gofastmcp__com__cli__running.md) | Launch a server inside the MCP Inspector for interactive testing |
| [`install`](gofastmcp__com__cli__install-mcp.md) | Install a server into Claude Code, Claude Desktop, Cursor, Gemini CLI, or Goose |
| [`inspect`](gofastmcp__com__cli__inspecting.md) | Print a server’s tools, resources, and prompts as a summary or JSON report |
| [`list`](gofastmcp__com__cli__client.md) | List a server’s tools (and optionally resources and prompts) |
| [`call`](gofastmcp__com__cli__client.md) | Call a single tool with arguments |
| [`discover`](gofastmcp__com__cli__client.md) | Find MCP servers configured in your editors and tools |
| [`generate-cli`](gofastmcp__com__cli__generate-cli.md) | Scaffold a standalone typed CLI from a server’s tool schemas |
| [`project prepare`](gofastmcp__com__cli__running.md) | Pre-install dependencies into a reusable uv project |
| [`auth cimd`](gofastmcp__com__cli__auth.md) | Create and validate CIMD documents for OAuth |
| `version` | Print version info (`--copy` to copy to clipboard) |

## [​](#server-targets) Server Targets

Most commands need to know *which server* to talk to. You pass a “server spec” as the first argument, and FastMCP resolves the right transport automatically.
**URLs** connect to a running HTTP server:

fastmcp list http://localhost:8000/mcp
fastmcp call http://localhost:8000/mcp get_forecast city=London

**Python files** are loaded directly — no `mcp.run()` boilerplate needed. FastMCP finds a server instance named `mcp`, `server`, or `app` in the file, or you can specify one explicitly:

fastmcp list server.py
fastmcp run server.py:my_custom_server

**Config files** work too — both FastMCP’s own `fastmcp.json` format and standard MCP config files with an `mcpServers` key:

fastmcp run fastmcp.json
fastmcp list mcp-config.json

**Stdio commands** connect to any MCP server that speaks over standard I/O. Use `--command` instead of a positional argument:

fastmcp list --command 'npx -y @modelcontextprotocol/server-github'

### [​](#name-based-resolution) Name-Based Resolution

If your servers are already configured in an editor or tool, you can refer to them by name. FastMCP scans configs from Claude Desktop, Claude Code, Cursor, Gemini CLI, and Goose:

fastmcp list weather
fastmcp call weather get_forecast city=London

When the same name appears in multiple configs, use the `source:name` form to be specific:

fastmcp list claude-code:my-server
fastmcp call cursor:weather get_forecast city=London

Run [`fastmcp discover`](gofastmcp__com__cli__client.md) to see what’s available on your machine.

## [​](#authentication) Authentication

When targeting an HTTP URL, the CLI enables OAuth authentication by default. If the server requires it, you’ll be guided through the flow (typically opening a browser). If it doesn’t, the setup is a silent no-op.
To skip authentication entirely — useful for local development servers — pass `--auth none`:

fastmcp call http://localhost:8000/mcp my_tool --auth none

You can also pass a bearer token directly:

fastmcp list http://localhost:8000/mcp --auth "Bearer sk-..."

## [​](#transport-override) Transport Override

FastMCP defaults to Streamable HTTP for URL targets. If the server only supports Server-Sent Events (SSE), force the older transport:

fastmcp list http://localhost:8000 --transport sse

[Settings

Previous](gofastmcp__com__more__settings.md)[Running Servers

Next](gofastmcp__com__cli__running.md)






