use-mcp/examples/inspector
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-06-10 19:15:39 +10:00
..
public moving examples around 2025-06-10 16:21:50 +10:00
src Tool calling UI looking ok 2025-06-10 19:15:39 +10:00
.gitignore moving examples around 2025-06-10 16:21:50 +10:00
.prettierrc moving examples around 2025-06-10 16:21:50 +10:00
AGENT.md moving examples around 2025-06-10 16:21:50 +10:00
eslint.config.js moving examples around 2025-06-10 16:21:50 +10:00
index.html moving examples around 2025-06-10 16:21:50 +10:00
package.json Inspector looking good 2025-06-10 17:11:27 +10:00
pnpm-lock.yaml Inspector looking good 2025-06-10 17:11:27 +10:00
README.md Got AMP to rip out the guts of the chat ui to make an inspector 2025-06-10 16:43:06 +10:00
tailwind.config.js moving examples around 2025-06-10 16:21:50 +10:00
tsconfig.app.json moving examples around 2025-06-10 16:21:50 +10:00
tsconfig.json moving examples around 2025-06-10 16:21:50 +10:00
tsconfig.node.json moving examples around 2025-06-10 16:21:50 +10:00
tsconfig.worker.json moving examples around 2025-06-10 16:21:50 +10:00
vite.config.ts moving examples around 2025-06-10 16:21:50 +10:00
wrangler.jsonc Not sure what i am doing with this wrangler vite stuff 2025-06-10 17:28:38 +10:00

MCP Inspector

A minimal demo showcasing the use-mcp React hook for connecting to Model Context Protocol (MCP) servers.

Features

  • Connect to any MCP server via URL
  • View available tools and their schemas
  • Real-time connection status monitoring
  • Debug logging for troubleshooting
  • Clean, minimal UI focused on MCP functionality

Getting Started

  1. Install dependencies:

    pnpm install
    
  2. Start the development server:

    pnpm dev
    
  3. Open your browser and navigate to the displayed local URL

  4. Enter an MCP server URL to test the connection and explore available tools

What This Demonstrates

This example shows how easy it is to integrate MCP servers into a React application using the use-mcp hook. The core functionality is just:

import { useMcp } from 'use-mcp/react'

const connection = useMcp({
  url: 'your-mcp-server-url',
  debug: true,
  autoRetry: false
})

// Access connection.state, connection.tools, connection.error, etc.

The McpServers component wraps this hook to provide a complete UI for server management and tool inspection.