MCP Inspector logo

MCP Inspector

OrganizationPopular
modelcontextprotocol

Visual testing tool for MCP servers

Publishermodelcontextprotocol
Repositoryinspector
LanguageTypeScript
Forks
1.3K
Stars
9.8K
Available tools
0
Transport typestdio
Categories
LicenseNOASSERTION
Links
  • Connect tools to AI workflows

    MCP Inspector exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    9.8K stars and 1.3K forks from the linked repository.

MCP Inspector

The MCP inspector is a developer tool for testing and debugging MCP servers.

MCP Inspector Screenshot

Architecture Overview

The MCP Inspector consists of two main components that work together:

  • MCP Inspector Client (MCPI): A React-based web UI that provides an interactive interface for testing and debugging MCP servers
  • MCP Proxy (MCPP): A Node.js server that acts as a protocol bridge, connecting the web UI to MCP servers via various transport methods (stdio, SSE, streamable-http)

Note that the proxy is not a network proxy for intercepting traffic. Instead, it functions as both an MCP client (connecting to your MCP server) and an HTTP server (serving the web UI), enabling browser-based interaction with MCP servers that use different transport protocols.

Running the Inspector

Requirements

  • Node.js: ^22.7.5

Quick Start (UI mode)

To get up and running right away with the UI, just execute the following:

bash
npx @modelcontextprotocol/inspector

The server will start up and the UI will be accessible at http://localhost:6274.

Docker Container

You can also start it in a Docker container with the following command:

bash
docker run --rm \
  -p 127.0.0.1:6274:6274 \
  -p 127.0.0.1:6277:6277 \
  -e HOST=0.0.0.0 \
  -e MCP_AUTO_OPEN_ENABLED=false \
  ghcr.io/modelcontextprotocol/inspector:latest

From an MCP server repository

To inspect an MCP server implementation, there's no need to clone this repo. Instead, use npx. For example, if your server is built at build/index.js:

bash
npx @modelcontextprotocol/inspector node build/index.js

You can pass both arguments and environment variables to your MCP server. Arguments are passed directly to your server, while environment variables can be set using the -e flag:

bash
# Pass arguments only
npx @modelcontextprotocol/inspector node build/index.js arg1 arg2

# Pass environment variables only
npx @modelcontextprotocol/inspector -e key=value -e key2=$VALUE2 node build/index.js

# Pass both environment variables and arguments
npx @modelcontextprotocol/inspector -e key=value -e key2=$VALUE2 node build/index.js arg1 arg2

# Use -- to separate inspector flags from server arguments
npx @modelcontextprotocol/inspector -e key=$VALUE -- node build/index.js -e server-flag

The inspector runs both an MCP Inspector (MCPI) client UI (default port 6274) and an MCP Proxy (MCPP) server (default port 6277). Open the MCPI client UI in your browser to use the inspector. (These ports are derived from the T9 dialpad mapping of MCPI and MCPP respectively, as a mnemonic). You can customize the ports if needed:

bash
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node build/index.js

For more details on ways to use the inspector, see the Inspector section of the MCP docs site. For help with debugging, see the Debugging guide.

Servers File Export

The MCP Inspector provides convenient buttons to export server launch configurations for use in clients such as Cursor, Claude Code, or the Inspector's CLI. The file is usually called mcp.json.

  • Server Entry - Copies a single server configuration entry to your clipboard. This can be added to your mcp.json file inside the mcpServers object with your preferred server name.

    STDIO transport example:

    json
    {
      "command": "node",
      "args": ["build/index.js", "--debug"],
      "env": {
        "API_KEY": "your-api-key",
        "DEBUG": "true"
      }
    }

    SSE transport example:

    json
    {
      "type": "sse",
      "url": "http://localhost:3000/events",
      "note": "For SSE connections, add this URL directly in Client"
    }

    Streamable HTTP transport example:

    json
    {
      "type": "streamable-http",
      "url": "http://localhost:3000/mcp",
      "note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
    }
  • Servers File - Copies a complete MCP configuration file structure to your clipboard, with your current server configuration added as default-server. This can be saved directly as mcp.json.

    STDIO transport example:

    json
    {
      "mcpServers": {
        "default-server": {
          "command": "node",
          "args": ["build/index.js", "--debug"],
          "env": {
            "API_KEY": "your-api-key",
            "DEBUG": "true"
          }
        }
      }
    }

    SSE transport example:

    json
    {
      "mcpServers": {
        "default-server": {
          "type": "sse",
          "url": "http://localhost:3000/events",
          "note": "For SSE connections, add this URL directly in Client"
        }
      }
    }

    Streamable HTTP transport example:

    json
    {
      "mcpServers": {
        "default-server": {
          "type": "streamable-http",
          "url": "http://localhost:3000/mcp",
          "note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
        }
      }
    }

