How to Test an MCP Server with MCP Inspector
Learn how to test an MCP server before production with MCP Inspector, including connections, tools, resources, prompts, authentication, schema errors, and a final checklist.

Kelis Shekhaliya
Founder

TL;DR
Use MCP Inspector to connect to the same local or remote endpoint your users will call, verify initialization and capabilities, exercise tools, resources, and prompts with valid and invalid inputs, and test API keys, Bearer tokens, and OAuth on both success and failure paths. Fix connection, authentication, and schema errors before production. Then repeat the most important workflow through the hosted environment and a realistic MCP client. A hosted Playground adds a useful product-level check: testing capabilities, upstream API credentials, and individual calls before sharing the endpoint.
What is MCP Inspector?
MCP Inspector is a developer tool for connecting to an MCP server and inspecting the protocol interaction. It gives you a graphical web client, a scriptable CLI, and a terminal UI so you can discover capabilities, call them with controlled inputs, inspect results, and troubleshoot failures before an AI client depends on the server.
The current Inspector package is launched with npx and provides three testing surfaces:
Surface | Best for | Typical use |
|---|---|---|
Web client | Interactive exploration | Inspect a server, fill in tool inputs, and review responses in a browser |
CLI client | Automation and CI | Run |
Terminal UI | Interactive terminal work | Test a server when a browser is unavailable or a terminal workflow is preferred |
The Inspector tests protocol behavior. It does not replace load testing, API contract tests, business-logic tests, security review, or production observability. A successful tools/list call proves that discovery works; it does not prove that every upstream API response is correct under load.
The current official documentation lists Node.js 22.19.0 or newer for the latest Inspector release. Check the MCP Inspector guide and the official Inspector documentation for the version and command details that apply when you run the test.
What should you test before production?
An MCP server is ready for a production trial only after you have tested the complete path, not just whether the process starts. Work through this sequence:
Connect to the exact local or remote server endpoint.
Complete initialization and confirm the negotiated transport and protocol behavior.
Inspect tools, resources, prompts, names, descriptions, and schemas.
Call safe capabilities with valid inputs.
Call them again with missing, invalid, boundary, and unauthorized inputs.
Test API keys, Bearer tokens, and OAuth using the same runtime path users will use.
Record and fix connection, authentication, schema, timeout, and upstream API errors.
Repeat the critical workflow through the hosted environment and a real MCP-compatible client.
This sequence catches a common failure pattern: a server appears healthy during startup, but the first real tool call fails because a required field, authentication header, resource URI, or upstream response shape was not tested.
How to connect MCP Inspector to an MCP server
Start by identifying the server transport. A local development server may be launched as a process over stdio. A hosted server normally exposes an HTTP-based MCP endpoint. The Inspector supports both patterns, but the command and failure modes are different.
Connect to a local server
For a locally developed Node server, the basic web command looks like this:
npx @modelcontextprotocol/inspector node path/to/server/index.js
The Inspector starts its local interface and prints a browser URL. Open that URL, select the server connection, and wait for initialization to complete. If the server needs its own arguments, environment variables, working directory, or package runner, use the command documented by that server rather than guessing.
Keep local test credentials outside source control. Use a test account or development API, redact tokens in terminal output, and do not copy a production secret into an example configuration just to make the first connection succeed.
Connect to a remote or hosted server
For a remote Streamable HTTP endpoint, pass the server URL and the HTTP transport explicitly:
npx @modelcontextprotocol/inspector \
--server-url https://mcp.example.com/mcp \
--transport http
The path matters. A base website URL, an API documentation URL, and an MCP endpoint are not interchangeable. Confirm the exact path, HTTPS certificate, DNS record, and expected transport before investigating tool schemas.
For a hosted server, the default 0mcp endpoint follows the pattern https://yourservername.0mcp.dev/mcp. Use the actual endpoint shown for the server and choose HTTP in Inspector because hosted servers currently use Streamable HTTP.
Connect through a configuration file
If you test the same server repeatedly, a configuration file can make the connection reproducible. Keep the file free of real secrets where possible, use environment variables or the Inspector's runtime settings, and distinguish a writable personal catalog from a read-only configuration supplied by a team.
After connecting, record:
the server URL or launch command;
the transport and protocol version used;
the Inspector version and Node.js version;
the server version or configuration version;
the test identity and environment; and
the time of the test.
That small record makes a later failure easier to compare with a working test.
Inspect tools, resources, and prompts
Do not begin by calling a complicated write operation. First inspect the capability surface and check whether the interface tells a client what it needs to know.
Check tools
For each tool, review:
the tool name and whether it is unique and action-oriented;
the description and when the tool should be used;
required and optional input properties;
types, formats, enums, defaults, and examples;
whether the result is structured and predictable; and
whether the description makes side effects clear.
Start with a safe read tool. Confirm that the generated input form matches the intended schema, then call the tool with a known test record. If the tool changes state, use a disposable record or a test environment and verify the state change independently in the original API.
Common tool problems include a missing required field, a parameter that is presented as a string but consumed as an integer, a vague description that makes similar tools indistinguishable, and a success response that hides an upstream error. An MCP tool can be discoverable and still be unusable if its schema does not match the handler.
Check resources
Resources are read-oriented MCP capabilities identified by a URI or URI template. Test that the server can:
list the resources it advertises;
read a known valid URI;
resolve a valid URI template when parameters are required;
reject an invalid or unauthorized URI safely; and
return the expected content type and useful content.
Check empty results, missing records, large responses, and tenant boundaries. A resource that is visible in discovery must still enforce the same access rules as the underlying API or data source.
Check prompts
Prompts are reusable message templates or instructions that an MCP client can request. Test that the prompt list is complete, required arguments are clear, optional arguments behave as documented, and the rendered result contains the intended context without secrets or internal debugging data.
If a prompt refers to a tool or resource, test the whole chain. A prompt may render successfully while pointing to a renamed tool, an unavailable resource, or an argument that no longer matches the current server configuration.
Test valid and invalid inputs
Use a test matrix rather than a single successful example. The goal is to confirm that the server accepts the right requests, rejects the wrong ones, and returns errors a person can act on.
Input case | What to send | What a good result looks like |
|---|---|---|
Valid minimum | Only required fields with valid values | The call succeeds and the result matches the documented shape |
Valid complete | Required fields plus optional filters or limits | Optional behavior is applied without changing unrelated defaults |
Missing required field | Omit one required property | Validation fails clearly before an unsafe upstream request |
Wrong type | Use a string for a number or an object for a scalar | The server rejects the input or returns a documented validation error |
Invalid enum or format | Use an unsupported status, date, identifier, or URI | The error identifies the invalid value without leaking secrets |
Boundary value | Test zero, one, maximum page size, long text, and Unicode | Limits are enforced consistently and responses remain usable |
Null or empty value | Send | The behavior is explicit rather than silently changing meaning |
Unknown property | Add a field not in the schema | The server rejects or safely ignores it according to its contract |
No-result request | Use a valid query with no matching record | The client receives a clear empty result, not a false success |
Repeat or side-effect request | Retry a create or update in a test environment | Idempotency, duplicate handling, or confirmation behavior is understood |
Test both the MCP input schema and the upstream API validation. The MCP layer may reject a value before the API sees it, while the API may reject a value that passes the MCP schema. Both behaviors need useful error messages and safe handling.
Test API keys, Bearer tokens, and OAuth
Authentication testing has two boundaries. First, confirm that the MCP client can connect to the MCP endpoint. Then confirm that the credential used for the tool call is accepted by the original API and has the right scope.
API keys
Use a test API key with the smallest useful permission set. Depending on the Inspector client and API, provide the header through client settings or a runtime header such as:
npx @modelcontextprotocol/inspector --cli \
--server-url https://mcp.example.com/mcp \
--transport http \
--header "X-API-Key: <test-api-key>" \
--method tools/list
The header name is API-specific. Test a valid key, missing key, incorrect key, revoked key, and a key that is valid but lacks access to the selected operation. Do not commit <test-api-key> with a real value or place the secret in a tool argument.
Bearer tokens
Bearer tokens are commonly sent in the Authorization header:
Authorization: Bearer <test-access-token>
Test a valid token, an expired token, a token with the wrong audience, a token with insufficient scope, and a token for the wrong tenant or user. A token can be authentic and still be unauthorized for a tool call. Confirm that the error is handled without returning the token or the full authorization header.
OAuth
If the MCP server or upstream API uses OAuth, test the complete authorization flow rather than pasting a long-lived token once. Verify consent or sign-in, redirect handling, scope selection, access-token expiry, refresh or reauthorization, and revocation.
The current Inspector provides an OAuth flow for supported servers and stores local OAuth state so a session can be reused. Treat that state and any client configuration as sensitive. Use the Inspector authorization settings and the server's own documentation; do not put client secrets or refresh tokens in a repository file.
For an API-backed server using runtime pass-through, existing API authentication continues to be used. The MCP client supplies the runtime API key, Bearer token, or OAuth credential, and the request is passed to the original API. A successful MCP connection is therefore not enough: make a real authenticated tool call and verify the original API's tenant, role, scope, and record authorization.
How to find connection, authentication, and schema errors
Classify the failure before changing configuration. Different layers produce similar-looking errors, but the fix is usually different.
Error class | Typical symptom | Checks to perform |
|---|---|---|
Connection | The Inspector cannot initialize or the server is unreachable | Verify URL, |
Initialization | The connection opens but capability discovery never completes | Check protocol negotiation, server logs, timeouts, and whether the endpoint is an MCP endpoint rather than an ordinary API route |
Authentication | The connection or tool call returns | Check the credential source, header spelling, expiry, issuer, audience, scopes, and whether the correct auth layer is being tested |
Authorization | The request authenticates but returns | Check role, scope, tenant, record, field, and action permissions in the original API |
Schema | Tools, resources, or prompts do not appear or cannot be called | Inspect names, required fields, JSON Schema types, URI templates, prompt arguments, and import warnings |
Execution | Discovery works but a call times out or returns a 4xx/5xx | Reproduce the upstream API request, check rate limits and pagination, and inspect the mapped error response |
For a missing capability, first confirm that the server actually published the current configuration. Then compare the imported definition, selected operations, and generated capability names. If the definition contains invalid or incomplete schemas, fix the original API specification and republish the version rather than trying to hide the error in the client.
The MCP connection troubleshooting guide and tool discovery troubleshooting guide help isolate the first two layers. For broader failure handling, see the error-handling and debugging guide.
How a hosted Playground fits into testing
For teams using 0mcp, the Playground adds a hosted, product-level test after the protocol-level checks in Inspector. Import a supported OpenAPI, Swagger, or Postman definition, select the operations to expose, publish a server version, and use the Playground to inspect tools, call tools, test resources and prompts, verify authentication, and inspect individual usage logs.
The Playground documentation recommends having a published server version, an AI provider API key when required, and any upstream API credentials needed by the server. That makes the Playground useful for checking the real API-to-MCP path, not just whether a local process responds to tools/list.
Use both tools for different jobs:
MCP Inspector | Hosted Playground |
|---|---|
Protocol-level inspection of local or remote servers | Hosted-server workflow testing |
Direct discovery and controlled method calls | Testing tools, resources, prompts, and authentication in the product environment |
CLI smoke tests that can fit into CI | Interactive validation before connecting an AI client |
Useful for low-level connection and schema debugging | Useful for checking a published configuration and individual call behavior |
When the capability set and test plan are ready, the API-to-MCP page explains the hosted workflow for turning a supported API definition into a focused MCP server.
What MCP Inspector does not prove
Passing Inspector tests is an important release gate, but it is not a complete production certification. Add separate tests for:
concurrent requests, throughput, latency, and rate-limit behavior;
upstream API availability, retries, timeouts, and pagination;
tenant isolation, role changes, field-level access, and destructive actions;
credential rotation, revocation, expiry, and OAuth reauthorization;
sensitive data exposure in logs, errors, traces, prompts, and tool results;
configuration versioning and rollback; and
the behavior of the actual MCP clients your customers use.
Keep a small repeatable Inspector smoke suite for every server update. Then use the hosted Playground and a representative client for the user workflow. Testing once after generation is not enough if the API definition, selected operations, authentication configuration, or capability descriptions change.
Conclusion
Testing an MCP server means checking the whole path: connection, initialization, capability discovery, schemas, valid and invalid inputs, credentials, authorization, upstream errors, and the user workflow. MCP Inspector gives teams a repeatable way to inspect local or remote servers, while a hosted Playground can validate the published configuration and real API connection.
Run the checklist after every meaningful API, capability, authentication, or configuration change. A server should not be considered production-ready because it starts; it should be ready because its expected behavior and failure modes have been exercised and understood.
FAQ
01What is MCP Inspector used for?+-
MCP Inspector is a developer tool for connecting to an MCP server, discovering its tools, resources, and prompts, calling capabilities with controlled inputs, and debugging connection, authentication, schema, and execution errors. It is useful before production but does not replace load or security testing.
02Can MCP Inspector test a remote or hosted MCP server?+-
Yes. Use the server's exact remote endpoint and the transport it supports. For a Streamable HTTP server, connect with the server URL and HTTP transport, then test discovery and calls against the same endpoint a production client will use. Hosted servers currently use Streamable HTTP.
03Can I test API keys, Bearer tokens, and OAuth with MCP Inspector?+-
Yes, when the server and Inspector client support the relevant authentication flow. Test runtime API-key and Bearer headers without committing real secrets, and use the OAuth authorization flow for consent, scopes, expiry, reauthorization, and revocation. Confirm the credential also authorizes the original API call.
04How do I troubleshoot an MCP Inspector schema error?+-
First determine whether the failure is during capability discovery or during a call. Then check tool names, required properties, JSON Schema types, enum values, resource URIs, prompt arguments, and the current published server version. Fix the source schema or configuration, republish, and run the same Inspector test again.
05Is the 0mcp Playground the same as MCP Inspector?+-
No. Inspector is a general developer tool for protocol-level testing of local or remote MCP servers. The 0mcp Playground is a hosted workflow for testing a published server, its tools, resources, prompts, authentication, and individual calls before connecting an AI client. They complement each other.