Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

2.7 KB
Raw Blame
---
title: Inspecting Servers
sidebarTitle: Inspecting
description: View a server's components and metadata
icon: magnifying-glass
---

import { VersionBadge } from '/snippets/version-badge.mdx'

<VersionBadge version="2.9.0" />

`fastmcp inspect` loads a server and reports what it contains β€” its tools, resources, prompts, version, and metadata. The default output is a human-readable summary:

```bash
fastmcp inspect server.py
```

```text
Server
  Name:         MyServer
  Version:      1.0.0
  Generation:   2
  Instructions: A helpful MCP server

Components
  Tools:        5
  Prompts:      2
  Resources:    3
  Templates:    1

Environment
  FastMCP:      4.2.0
  MCP:          2.3.0

Use --format [fastmcp|mcp] for complete JSON output
```

## JSON Output

For programmatic use, two JSON formats are available:

**FastMCP format** (`--format fastmcp`) includes everything FastMCP knows about the server β€” component keys, tags, output schemas, annotations, custom metadata, and the server's capabilities. Field names use `snake_case`. This is the format for debugging and introspecting FastMCP servers.

**MCP protocol format** (`--format mcp`) shows exactly what MCP clients see through the protocol β€” only standard MCP fields, `camelCase` names, no FastMCP-specific extensions. This is the format for verifying client compatibility and debugging what clients actually receive.

```bash
# Full FastMCP metadata to stdout
fastmcp inspect server.py --format fastmcp

# MCP protocol view saved to file
fastmcp inspect server.py --format mcp -o manifest.json
```

## Options

| Option | Flag | Description |
| ------ | ---- | ----------- |
| Format | `--format`, `-f` | `fastmcp` or `mcp` (required when using `-o`) |
| Output File | `--output`, `-o` | Save to file instead of stdout |
| Python | `--python` | Python version to use when running via `uv` |
| Extra Packages | `--with` | Additional packages to install (repeatable) |
| Project | `--project` | Run within a specific uv project directory |
| Requirements | `--with-requirements` | Install from a requirements file |
| Skip Env | `--skip-env` | Do not set up a uv environment |

## Entrypoints

The `inspect` command supports the same local entrypoints as [`fastmcp run`](/cli/running): inferred instances, explicit entrypoints, factory functions, and `fastmcp.json` configs.

```bash
fastmcp inspect server.py                  # inferred instance
fastmcp inspect server.py:my_server        # explicit entrypoint
fastmcp inspect server.py:create_server    # factory function
fastmcp inspect fastmcp.json               # config file
```

<Warning>
`inspect` only works with local files and `fastmcp.json` β€” it doesn't connect to remote URLs or standard MCP config files.
</Warning>