These buttons appear in the Inspector UI after you've configured your server settings, making it easy to save and reuse your configurations.

For SSE and Streamable HTTP transport connections, the Inspector provides similar functionality for both buttons. The "Server Entry" button copies the configuration that can be added to your existing configuration file, while the "Servers File" button creates a complete configuration file containing the URL for direct use in clients.

You can paste the Server Entry into your existing mcp.json file under your chosen server name, or use the complete Servers File payload to create a new configuration file.

Authentication

The inspector supports bearer token authentication for SSE connections. Enter your token in the UI when connecting to an MCP server, and it will be sent in the Authorization header. You can override the header name using the input field in the sidebar.

Security Considerations

The MCP Inspector includes a proxy server that can run and communicate with local MCP processes. The proxy server should not be exposed to untrusted networks as it has permissions to spawn local processes and can connect to any specified MCP server.

Authentication

The MCP Inspector proxy server requires authentication by default. When starting the server, a random session token is generated and printed to the console:

πŸ”‘ Session token: 3a1c267fad21f7150b7d624c160b7f09b0b8c4f623c7107bbf13378f051538d4

πŸ”— Open inspector with token pre-filled:
   http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=3a1c267fad21f7150b7d624c160b7f09b0b8c4f623c7107bbf13378f051538d4

This token must be included as a Bearer token in the Authorization header for all requests to the server. The inspector will automatically open your browser with the token pre-filled in the URL.

Automatic browser opening - The inspector now automatically opens your browser with the token pre-filled in the URL when authentication is enabled.

Alternative: Manual configuration - If you already have the inspector open:

  1. Click the "Configuration" button in the sidebar
  2. Find "Proxy Session Token" and enter the token displayed in the proxy console
  3. Click "Save" to apply the configuration

The token will be saved in your browser's local storage for future use.

If you need to disable authentication (NOT RECOMMENDED), you can set the DANGEROUSLY_OMIT_AUTH environment variable:

bash
DANGEROUSLY_OMIT_AUTH=true npm start

🚨 WARNING 🚨

Disabling authentication with DANGEROUSLY_OMIT_AUTH is incredibly dangerous! Disabling auth leaves your machine open to attack not just when exposed to the public internet, but also via your web browser. Meaning, visiting a malicious website OR viewing a malicious advertizement could allow an attacker to remotely compromise your computer. Do not disable this feature unless you truly understand the risks.

Read more about the risks of this vulnerability on Oligo's blog: Critical RCE Vulnerability in Anthropic MCP Inspector - CVE-2025-49596


You can also set the token via the MCP_PROXY_AUTH_TOKEN environment variable when starting the server:

bash
MCP_PROXY_AUTH_TOKEN=$(openssl rand -hex 32) npm start

Local-only Binding

By default, both the MCP Inspector proxy server and client bind only to localhost to prevent network access. This ensures they are not accessible from other devices on the network. If you need to bind to all interfaces for development purposes, you can override this with the HOST environment variable:

bash
HOST=0.0.0.0 npm start

Warning: Only bind to all interfaces in trusted network environments, as this exposes the proxy server's ability to execute local processes and both services to network access.

DNS Rebinding Protection

To prevent DNS rebinding attacks, the MCP Inspector validates the Origin header on incoming requests. By default, only requests from the client origin are allowed (respects CLIENT_PORT if set, defaulting to port 6274). You can configure additional allowed origins by setting the ALLOWED_ORIGINS environment variable (comma-separated list):

