Ad space · Your tool here
PluginStack
Tutorial

How to use MCP Inspector to test an MCP server

Checked against the official docs:

[MCP Inspector](/plugins/mcp-inspector/) is the official tool from the Model Context Protocol project for testing MCP servers. It connects to a server on its own, without Claude, Cursor or any other app, and shows you exactly which tools, resources and prompts the server offers. You can call a tool and see the raw result. That makes it the quickest way to tell whether a problem is in the server or in your app's settings. Version 2 changed a lot, so older tutorials often don't match what you see. This guide was checked against the Inspector's own docs on 2 December 2026, and the commands were run on version 2.17.0.

Get new guides by email

New MCP servers and agent tools, checked by hand. Free, unsubscribe anytime.

The newsletter hasn't started sending yet. Join the list now and we'll email you when the first issue goes out. From PluginStack (pluginstackai@gmail.com). Privacy policy.

Paid prompt and rules packs are on the packs page.

Quick answer

  1. Check node -v. Version 2 needs a recent patched Node.js (details below).
  2. Run npx @modelcontextprotocol/inspector. The web UI opens in your browser at http://127.0.0.1:6274.
  3. To test one specific server, add its command after the package name, for example npx @modelcontextprotocol/inspector node build/index.js.
  4. Connect, open the Tools screen, pick a tool, fill in its inputs and run it.
  5. For scripts and quick checks, use the CLI: npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list.

Free: MCP Starter Checklist

One page: Inspector smoke-test, Claude Code + Cursor connect steps, and the stdout gotcha. Join the list and download it free.

Markdown download + occasional PluginStack updates. No spam. Privacy policy.

What you need

Inspector 2 needs Node.js ^22.23.4 || ^24.22.1 || >=26.12.1: the patched release on each supported line (22.23.4 or newer on 22, 24.22.1 or newer on 24, or 26.12.1 or newer). The docs explain why: older Node versions miss security fixes for TLS and DNS. npm only warns about an older Node when you install (an EBADENGINE warning), and the Inspector then fails later in confusing ways, so check node -v first.

You don't need to install anything else. npx downloads the current version each time.

Open the web UI

With no arguments, the Inspector opens its web UI with a list of servers saved in ~/.mcp-inspector/mcp.json. On first launch it fills that list with three sample servers (a filesystem server, the "everything" test server and a hosted example server), so you have something to click on straight away:

bash
npx @modelcontextprotocol/inspector

The terminal prints the address, http://127.0.0.1:6274, with a one-time access token in the link, and opens your browser. If you open the page by hand, use the full link from the terminal, token included. Set MCP_AUTO_OPEN_ENABLED=false if you don't want a browser window to open.

Test your own local server

Put the command that starts your server after the package name. Use -e for environment variables, and -- before your server's own flags:

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

# with an environment variable and a server flag
npx @modelcontextprotocol/inspector -e API_KEY=your-key -- node build/index.js --server-flag

Test a hosted server

bash
npx @modelcontextprotocol/inspector --server-url https://example.com/mcp --transport http

Add --header "Name: Value" if the server needs an API key in a header. Servers that use OAuth sign-in walk you through it in the browser.

What to check

  • Tools: every tool the server offers, with its inputs. Fill in the form and run it to see the exact result your agent would get, including errors.
  • Resources and Prompts: the other things a server can offer, if it has any.
  • The connection status and logs: if the server fails to start or connect, the error shows here before you ever open your agent.

If a tool works here but not in your app, the server is fine and the problem is your app's settings (wrong file, a missing key, a path your app can't see).

Use the CLI for quick checks and scripts

Add --cli right after the package name. It connects, runs one request, prints JSON and exits. These ran on version 2.17.0 against the official "everything" test server and the hosted Context7 server:

bash
# list the tools of a local server
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list

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

# a hosted server (the transport is guessed from a URL ending in /mcp or /sse)
npx @modelcontextprotocol/inspector --cli https://mcp.context7.com/mcp --method tools/list

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

Two rules catch people out. The server command or URL has to come before the other flags. And if a URL doesn't end in /mcp or /sse, add --transport http (or --transport sse), because version 2 doesn't guess.

Exit codes

The CLI exits with a code that says why it failed, and prints one line of JSON describing the error on stderr. The ones you'll see most:

  • 0: success.
  • 1: wrong usage or an unexpected error.
  • 3: sign-in failed or is needed (for example a 401 or 403).
  • 4: the server couldn't be reached (DNS, connection refused, timeout).
  • 5: the tool returned an error, or there is no tool with that name. In our test, calling a tool that doesn't exist printed {"error":{"code":"tool_not_found",...}} and exited with 5.

