🔍 MCP Inspector is a powerful web-based debugging and inspection tool for MCP (Model Context Protocol) servers. It provides a beautiful, intuitive interface for testing tools, exploring resources, managing prompts, and monitoring server connections - all from your browser. Think of it as Swagger UI for MCP servers, but better!
| Package | Description | Version |
|---|---|---|
| mcp-use | Core MCP framework | |
| @mcp-use/cli | Build tool for MCP apps | |
| create-mcp-use-app | Create MCP apps |
| Feature | Description |
|---|---|
| 🚀 Auto-Mount | Automatically available at /inspector for all MCP-Use servers |
| 🔌 Multi-Connection | Connect to and manage multiple MCP servers simultaneously |
| 🎯 Interactive Testing | Test tools with live execution and real-time results |
| 📊 Real-time Status | Monitor connection states, errors, and server health |
| 🔐 OAuth Support | Built-in OAuth flow handling with popup authentication |
| 💾 Persistent Sessions | Connections saved to localStorage and auto-reconnect |
| 🎨 Beautiful UI | Modern, responsive interface built with React and Tailwind |
| 🔍 Tool Explorer | Browse and execute all available tools with schema validation |
| 📁 Resource Browser | View and copy resource URIs with syntax highlighting |
| 💬 Prompt Manager | Test and manage prompts with argument templates |
| 🌐 Universal Support | Works with HTTP/SSE and WebSocket connections |
When you create an MCP server with mcp-use, the inspector is automatically available:
import { createMCPServer } from 'mcp-use/server'
const server = createMCPServer('my-server', {
version: '1.0.0'
})
// Add your tools, resources, prompts...
server.listen(3000)
// 🎉 Inspector automatically available at http://localhost:3000/inspector
// 🚀 Auto-connects to your local server at http://localhost:3000/mcpThat's it! No additional configuration needed. The inspector:
- Automatically mounts at
/inspector - Auto-connects to your local MCP server
- Provides instant debugging capabilities
- Opens automatically in dev mode with
@mcp-use/cli
Use the inspector with any MCP server (local or remote):
# Inspect a remote server
npx mcp-inspect --url https://mcp.linear.app/sse
# Custom port
npx mcp-inspect --url http://localhost:3000/mcp --port 8080
# Open inspector without auto-connect
npx mcp-inspectMount the inspector in your Express app at a custom path:
import { mountInspector } from '@mcp-use/inspector'
import express from 'express'
const app = express()
// Mount at custom path
mountInspector(app, '/debug/inspector')
app.listen(3000)
// Inspector available at http://localhost:3000/debug/inspectorThe main dashboard shows:
- Connection Overview: Total servers, active connections, available tools
- Server List: All configured servers with their current status
- Quick Actions: Add new server, refresh all, clear sessions
Click "Add New MCP Server" and provide:
- Server Name (optional): Friendly name for identification
- Server URL: The MCP endpoint URL
Example URLs:
- Local:
http://localhost:3000/mcp - Linear:
https://mcp.linear.app/sse - WebSocket:
ws://localhost:8080
The inspector displays real-time connection states:
| State | Description | Action |
|---|---|---|
| 🔍 discovering | Finding the server | Wait |
| 🔄 connecting | Establishing connection | Wait |
| 🔐 authenticating | OAuth flow in progress | Complete auth |
| 📥 loading | Loading tools & resources | Wait |
| ✅ ready | Connected and operational | Use tools |
| ❌ failed | Connection failed | Retry |
| ⏳ pending_auth | Waiting for authentication | Click Authenticate |
- Click "Inspect" on a connected server
- Navigate to the Tools tab
- Select a tool to view its schema
- Click "Execute" to open the test panel
- Enter JSON parameters
- Click "Run" to execute
- View results in real-time
Example tool execution:
// Input for 'search_database' tool
{
"query": "user analytics",
"limit": 10,
"sortBy": "date"
}
// Result
{
"results": [...],
"total": 42,
"executionTime": "23ms"
}For servers requiring OAuth (like Linear):
- Connection shows "pending_auth" status
- Click "Authenticate" button
- Complete OAuth in the popup window
- Connection automatically completes
If popup is blocked:
- Click "open auth page" link
- Complete authentication manually
- Return to inspector
Browse available resources:
- View resource descriptions
- Copy resource URIs
- Check MIME types
- Preview resource metadata
Test prompts with the inspector:
- Navigate to Prompts tab
- Select a prompt
- Fill in required arguments
- Click "Render" to see output
- Copy rendered prompt for use
Each server displays:
- Connection status indicator
- Server name and URL
- Available tools count
- Last connection time
- Action buttons (Connect/Disconnect/Inspect/Remove)
The tool explorer shows:
- Tool name and description
- Input schema with types
- Output schema
- Execution panel
- Response viewer with syntax highlighting
Interactive chat for testing conversational flows:
- Send messages to test prompts
- View tool calls in real-time
- See formatted responses
- Copy conversation history
Manage multiple servers efficiently:
// Select multiple servers
// Click "Bulk Actions"
// Choose: Connect All, Disconnect All, Remove SelectedSessions are automatically saved to localStorage:
- Preserves server configurations
- Maintains connection preferences
- Restores on page reload
- Clear with "Clear All Sessions"
The inspector respects system theme preferences:
- Light mode for better readability
- Dark mode for reduced eye strain
- Automatic switching based on OS settings
| Shortcut | Action |
|---|---|
Cmd/Ctrl + K |
Quick server search |
Cmd/Ctrl + N |
Add new server |
Cmd/Ctrl + R |
Refresh all connections |
Esc |
Close modals |
// Your MCP server
import { createMCPServer } from 'mcp-use/server'
const server = createMCPServer('dev-server', {
version: '1.0.0',
description: 'Development MCP Server'
})
server.tool('debug_tool', {
description: 'Debug tool for testing',
parameters: z.object({
message: z.string()
}),
execute: async ({ message }) => {
console.log('Debug:', message)
return { received: message, timestamp: Date.now() }
}
})
server.listen(3000)
// Inspector at http://localhost:3000/inspectorconst server = createMCPServer('production-server', {
version: '1.0.0',
oauth: {
clientId: process.env.OAUTH_CLIENT_ID,
clientSecret: process.env.OAUTH_CLIENT_SECRET,
authorizationUrl: 'https://api.example.com/oauth/authorize',
tokenUrl: 'https://api.example.com/oauth/token'
}
})
// Inspector handles OAuth flow automaticallyIn the inspector, manage multiple servers:
// Add servers via UI
// Server 1: Local Development
URL: http://localhost:3000/mcp
// Server 2: Staging
URL: https://staging.example.com/mcp
// Server 3: Production
URL: https://api.example.com/mcpThe inspector is built with modern web technologies:
- React 19: UI framework
- React Router: Navigation
- Tailwind CSS: Styling
- shadcn/ui: Component library
- Framer Motion: Animations
- React Syntax Highlighter: Code display
src/client/
├── components/
│ ├── InspectorDashboard.tsx # Main dashboard view
│ ├── ServerList.tsx # Server management
│ ├── ServerDetail.tsx # Individual server view
│ ├── ToolExecutor.tsx # Tool testing interface
│ ├── ResourceBrowser.tsx # Resource explorer
│ └── ChatInterface.tsx # Interactive chat
├── context/
│ └── McpContext.tsx # Connection state management
└── hooks/
└── useMcp.ts # MCP connection hook
The useMcp hook handles:
- WebSocket/SSE connections
- Automatic reconnection
- OAuth flow management
- Error recovery
- State synchronization
Inspector not loading:
# Check server is running
curl http://localhost:3000/inspector
# Verify no conflicting routes
# Ensure inspector is mounted correctlyConnection fails immediately:
- Check CORS configuration
- Verify server URL is correct
- Ensure server supports SSE/WebSocket
- Check network/firewall settings
OAuth popup blocked:
- Allow popups for the inspector domain
- Use the manual auth link provided
- Check browser console for errors
Tools not executing:
- Verify tool schemas are valid
- Check server logs for errors
- Ensure proper authentication
- Validate input parameters
Session not persisting:
- Check localStorage is enabled
- Clear browser cache
- Try incognito/private mode
- Check for browser extensions blocking storage
// Use pagination for many tools
server.configurePagination({
toolsPerPage: 50,
enableSearch: true
})// Configure connection pooling
const inspector = {
maxConnections: 5,
connectionTimeout: 30000,
keepAlive: true
}// Cache tool results
server.enableCache({
ttl: 300, // 5 minutes
maxSize: 100 // MB
})// Configure CORS for inspector access
server.configureCORS({
origin: ['http://localhost:3000'],
credentials: true
})// Add authentication middleware
server.use(authMiddleware)// Prevent abuse
server.configureRateLimit({
windowMs: 60000, // 1 minute
max: 100 // requests
})// Mount inspector
mountInspector(app: Express, path?: string): void
// Standalone server
startInspectorServer(port: number): void
// Configuration
configureInspector(options: InspectorOptions): voidinterface InspectorOptions {
autoConnect?: boolean // Auto-connect to local server
theme?: 'light' | 'dark' | 'auto'
persistence?: boolean // Save sessions
maxConnections?: number
connectionTimeout?: number
}We welcome contributions! Areas for improvement:
- Additional UI themes
- More keyboard shortcuts
- Enhanced tool testing features
- Performance optimizations
- Localization support
See our contributing guide for details.
MIT © MCP-Use