MCP Inspector Guide
The MCP Inspector is an interactive developer tool for testing and debugging MCP servers. It provides a web-based UI and a CLI for comprehensive testing workflows.
Architecture
Section titled “Architecture”The Inspector consists of two components:
- Inspector Client — React web UI (default port 6274) for interactive testing
- Inspector Proxy — Node.js server (default port 6277) that bridges the web UI to your MCP server
The proxy acts as both an MCP client (connecting to your server) and an HTTP server (serving the web UI), enabling browser-based interaction with MCP servers using different transport protocols.
Quick Start
Section titled “Quick Start”npm run buildnpx @modelcontextprotocol/inspector node dist/index.jsOpens a web UI at http://localhost:6274 with an authentication token pre-filled.
# List available toolsnpx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list
# Call a specific toolnpx @modelcontextprotocol/inspector --cli node dist/index.js \ --method tools/call \ --tool-name onlyoffice_list_templates
# Call tool with argumentsnpx @modelcontextprotocol/inspector --cli node dist/index.js \ --method tools/call \ --tool-name onlyoffice_validate_data \ --tool-arg template=stellenbeschreibung \ --tool-arg 'data={"Positionstitel":"Test"}'Transport Types
Section titled “Transport Types”| Transport | Use Case | Flag |
|---|---|---|
| STDIO | Local processes (default) | --transport stdio |
| SSE | Remote servers via Server-Sent Events | --transport sse |
| Streamable HTTP | Remote servers via HTTP POST | --transport http |
For remote testing:
# Streamable HTTP transportnpx @modelcontextprotocol/inspector --cli https://onlyoffice.localhost --transport httpTesting Workflow
Section titled “Testing Workflow”-
Connect to the server
In UI mode, the command (
node) and arguments (dist/index.js) are pre-filled. Click Connect. Verify the status shows “Connected” with the server version. -
List available tools
Click the Tools tab, then List Tools. Verify 26 tools are listed (21 if
CREDENTIAL_MASTER_PASSWORDis not set). -
Test
onlyoffice_list_templatesSelect
onlyoffice_list_templates, leave parameters empty, click Run Tool. Verify the response includes 5 generic templates with metadata. -
Test
onlyoffice_validate_dataSelect
onlyoffice_validate_data, enter:template:stellenbeschreibungdata:{"Positionstitel":"Software Engineer","Fachbereich":"IT"}
Run the tool. The response should show
valid: falsewith missing required fields listed. -
Test
onlyoffice_generate_documentRequires the OnlyOffice Docker container running:
Terminal window docker compose -f docker/docker-compose.yml up -dSelect
onlyoffice_generate_document, enter:template:stellenbeschreibungformat:docxdata: Full valid JSON with all required fields
Run the tool. Verify the response contains the generated document artifact.
Configuration
Section titled “Configuration”Environment Variables
Section titled “Environment Variables”Pass environment variables to your MCP server using -e:
npx @modelcontextprotocol/inspector -e ONLYOFFICE_JWT_SECRET=secret -e ADMIN_PASSWORD=test node dist/index.jsCustom Ports
Section titled “Custom Ports”CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node dist/index.jsSettings
Section titled “Settings”| Setting | Default | Description |
|---|---|---|
MCP_SERVER_REQUEST_TIMEOUT |
300000 | Request timeout (ms) |
MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS |
true | Reset timeout on progress |
MCP_REQUEST_MAX_TOTAL_TIMEOUT |
60000 | Maximum total timeout (ms) |
MCP_AUTO_OPEN_ENABLED |
true | Auto-open browser |
Testing Strategy
Section titled “Testing Strategy”| Test Type | Approach |
|---|---|
| Happy Path | Valid inputs, expected outputs |
| Edge Cases | Empty arrays, special characters, boundary values |
| Error Handling | Invalid template IDs, missing required fields |
| Performance | Large payloads, batch generation |
CLI Edge Case Testing
Section titled “CLI Edge Case Testing”# Test with invalid templatenpx @modelcontextprotocol/inspector --cli node dist/index.js \ --method tools/call \ --tool-name onlyoffice_validate_data \ --tool-arg template=nonexistent \ --tool-arg 'data={}'
# Test with missing required fieldsnpx @modelcontextprotocol/inspector --cli node dist/index.js \ --method tools/call \ --tool-name onlyoffice_validate_data \ --tool-arg template=stellenbeschreibung \ --tool-arg 'data={"Positionstitel":"Only one field"}'Related
Section titled “Related”- Installation — Set up the server
- Tools Reference — All 26 MCP tools
- API Overview — Tool categories and protocol details