bash
ALLOWED_ORIGINS=http://localhost:6274,http://localhost:8000 npm start

Configuration

The MCP Inspector supports the following configuration settings. To change them, click on the Configuration button in the MCP Inspector UI:

SettingDescriptionDefault
MCP_SERVER_REQUEST_TIMEOUTClient-side timeout (ms) - Inspector will cancel the request if no response is received within this time. Note: servers may have their own timeouts300000
MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESSReset timeout on progress notificationstrue
MCP_REQUEST_MAX_TOTAL_TIMEOUTMaximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)60000
MCP_PROXY_FULL_ADDRESSSet this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577""
MCP_AUTO_OPEN_ENABLEDEnable automatic browser opening when inspector starts (works with authentication enabled). Only as environment var, not configurable in browser.true

Note on Timeouts: The timeout settings above control when the Inspector (as an MCP client) will cancel requests. These are independent of any server-side timeouts. For example, if a server tool has a 10-minute timeout but the Inspector's timeout is set to 30 seconds, the Inspector will cancel the request after 30 seconds. Conversely, if the Inspector's timeout is 10 minutes but the server times out after 30 seconds, you'll receive the server's timeout error. For tools that require user interaction (like elicitation) or long-running operations, ensure the Inspector's timeout is set appropriately.

These settings can be adjusted in real-time through the UI and will persist across sessions.

The inspector also supports configuration files to store settings for different MCP servers. This is useful when working with multiple servers or complex configurations:

bash
npx @modelcontextprotocol/inspector --config path/to/config.json --server everything

Example server configuration file:

json
{
  "mcpServers": {
    "everything": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-everything"],
      "env": {
        "hello": "Hello MCP!"
      }
    },
    "my-server": {
      "command": "node",
      "args": ["build/index.js", "arg1", "arg2"],
      "env": {
        "key": "value",
        "key2": "value2"
      }
    }
  }
}

Transport Types in Config Files

The inspector automatically detects the transport type from your config file. You can specify different transport types:

STDIO (default):

json
{
  "mcpServers": {
    "my-stdio-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["@modelcontextprotocol/server-everything"]
    }
  }
}

SSE (Server-Sent Events):

json
{
  "mcpServers": {
    "my-sse-server": {
      "type": "sse",
      "url": "http://localhost:3000/sse"
    }
  }
}

Streamable HTTP:

