Skip to main content
The fastmcp inspect command launches the MCP Inspector, a visual debugging tool that provides a web-based interface for testing and debugging your MCP server.

Command Syntax

Arguments

  • <file> - Required. Path to your server file (TypeScript or JavaScript)

Basic Usage

Launch the inspector for your server:
This command:
  1. Starts your MCP server
  2. Launches the MCP Inspector web interface
  3. Automatically opens your browser to the inspector UI
  4. Connects the inspector to your running server

What is MCP Inspector?

MCP Inspector (@modelcontextprotocol/inspector) is an official visual debugging tool from the Model Context Protocol team. It provides:
  • Interactive Tool Testing - Execute tools with a visual form interface
  • Resource Browser - Browse and preview resources with syntax highlighting
  • Prompt Testing - Test prompts and view generated content
  • Real-time Logs - Monitor server logs and events
  • Request/Response Viewer - Inspect MCP protocol messages
  • Schema Validation - Verify tool parameters and responses

Examples

Inspector Interface

Tools Tab

The Tools tab allows you to:
  • View all available tools and their descriptions
  • See tool parameter schemas
  • Fill in parameters using a visual form
  • Execute tools and view results
  • Test error handling

Resources Tab

The Resources tab provides:
  • List of all available resources and templates
  • Resource URI structure
  • Preview resource contents
  • Test resource templates with different arguments
  • View MIME types and metadata

Prompts Tab

The Prompts tab enables:
  • Browse available prompts
  • Test prompt argument completion
  • Preview generated prompt messages
  • Inspect prompt metadata

Logs Tab

The Logs tab displays:
  • Server startup logs
  • Tool execution logs
  • Error messages and stack traces
  • Protocol-level messages
  • Connection events

Transport Compatibility

The inspect command works with servers using the stdio transport:
src/server.ts
For HTTP-based servers (httpStream, sse), you should run your server separately and configure the inspector to connect via HTTP instead of using the CLI command.

Debugging Workflow

Here’s a recommended workflow for debugging with the inspector:
  1. Start the Inspector
  2. Verify Server Connection
    • Check that the server appears connected in the UI
    • Review the server name and version
  3. Test Tools
    • Navigate to the Tools tab
    • Select a tool to test
    • Fill in required parameters
    • Execute and verify the response
  4. Browse Resources
    • Switch to the Resources tab
    • Test resource URIs
    • Verify resource content and MIME types
  5. Monitor Logs
    • Keep the Logs tab open
    • Watch for errors or warnings
    • Verify log messages from your tools

Troubleshooting

Inspector Won’t Start

If the inspector fails to launch:

Browser Doesn’t Open

If the browser doesn’t open automatically:
  • Check the terminal for the inspector URL
  • Manually open the URL in your browser
  • Ensure no firewall is blocking the connection

Connection Issues

If the inspector shows “Disconnected”:
  • Verify your server is using stdio transport
  • Check for errors in the Logs tab
  • Restart the inspector command

Comparison with Dev Command

Dev Command

Run servers with interactive CLI

CLI Overview

Back to CLI overview

Learn More

MCP Inspector GitHub

Official MCP Inspector repository and documentation