That makes the CLI handy in CI: a step that lists tools or calls one fails the job when the server breaks.

Terminal UI

npx @modelcontextprotocol/inspector --tui opens an interactive version in the terminal, for machines without a browser.

Saved servers and config files

Version 2 keeps its own list of servers in a file on disk, ~/.mcp-inspector/mcp.json, in the same mcpServers format Claude Desktop and Cursor use. Two flags choose a different file:

  • --catalog ./mcp.json: use this file as the Inspector's own list. It can add, edit and remove servers in it, and creates it if it's missing.
  • --config ./mcp.json: open this file read-only. The Inspector never writes to it, which is the safe choice for your app's real config file. It errors if the file doesn't exist.

With the CLI, --server <name> picks one entry from the file: npx @modelcontextprotocol/inspector --cli --config ./mcp.json --server myserver --method tools/list. In the web UI, --server is ignored and you pick the server from the list.

Each saved server can also set connectionTimeout (default 30,000 milliseconds) and requestTimeout in milliseconds, which helps when you are chasing timeouts.

Where your keys are stored

The Inspector saves OAuth tokens, client secrets and the -e values for local servers in your system keychain when there is one. On a machine without a keychain (many Linux setups, SSH sessions, containers) it saves them to ~/.mcp-inspector/secrets.json instead, unencrypted, and prints a warning when it starts. Set MCP_INSPECTOR_SECRET_KEY (or MCP_INSPECTOR_SECRET_KEY_FILE) to a long random passphrase to encrypt that file.

What changed from version 1

Version 2 is a rewrite. The npx @modelcontextprotocol/inspector command is the same, but older tutorials can mislead you:

  • One port. Version 1 ran the UI on 6274 and a proxy on 6277. Version 2 has no proxy, so you no longer need port 6277. (The Apps tab uses a separate port, 6275, which only matters in Docker, dev containers or over SSH.)
  • New token name. MCP_PROXY_AUTH_TOKEN is now MCP_INSPECTOR_API_TOKEN.
  • `--config` means read-only. Use --catalog if you want the Inspector to manage the file.
  • A failing tool call now fails the command (exit code 5). In version 1 it exited 0, so CI scripts that relied on that start failing.
  • One package. @modelcontextprotocol/inspector-cli, -client and -server are deprecated. Use @modelcontextprotocol/inspector.

Version 1 still gets security fixes only. If you really need it: npx @modelcontextprotocol/inspector@v1-latest.

Common problems

"Transport type not specified and could not be determined from URL"

The URL doesn't end in /mcp or /sse. Add --transport http or --transport sse.

The CLI connects to the wrong server, or ignores your command

Under --cli, put the server command or URL before every other flag. Otherwise it may be dropped in favor of your saved list.

The page never loads in a VS Code dev container or over an SSH tunnel

The docs say this was fixed in a later v2 release, so update first (npx gets the latest unless you pinned a version). On an older version, start it with HOST=127.0.0.1.

"HOST=0.0.0.0" stops with an error

Version 2 refuses to listen on every network interface by accident. Use a specific address instead. Only set DANGEROUSLY_BIND_ALL_INTERFACES=true if you really need the Inspector reachable from other machines.

Strange errors right after starting

Check node -v against the version list at the top. An older Node is the usual cause.

My server fails in the Inspector too

Then the problem is the server itself, not your app. For a local server that exits right away, see fix MCP error -32000: Connection closed. For a call that hangs and gives up, see fix MCP error -32001: Request timed out.

FAQ

Is MCP Inspector free?

Yes. It is open source from the Model Context Protocol project. The repository's license file covers Apache-2.0 for new code and MIT for older contributions.

Do I need it to use MCP servers in Claude, Cursor or Gemini CLI?

No. It is a testing tool. It helps most when a server doesn't work in your app and you need to know why.

Can I use my Claude Desktop or Cursor config with it?

Yes. It reads the same mcpServers format. Open it read-only with --config so the Inspector never changes your real file.

Next step: add the working server to your app

See how to add an MCP server to Cursor, VS Code, Claude Desktop, Codex or Gemini CLI.

Sources

Commands and config above come from these official docs. Tools change often, so check them for the latest steps.

PluginStack is independent and not affiliated with or endorsed by the companies mentioned. Spotted something out of date? Email pluginstackai@gmail.com.

Get new guides by email

New MCP servers and agent tools, checked by hand. Free, unsubscribe anytime.

The newsletter hasn't started sending yet. Join the list now and we'll email you when the first issue goes out. From PluginStack (pluginstackai@gmail.com). Privacy policy.

Paid prompt and rules packs are on the packs page.