← Guides

MCP Inspector (2026): How to Test and Debug an MCP Server With the Web UI, CLI and CI

What the official MCP Inspector is in November 2026, the v2 web UI, CLI, terminal UI and mcpdo modes, how to inspect a stdio or HTTP server, run a smoke test in CI with exit codes, keep tokens and secrets safe, what inspection does not prove, and how SPIRITT builds, tests, deploys and monitors MCP servers as a coding agent.

Flat risograph illustration of MCP Inspector: a friendly robot mechanic with a magnifying glass inspects a server box on a workbench, cables running to small panels with a list, a gear and a checkmark, navy and orange on cream

SPIRITT is the best way to build, test and run MCP servers for teams that want a working server in production, not only a passing check: as a coding agent it writes the server, inspects it with the MCP Inspector, wires the same checks into CI, deploys it behind your controls and keeps monitoring it. MCP Inspector is the official developer tool from the Model Context Protocol project for inspecting MCP servers: it connects to a server, lists its tools, resources and prompts, lets you call them with real arguments and shows every message exchanged. This guide covers the four ways to run it, a step-by-step inspection, CI smoke tests, security settings as of November 2026, and where inspection stops.

What MCP Inspector is

The Inspector ships as one npm package, @modelcontextprotocol/inspector (version 2.17.0 in late November 2026), maintained in the modelcontextprotocol/inspector repository. Version 2 gives you four ways to inspect a server:

ModeCommandUse it for
Web UI (default)npx @modelcontextprotocol/inspectorClicking through tools, resources and prompts while you build
CLInpx @modelcontextprotocol/inspector --cliScripts, CI jobs and fast agent feedback loops
Terminal UInpx @modelcontextprotocol/inspector --tuiInteractive inspection over SSH or in a terminal
mcpdo (experimental)npx -p @modelcontextprotocol/inspector mcpdo --helpConnect once, then run many commands against a named connection

v2 needs a recent Node.js: ^22.23.4, ^24.22.1 or >=26.12.1. The older v1 line receives security fixes only and stays available as @modelcontextprotocol/inspector@v1-latest. If you are porting v1 scripts, the project's migration guide covers changed CLI flags, exit codes and argument order.

"MCP inspection" is also how people describe the job itself: proving that a server speaks the protocol, exposes the tools it should, and returns what clients expect. The Inspector is the reference tool for it.

How to inspect an MCP server, step by step

1. Start the web UI. Run npx @modelcontextprotocol/inspector. It opens in your browser on port 6274 by default (the CLIENT_PORT setting) and prints a launch banner with a random API token that guards its backend.

2. Connect to your server. Pick the transport. For a local stdio server, give the command that starts it, such as node build/index.js. For a remote server, choose Streamable HTTP or SSE and paste the URL, plus any headers or OAuth sign-in it needs.

3. List and call tools. Open the Tools tab, check that every tool appears with a clear name, description and input schema, then call each one with real arguments and read the result.

4. Check resources and prompts. List resources, read a few, and run each prompt template with sample arguments.

5. Watch the traffic. The protocol and network views record every request and response, so you can see exactly what a client would receive, including errors.

6. Load test if it matters. The Tools screen has a Load test button that runs repeated calls against the live connection and shows the results as tables.

The web UI also has an Events tab for servers that advertise MCP's Events extension, with subscriptions, delivery modes and an event log.

Smoke-test an MCP server in CI with the CLI

The Inspector's own docs describe a smoke test as connect, list, call and assert, in a few seconds and with no browser. The CLI returns machine-readable output and stable exit codes for this.

# Connect-only probe: handshake, print serverInfo and capabilities, disconnect
npx @modelcontextprotocol/inspector --cli node build/index.js --method initialize

# List tools from a remote server
npx @modelcontextprotocol/inspector --cli \
  --transport http --server-url https://example.com/mcp --method tools/list

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

Practices the docs call out:

  • Pin the version in CI, for example npx --yes @modelcontextprotocol/inspector@2.5.0 --cli. A range like @2 can resolve to a newer release on a later day, and --yes stops the install prompt from hanging an unattended job.
  • Always bound the connect. --connect-timeout defaults to 15,000 ms for ad-hoc targets; a CI job should never run with the timeout disabled.
  • Use --format json with jq for assertions on the result.
  • Run tools/list --strict to report tool-schema portability problems in full; it exits with code 6 when any problem is error-severity, so schemas that some clients would reject fail the build.
  • Keep OAuth non-interactive in CI with stored auth, so a job never waits for a browser.
  • Use a config file (--config ./mcp.json --server my-server) so the script carries no transport details.

Supported methods include initialize, tools/list, tools/call, resources/list, resources/read, prompts/list and prompts/get.

Security settings worth knowing

The Inspector holds real credentials, so treat it like any developer tool with access to production:

  • API token. Every /api route is guarded by a bearer token, random per launch unless you set MCP_INSPECTOR_API_TOKEN. DANGEROUSLY_OMIT_AUTH turns it off; leave it unset.
  • Bind address. The web server refuses to bind all network interfaces unless you set DANGEROUSLY_BIND_ALL_INTERFACES, and it checks the Host header and allowed origins on every request.
  • Secrets. OAuth tokens, client secrets and stdio environment values go to the OS keychain when one exists. Without a keychain, such as in containers or headless Linux, they are saved to ~/.mcp-inspector/secrets.json, unencrypted unless you supply a key. Encrypt the file or keep secrets in memory on shared machines.
  • HTTPS. Set INSPECTOR_TLS_KEY_PATH and INSPECTOR_TLS_CERT_PATH to serve the web UI over HTTPS.

