| layout | default |
|---|---|
| title | Chapter 3: UI Debugging Workflows: Tools, Resources, Prompts |
| nav_order | 3 |
| parent | MCP Inspector Tutorial |
Welcome to Chapter 3: UI Debugging Workflows: Tools, Resources, Prompts. In this part of MCP Inspector Tutorial: Debugging and Validating MCP Servers, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.
The UI is optimized for rapid exploratory debugging across tools, resources, prompts, sampling, and request history.
- validate capability discovery quickly after connecting
- run tool calls with structured argument payloads
- inspect response payloads and error output in a repeatable way
- export server entries for reuse in client config files
- run
tools/list, inspect parameter schemas - execute one low-risk tool call with explicit arguments
- run
resources/listand fetch a small resource payload - run
prompts/listand test one prompt path - export a Server Entry or full
mcp.jsonfor downstream clients
Use Inspector's "Server Entry" and "Servers File" export buttons to avoid manual config drift when moving from local debug to tools like Claude Code or Cursor.
- Inspector README - Servers File Export
- Inspector README - UI Mode vs CLI Mode
- Inspector Client Source Tree
You now have a practical, repeatable UI workflow for MCP server debugging.
Next: Chapter 4: CLI Mode, Automation, and CI Loops
The delay function in client/bin/start.js handles a key part of this chapter's functionality:
const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms, true));
}
function getClientUrl(port, authDisabled, sessionToken, serverPort) {
const host = process.env.HOST || "localhost";
const baseUrl = `http://${host}:${port}`;
const params = new URLSearchParams();
if (serverPort && serverPort !== DEFAULT_MCP_PROXY_LISTEN_PORT) {
params.set("MCP_PROXY_PORT", serverPort);
}
if (!authDisabled) {
params.set("MCP_PROXY_AUTH_TOKEN", sessionToken);
}
return params.size > 0 ? `${baseUrl}/?${params.toString()}` : baseUrl;
}
async function startDevServer(serverOptions) {
const {
SERVER_PORT,
CLIENT_PORT,
sessionToken,
envVars,
abort,
transport,
serverUrl,
} = serverOptions;
const serverCommand = "npx";
const serverArgs = ["tsx", "watch", "--clear-screen=false", "src/index.ts"];This function is important because it defines how MCP Inspector Tutorial: Debugging and Validating MCP Servers implements the patterns covered in this chapter.
The getClientUrl function in client/bin/start.js handles a key part of this chapter's functionality:
}
function getClientUrl(port, authDisabled, sessionToken, serverPort) {
const host = process.env.HOST || "localhost";
const baseUrl = `http://${host}:${port}`;
const params = new URLSearchParams();
if (serverPort && serverPort !== DEFAULT_MCP_PROXY_LISTEN_PORT) {
params.set("MCP_PROXY_PORT", serverPort);
}
if (!authDisabled) {
params.set("MCP_PROXY_AUTH_TOKEN", sessionToken);
}
return params.size > 0 ? `${baseUrl}/?${params.toString()}` : baseUrl;
}
async function startDevServer(serverOptions) {
const {
SERVER_PORT,
CLIENT_PORT,
sessionToken,
envVars,
abort,
transport,
serverUrl,
} = serverOptions;
const serverCommand = "npx";
const serverArgs = ["tsx", "watch", "--clear-screen=false", "src/index.ts"];
const isWindows = process.platform === "win32";
const spawnOptions = {
cwd: resolve(__dirname, "../..", "server"),This function is important because it defines how MCP Inspector Tutorial: Debugging and Validating MCP Servers implements the patterns covered in this chapter.
The startDevServer function in client/bin/start.js handles a key part of this chapter's functionality:
}
async function startDevServer(serverOptions) {
const {
SERVER_PORT,
CLIENT_PORT,
sessionToken,
envVars,
abort,
transport,
serverUrl,
} = serverOptions;
const serverCommand = "npx";
const serverArgs = ["tsx", "watch", "--clear-screen=false", "src/index.ts"];
const isWindows = process.platform === "win32";
const spawnOptions = {
cwd: resolve(__dirname, "../..", "server"),
env: {
...process.env,
SERVER_PORT,
CLIENT_PORT,
MCP_PROXY_AUTH_TOKEN: sessionToken,
MCP_ENV_VARS: JSON.stringify(envVars),
...(transport ? { MCP_TRANSPORT: transport } : {}),
...(serverUrl ? { MCP_SERVER_URL: serverUrl } : {}),
},
signal: abort.signal,
echoOutput: true,
};
// For Windows, we need to ignore stdin to simulate < NULThis function is important because it defines how MCP Inspector Tutorial: Debugging and Validating MCP Servers implements the patterns covered in this chapter.
flowchart TD
A[delay]
B[getClientUrl]
C[startDevServer]
A --> B
B --> C