Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Latest commit

 

History

History
64 lines (45 loc) · 2.02 KB

File metadata and controls

64 lines (45 loc) · 2.02 KB

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
  • Browse and read server resources
  • Interact with server-provided prompts
  • Real-time connection status monitoring
  • Debug logging for troubleshooting
  • Clean, minimal UI focused on MCP functionality

Getting Started

  1. Make sure you've built the parent use-mcp directory at least once!
cd ../.. && pnpm build && cd -

Alternatively, run pnpm dev in the parent directory in a second terminal if you want to iterate on both the library and the example together.

  1. Install dependencies:
pnpm install
  1. Start the development server:
pnpm dev
  1. Open your browser and navigate to the displayed local URL

  2. Enter an MCP server URL to test the connection and explore available tools, resources, and prompts

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.resources, 
// connection.prompts, connection.error, etc.

The McpServers component wraps this hook to provide a complete UI for server management, tool inspection, resource browsing, and prompt interaction.

Supported MCP Features

  • Tools: Execute server-provided tools with custom arguments and view results
  • Resources: Browse available resources and read their contents (text or binary)
  • Resource Templates: View dynamic resource templates with URI patterns
  • Prompts: Interact with server prompts, provide arguments, and view generated messages

Note: Not all MCP servers implement all features. The inspector will gracefully handle servers that only support a subset of the MCP specification.