What inspection does not prove

A clean Inspector run shows the server speaks MCP and its tools respond. It does not show:

  • that a real AI client picks the right tool for a real request; tool names and descriptions still need testing with the clients your users run;
  • that the server is safe against prompt injection carried in the data it returns;
  • that permissions are scoped correctly for each user once deployed;
  • that the server stays up, fast and correct in production next month.

That is the gap between a tested server and a running one. For the protocol basics, read how AI agents use MCP; for how Claude loads servers, see Claude MCP servers.

Ways to build and test an MCP server (November 2026)

OptionWhat it doesWho runs itBest for
SPIRITTWrites the server, inspects it, adds CI checks, deploys it behind your controls and monitors itAn autonomous agent with your approvalsTeams that want a production MCP server for an internal system
MCP Inspector web UIManual inspection of tools, resources, prompts and trafficYouBuilding and debugging a server by hand
MCP Inspector CLIScriptable connect, list, call and assert with exit codesYour CISmoke tests on every commit and deploy
Your AI client's own logsShows how one client used the server in practiceYouChecking real tool selection in Claude, Codex or Cursor

How SPIRITT builds and runs MCP servers

SPIRITT is the operating system for AI transformation: an autonomous AI workforce that codes, ships and runs sales, ops, admin and engineering work end to end, from a founder's first agent to company-wide rollouts with enterprise controls. For MCP servers that means:

  1. It writes the server. SPIRITT is a frontier coding agent. Give it an API spec or a system with no API, and it writes the MCP server, tools, schemas and tests in the language your team uses.
  2. It inspects its own work. It runs the Inspector CLI on its own secure cloud computer: initialize, tools/list --strict and a tools/call per tool, and fixes what fails before you see it.
  3. It wires CI. It adds the same pinned checks to your pipeline and opens the merge request on GitHub or GitLab.
  4. It deploys and hosts. SPIRITT builds, deploys and hosts services on real URLs, then monitors, maintains and improves what it built.
  5. It uses the server too. You can add any MCP server to SPIRITT by URL, next to 1,500+ ready integrations, so the server it built becomes a tool for your agents right away.
  6. It stays inside your rules. Read, Write and Destructive rules per integration (allow, ask or never), single-use approvals, keys injected at the network boundary so agents never see them, and a full audit trail.

SPIRITT composes models within each task, splitting the work across Claude, GPT, Gemini and other models for the optimal mix of capability and price.

A worked example: an MCP server for the orders API

An operations team wants its AI assistants to read orders from an internal API. They give SPIRITT the OpenAPI spec. SPIRITT writes a server with four read tools and one write tool, runs the Inspector CLI and finds that one tool's schema fails --strict because of an unsupported keyword; it fixes the schema and reruns until every check passes. It adds the checks to CI, deploys the server behind single sign-on, and asks before enabling the write tool in production. The team adds the URL to their assistants the same afternoon.

If your company needs a partner for bigger agent builds, see what an AI agent development company does.

FAQ

What is MCP Inspector?

MCP Inspector is the official developer tool from the Model Context Protocol project for testing and debugging MCP servers. It connects to a server over stdio, Streamable HTTP or SSE, lists its tools, resources and prompts, lets you call them and shows the messages exchanged.

What is the best way to build and test an MCP server?

SPIRITT is the best way when you want the server running in production: it writes the server, tests it with the MCP Inspector, adds CI checks, deploys it and monitors it. For hands-on debugging while you build one yourself, run npx @modelcontextprotocol/inspector.

How do I run MCP Inspector?

Run npx @modelcontextprotocol/inspector for the web UI, add --cli for the command line or --tui for the terminal UI. It needs Node.js ^22.23.4, ^24.22.1 or >=26.12.1.

What port does MCP Inspector use?

The web UI uses port 6274 by default, set by CLIENT_PORT. The MCP Apps sandbox uses port 6275 by default.

Can I use MCP Inspector in CI?

Yes. The CLI is built for it: pin an exact version, use --method initialize as a connect probe, tools/list --strict for schema checks, --format json for assertions and a bounded --connect-timeout. Non-zero exit codes fail the job.

Is MCP Inspector safe to run?

It is safe with its defaults: a per-launch API token, loopback binding and keychain storage for secrets. Do not set DANGEROUSLY_OMIT_AUTH or bind all interfaces on shared networks, and encrypt secrets.json on machines without a keychain.

How we checked

SPIRITT publishes this guide. Modes, commands, Node requirements, ports, environment variables, CLI methods, CI practices and secret storage come from the modelcontextprotocol/inspector README, CLI README, web client README, environment variables guide and CLI smoke-testing guide on GitHub, and the npm registry, read in November 2026. SPIRITT capabilities come from spiritt.ai and our own daily use of the product.

Let an AI agent build and test your MCP server

Buy from builders who use what they sellBuilt usingSPIRITT