Skip to content

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.

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.

Terminal window
npm run build
npx @modelcontextprotocol/inspector node dist/index.js

Opens a web UI at http://localhost:6274 with an authentication token pre-filled.

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:

Terminal window
# Streamable HTTP transport
npx @modelcontextprotocol/inspector --cli https://onlyoffice.localhost --transport http
  1. 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.

  2. List available tools

    Click the Tools tab, then List Tools. Verify 26 tools are listed (21 if CREDENTIAL_MASTER_PASSWORD is not set).

  3. Test onlyoffice_list_templates

    Select onlyoffice_list_templates, leave parameters empty, click Run Tool. Verify the response includes 5 generic templates with metadata.

  4. Test onlyoffice_validate_data

    Select onlyoffice_validate_data, enter:

    • template: stellenbeschreibung
    • data: {"Positionstitel":"Software Engineer","Fachbereich":"IT"}

    Run the tool. The response should show valid: false with missing required fields listed.

  5. Test onlyoffice_generate_document

    Requires the OnlyOffice Docker container running:

    Terminal window
    docker compose -f docker/docker-compose.yml up -d

    Select onlyoffice_generate_document, enter:

    • template: stellenbeschreibung
    • format: docx
    • data: Full valid JSON with all required fields

    Run the tool. Verify the response contains the generated document artifact.

Pass environment variables to your MCP server using -e:

Terminal window
npx @modelcontextprotocol/inspector -e ONLYOFFICE_JWT_SECRET=secret -e ADMIN_PASSWORD=test node dist/index.js
Terminal window
CLIENT_PORT=8080 SERVER_PORT=9000 npx @modelcontextprotocol/inspector node dist/index.js
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
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
Terminal window
# Test with invalid template
npx @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 fields
npx @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"}'