json
{
  "mcpServers": {
    "my-http-server": {
      "type": "streamable-http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Default Server Selection

You can launch the inspector without specifying a server name if your config has:

  1. A single server - automatically selected:
bash
# Automatically uses "my-server" if it's the only one
npx @modelcontextprotocol/inspector --config mcp.json
  1. A server named "default-server" - automatically selected:
json
{
  "mcpServers": {
    "default-server": {
      "command": "npx",
      "args": ["@modelcontextprotocol/server-everything"]
    },
    "other-server": {
      "command": "node",
      "args": ["other.js"]
    }
  }
}

Tip: You can easily generate this configuration format using the Server Entry and Servers File buttons in the Inspector UI, as described in the Servers File Export section above.

You can also set the initial transport type, serverUrl, serverCommand, and serverArgs via query params, for example:

http://localhost:6274/?transport=sse&serverUrl=http://localhost:8787/sse
http://localhost:6274/?transport=streamable-http&serverUrl=http://localhost:8787/mcp
http://localhost:6274/?transport=stdio&serverCommand=npx&serverArgs=arg1%20arg2

You can also set initial config settings via query params, for example:

http://localhost:6274/?MCP_SERVER_REQUEST_TIMEOUT=60000&MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS=false&MCP_PROXY_FULL_ADDRESS=http://10.1.1.22:5577

Note that if both the query param and the corresponding localStorage item are set, the query param will take precedence.

From this repository

If you're working on the inspector itself:

Development mode:

bash
npm run dev

# To co-develop with the typescript-sdk package (assuming it's cloned in ../typescript-sdk; set MCP_SDK otherwise):
npm run dev:sdk "cd sdk && npm run examples:simple-server:w"
# then open http://localhost:3000/mcp as SHTTP in the inspector.
# To go back to the deployed SDK version:
#   npm run unlink:sdk && npm i

Note for Windows users: On Windows, use the following command instead:

bash
npm run dev:windows

Production mode:

bash
npm run build
npm start

CLI Mode

CLI mode enables programmatic interaction with MCP servers from the command line, ideal for scripting, automation, and integration with coding assistants. This creates an efficient feedback loop for MCP server development.

bash
npx @modelcontextprotocol/inspector --cli node build/index.js

The CLI mode supports most operations across tools, resources, and prompts. A few examples:

bash
# Basic usage
npx @modelcontextprotocol/inspector --cli node build/index.js

# With config file
npx @modelcontextprotocol/inspector --cli --config path/to/config.json --server myserver

# List available tools
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list

# Call a specific tool
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg key=value --tool-arg another=value2

# Call a tool with JSON arguments
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/call --tool-name mytool --tool-arg 'options={"format": "json", "max_tokens": 100}'

# List available resources
npx @modelcontextprotocol/inspector --cli node build/index.js --method resources/list

# List available prompts
npx @modelcontextprotocol/inspector --cli node build/index.js --method prompts/list

# Connect to a remote MCP server (default is SSE transport)
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com

# Connect to a remote MCP server (with Streamable HTTP transport)
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --transport http --method tools/list

# Connect to a remote MCP server (with custom headers)
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --transport http --method tools/list --header "X-API-Key: your-api-key"

# Call a tool on a remote server
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method tools/call --tool-name remotetool --tool-arg param=value

# List resources from a remote server
npx @modelcontextprotocol/inspector --cli https://my-mcp-server.example.com --method resources/list

UI Mode vs CLI Mode: When to Use Each

Use CaseUI ModeCLI Mode
Server DevelopmentVisual interface for interactive testing and debugging during developmentScriptable commands for quick testing and continuous integration; creates feedback loops with AI coding assistants like Cursor for rapid development
Resource ExplorationInteractive browser with hierarchical navigation and JSON visualizationProgrammatic listing and reading for automation and scripting
Tool TestingForm-based parameter input with real-time response visualizationCommand-line tool execution with JSON output for scripting
Prompt EngineeringInteractive sampling with streaming responses and visual comparisonBatch processing of prompts with machine-readable output
DebuggingRequest history, visualized errors, and real-time notificationsDirect JSON output for log analysis and integration with other tools
AutomationN/AIdeal for CI/CD pipelines, batch processing, and integration with coding assistants
Learning MCPRich visual interface helps new users understand server capabilitiesSimplified commands for focused learning of specific endpoints

Tool Input Validation Guidelines

When implementing or modifying tool input parameter handling in the Inspector:

  • Omit optional fields with empty values - When processing form inputs, omit empty strings or null values for optional parameters, UNLESS the field has an explicit default value in the schema that matches the current value
  • Preserve explicit default values - If a field schema contains an explicit default (e.g., default: null), and the current value matches that default, include it in the request. This is a meaningful value the tool expects
  • Always include required fields - Preserve required field values even when empty, allowing the MCP server to validate and return appropriate error messages
  • Defer deep validation to the server - Implement basic field presence checking in the Inspector client, but rely on the MCP server for parameter validation according to its schema

These guidelines maintain clean parameter passing and proper separation of concerns between the Inspector client and MCP servers.

License

This project is licensed under the MIT Licenseβ€”see the LICENSE file for details.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "modelcontextprotocol-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/inspector"
      ]
    }
  }
}

Use MCP Inspector MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Inspector is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP Inspector as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP Inspector MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "modelcontextprotocol-inspector": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/inspector"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Inspector MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP Inspector MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Inspector to help me with this task?
MCP Inspector
Sure. I read it.
Here is what I found using MCP Inspector.

Frequently asked questions

What is the MCP Inspector MCP server used for?

MCP Inspector is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Inspector MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Inspector with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Inspector MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Inspector connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Inspector MCP to TypingMind?

MCP Inspector runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP Inspector MCP provide in TypingMind?

MCP Inspector exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Inspector MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Inspector requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter πŸ‘‡