The MCP Inspector is now automatically mounted at /inspector for all MCP servers created with createMCPServer, similar to how FastAPI provides automatic Swagger documentation at /docs.
- New Middleware Function: Created
mountInspector()function that can mount the inspector UI on any Express app - Package Configuration:
- Added
mainandexportsfields to make it importable - Added Express as a peer dependency
- Built server components are available in
dist/server/
- Added
- Automatic Mounting: Modified
createMCPServer()to automatically mount the inspector at/inspector - Optional Dependency: Added
@mcp-use/inspectoras an optional peer dependency - Graceful Degradation: Server works fine if inspector package is not installed
- Automatic Setup: All new projects created with
create-mcp-use-appinclude@mcp-use/inspectoras a dependency - No Manual Configuration: Developers don't need to manually call
mountInspector()anymore - Console Message: Server startup logs include the inspector URL
When developers create a new MCP server:
import { createMCPServer } from 'mcp-use/server'
const server = createMCPServer('my-server', {
version: '1.0.0',
description: 'My awesome MCP server'
})
// Define tools, resources, prompts...
server.listen(3000)
// Inspector automatically available at http://localhost:3000/inspector-
Install the inspector package:
pnpm add @mcp-use/inspector
-
Build the inspector:
cd packages/inspector && pnpm build
-
The inspector will automatically be available at
/inspectorwhen you start your server
If you need custom mounting:
import { mountInspector } from '@mcp-use/inspector'
// Mount at custom path
mountInspector(server, '/my-custom-path')- When
createMCPServer()is called, it attempts to dynamically import@mcp-use/inspector - If the package is installed,
mountInspector()is called automatically with the Express app instance - The inspector middleware:
- Serves the built React UI from
dist/client/ - Handles static assets (JS, CSS)
- Serves the HTML for all inspector routes (client-side routing)
- Serves the built React UI from
For local development in the monorepo:
{
"dependencies": {
"@mcp-use/inspector": "workspace:*"
}
}For published packages:
{
"dependencies": {
"@mcp-use/inspector": "^0.1.0"
}
}- Zero Configuration: Works out of the box, just like FastAPI's
/docs - Developer Experience: Instant visual debugging and testing of MCP servers
- Optional: Doesn't break existing servers if inspector is not installed
- Consistent: All MCP servers have the same inspector experience
packages/inspector/src/server/middleware.ts- New middleware functionpackages/inspector/src/server/index.ts- Export mountInspectorpackages/inspector/package.json- Added exports and peer dependenciespackages/inspector/tsconfig.server.json- Fixed TypeScript configpackages/mcp-use/src/server/mcp-server.ts- Auto-mount inspectorpackages/mcp-use/package.json- Added inspector as optional peer dependencypackages/create-mcp-use-app/src/templates/ui/package.json- Added inspector dependencypackages/create-mcp-use-app/src/templates/ui/src/server.ts- Updated comments