PAR MCP Inspector TUI
Project description
PAR MCP Inspector TUI
A comprehensive Terminal User Interface (TUI) application for inspecting and interacting with Model Context Protocol (MCP) servers. This tool provides an intuitive interface to connect to MCP servers, explore their capabilities, and execute tools, prompts, and resources in real-time.
Screenshots
The MCP Inspector TUI showing a connected "Everything" server with available tools (echo, add, printEnv), tool parameter forms, and real-time interaction logs. The interface displays server management on the left, tabbed content areas in the center, and notifications on the right.
Features
- Multiple Transport Support: Connect to MCP servers via STDIO and TCP
- CLI Debugging Tools: Connect to arbitrary servers and inspect interactions without configuration
- Resource Download CLI: Download resources by name with automatic file type detection
- Real-time Introspection: Discover tools, prompts, and resources from connected servers
- Dynamic Forms: Automatically generated forms based on server-provided schemas with real-time validation
- Form Validation: Smart execute button control - disabled until all required fields are filled
- Magic Number Detection: Automatic file type detection using magic numbers for binary resources
- Syntax Highlighting: Rich response formatting with support for JSON, Markdown, and code
- File Management: Save and open resources with proper file extensions and MIME type handling
- Server Management: Persistent configuration storage for multiple server connections
- Non-blocking Operations: Async communication ensuring responsive UI
- Server Notifications: Real-time notifications from MCP servers with auto-refresh capabilities
- Application Notifications: Real-time status updates and error handling
- Capability-aware: Gracefully handles servers with partial MCP implementation
Technology Stack
- Python 3.12+ - Modern Python with latest features
- Textual - Beautiful, responsive terminal user interfaces
- Pydantic - Data validation and serialization
- Rich - Terminal output formatting and syntax highlighting
- filetype - Magic number file type detection
- YAML - Configuration file format
- Asyncio - Asynchronous programming for responsive interfaces
Prerequisites
To install PAR MCP Inspector TUI, make sure you have Python 3.12+.
uv is recommended
Linux and Mac
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Installation
Installation From Source
-
Clone the repository:
git clone https://github.com/paulrobello/par-mcp-inspector-tui.git cd par-mcp-inspector-tui
-
Install the package dependencies using uv:
uv sync
Usage
CLI Commands Overview
# Show all available commands
uv run ptmi --help
# Show version information
uv run ptmi --version
# Launch the TUI application
uv run ptmi tui
# Launch TUI with debug mode
uv run ptmi tui --debug
# List configured servers
uv run ptmi servers
# Debug a configured server
uv run ptmi debug <server-id> --verbose
# Connect to arbitrary STDIO server
uv run ptmi connect npx --arg "-y" --arg "@modelcontextprotocol/server-filesystem" --arg "/tmp"
# Connect to arbitrary TCP server
uv run ptmi connect-tcp localhost 3333
# Download resources from servers
uv run ptmi download-resource <server-id> <resource-name>
TUI Application
# Start the MCP Inspector TUI
uv run ptmi tui
# Enable debug mode for troubleshooting
uv run ptmi tui --debug
Options:
--debug -d: Enable debug mode for detailed logging and troubleshooting
First Time Setup
- Launch the application:
uv run ptmi tui - Default servers: The application comes with example server configurations
- Add your servers: Use the "Add Server" button to configure your MCP servers
- Connect: Select a server from the list and click "Connect"
- Explore: Browse resources, prompts, and tools in the tabbed interface
Quick Testing without Configuration
Test any MCP server instantly without adding it to configuration:
# Test a filesystem server
uv run ptmi connect npx \
--arg "-y" \
--arg "@modelcontextprotocol/server-filesystem" \
--arg "/tmp" \
--name "My Test Server" \
--verbose
# Test with environment variables
uv run ptmi connect python \
--arg "my_server.py" \
--env "DEBUG=1" \
--env "DATABASE_URL=sqlite:///test.db"
# Test TCP server
uv run ptmi connect-tcp myhost.com 8080 --verbose
CLI Commands Reference
Global Options
--version -v: Show version and exit--help: Show help message and exit
tui - Launch TUI Application
uv run ptmi tui [OPTIONS]
Options:
--debug -d: Enable debug mode for detailed logging and troubleshooting
servers - List Configured Servers
uv run ptmi servers
Shows a formatted table of all configured MCP servers with their connection details and status.
debug - Debug Configured Server
uv run ptmi debug <server-id-or-name> [OPTIONS]
Arguments:
server-id-or-name: Server ID or name to debug (required)
Options:
--verbose -v: Verbose output with raw JSON--debug: Enable debug logging of MCP messages
Connect to a pre-configured server and test all MCP endpoints:
- Shows server information and capabilities
- Tests resources, tools, and prompts endpoints with enhanced display
- Enhanced Resource Display: Color-coded labels and ready-to-use download commands
- Displays detailed error information
- Use
--verbosefor raw JSON responses - Use
--debugfor detailed MCP message logging
Enhanced Resource Display Features:
- Resource Names: Clearly highlighted for use with
download-resourcecommand - Download Instructions: Exact command syntax for configured servers
- Color-Coded Output: Green names, cyan URIs, yellow descriptions, magenta MIME types
- Smart Guidance: Different messages for configured vs temporary servers
connect - Connect to Arbitrary STDIO Server
uv run ptmi connect <command> [OPTIONS]
Arguments:
command: Command to execute for STDIO transport (required)
Options:
--arg -a: Command arguments (can be specified multiple times)--env -e: Environment variables in KEY=VALUE format (can be specified multiple times)--verbose -v: Verbose output with raw JSON--debug: Enable debug logging of MCP messages--name -n: Server name for display (default: Ad-hoc Server)
Connect to an arbitrary STDIO server without adding it to configuration. Uses the same enhanced debug output as the debug command, including:
- Color-coded resource display with download guidance
- Smart messaging: Informs users to add server to configuration before downloading resources
- Full MCP testing: Resources, tools, and prompts endpoints
Examples:
# Basic usage
uv run ptmi connect npx -a "-y" -a "@modelcontextprotocol/server-filesystem" -a "/tmp"
# With environment variables and custom name
uv run ptmi connect python -a "server.py" -e "DEBUG=1" -e "PORT=8080" -n "My Server"
# Verbose output with debug logging
uv run ptmi connect node -a "server.js" --verbose --debug
connect-tcp - Connect to Arbitrary TCP Server
uv run ptmi connect-tcp [HOST] [PORT] [OPTIONS]
Arguments:
host: Host to connect to (default: localhost)port: Port to connect to (default: 3333)
Options:
--verbose -v: Verbose output with raw JSON--debug: Enable debug logging of MCP messages--name -n: Server name for display (default: TCP Server)
Connect to an arbitrary TCP server without adding it to configuration. Uses the same enhanced debug output as other debug commands, including:
- Enhanced resource listing with color-coded display
- Download guidance: Instructions to add server to configuration first
- Complete testing: All MCP endpoints (resources, tools, prompts)
Examples:
# Default host and port
uv run ptmi connect-tcp
# Custom host and port with verbose and debug output
uv run ptmi connect-tcp example.com 8080 -n "Remote Server" --verbose --debug
download-resource - Download Resources by Name
uv run ptmi download-resource <server-id-or-name> <resource-name> [OPTIONS]
Arguments:
server-id-or-name: Server ID or name to download from (required)resource-name: Resource name to download (required)
Options:
--output -o: Output directory (default: current directory)--filename -f: Custom filename (default: auto-detect from resource)--verbose -v: Verbose output with detailed information--debug: Enable debug logging of MCP messages
Features:
- Smart Resource Finding: Exact name match, case-insensitive fallback, and partial matching
- Automatic File Type Detection: Uses MIME types and magic number detection for proper extensions
- Custom Output: Specify output directory and custom filenames
- Error Handling: Clear error messages for missing servers/resources
Examples:
# Download resource with auto-detection
uv run ptmi download-resource Everything "Resource 1"
# Custom output directory
uv run ptmi download-resource filesystem-server "config.json" --output ~/Downloads
# Custom filename with verbose output
uv run ptmi download-resource Everything "Resource 2" --filename my-file.txt --verbose
# Download binary resource (automatic type detection)
uv run ptmi download-resource image-server "logo.png" --output ./assets
Server Configuration
The TUI application stores server configurations in ~/.config/mcp-inspector/servers.yaml. Example configuration:
servers:
filesystem-server:
name: "Filesystem Server"
transport: "stdio"
command: "npx"
args:
- "-y"
- "@modelcontextprotocol/server-filesystem"
- "/tmp"
env:
NODE_ENV: "production"
toast_notifications: true # Show toast notifications (default: true)
custom-tcp-server:
name: "Custom TCP Server"
transport: "tcp"
host: "localhost"
port: 3333
toast_notifications: false # Disable toast notifications for this server
Configuration Options
- toast_notifications (boolean, default: true): Controls whether to show toast popup notifications when the server sends notifications. When
false, notifications are still added to the notifications tab but won't show as toast popups. Note: Toasts are automatically suppressed when viewing the notifications tab regardless of this setting.
UI Configuration
You can configure toast notifications through the TUI interface:
- Add Server Dialog: When adding a new server, check/uncheck "Show toast notifications from this server"
- Edit Server Dialog: Select any server and click "Edit Server" to modify the toast notification setting
- Per-Server Control: Each server has different notification settings
- Real-time Updates: Changes take effect immediately after saving
Supported Transport Types
STDIO Transport
For servers that communicate via standard input/output:
servers:
my-stdio-server:
name: "My STDIO Server"
transport: "stdio"
command: "python"
args:
- "server.py"
env:
DEBUG: "1"
TCP Transport
For servers running on a network port:
servers:
my-tcp-server:
name: "My TCP Server"
transport: "tcp"
host: "localhost"
port: 8080
User Interface
Main Layout
- Left Panel: Server list and connection status
- Center Panel: Tabbed interface with:
- Resources: Browse and read available resources
- Prompts: Execute prompts with dynamic argument forms and validation
- Tools: Call tools with smart parameter validation and form controls
- Notifications: Real-time server notifications with auto-refresh capabilities
- Right Panel: Response viewer with formatted output and syntax highlighting
Form Validation Features
- Required Field Indicators: Red asterisks (*) mark required parameters
- Smart Execute Button: Automatically disabled when required fields are empty
- Real-time Validation: Button state updates as you type in form fields
- Array Field Support: Add/remove dynamic list items with validation
- Multiple Field Types: Text, number, checkbox, select, and array inputs
Server Notifications Features
- Real-time Updates: Receive notifications from MCP servers as they happen
- Auto-refresh: Automatically refresh tools, resources, and prompts when server lists change
- Server Context: Each notification shows which server sent it
- Message Types: Supports different notification types:
notifications/tools/list_changed- Tools list has changednotifications/resources/list_changed- Resources list has changednotifications/prompts/list_changed- Prompts list has changednotifications/message- General server messages with level indicators
- Visual Distinction: Server notifications have unique styling and icons (๐)
- Chronological Order: Newest notifications appear at the top
- Notification History: View complete history of server communications
- Toast Control: Per-server configuration for toast popup notifications
- Enable/disable through Add/Edit Server dialogs
- Automatic suppression when viewing notifications tab
- Real-time configuration updates without restart
Server Management
Add/Edit Server Dialog
The server configuration dialog provides comprehensive settings for MCP servers:
Basic Configuration:
- Server Name: Descriptive name for identification
- Transport Type: Choose between STDIO or TCP communication
STDIO Transport Settings:
- Command: Executable command (e.g.,
python,npx,node) - Arguments: Command-line arguments (one per line)
- Environment Variables: KEY=value pairs (one per line)
TCP Transport Settings:
- Host: Server hostname or IP address
- Port: Network port number (1-65535)
Notification Settings:
- Toast Notifications Checkbox: Control popup notifications for this server
- โ Checked (default): Display toast popups + notifications tab
- โ Unchecked: Notifications tab only (quiet mode)
- ๐ฏ Smart Behavior: Toasts auto-suppressed when viewing notifications tab
Dialog Features:
- Real-time form validation with helpful error messages
- Dynamic sections based on transport type selection
- Persistent settings with immediate effect after save
- Maintains UI selection state after edits
Keyboard Shortcuts
q- Quit applicationd- Toggle dark/light modes- Focus server panelr- Refresh server dataCtrl+O- Open last saved resource file (when viewing resources)
Testing with MCP Servers
Example Servers for Testing
Test these official MCP servers using the CLI commands:
-
Filesystem Server:
# Using CLI connect uv run ptmi connect npx \ -a "-y" -a "@modelcontextprotocol/server-filesystem" -a "/tmp" \ --verbose # Direct command for reference npx -y @modelcontextprotocol/server-filesystem /tmp
-
SQLite Server:
# Using CLI connect uv run ptmi connect npx \ -a "-y" -a "@modelcontextprotocol/server-sqlite" \ -a "--db-path" -a "test.db" \ --verbose # Direct command for reference npx -y @modelcontextprotocol/server-sqlite --db-path test.db
-
Custom Python Server:
# Test your custom server uv run ptmi connect python \ -a "my_mcp_server.py" \ -e "DATABASE_URL=sqlite:///data.db" \ -n "My Custom Server" \ --verbose
-
GitHub MCP Server:
# Test GitHub integration server uv run ptmi connect npx \ -a "-y" -a "@modelcontextprotocol/server-github" \ -e "GITHUB_PERSONAL_ACCESS_TOKEN=your_token" \ --verbose
-
Everything Server (for testing notifications):
# Test server that sends regular notifications uv run ptmi connect npx \ -a "-y" -a "@modelcontextprotocol/server-everything" \ --verbose
This server sends
notifications/messageevery 20 seconds, perfect for testing the notification system.
Server Capability Testing
The CLI commands automatically test server capabilities with enhanced display formatting:
Enhanced Resource Display
- Color-Coded Labels: Green names, cyan URIs, yellow descriptions, magenta MIME types
- Download Ready: Shows exact
download-resourcecommands for configured servers - Smart Guidance: Different messages for configured vs temporary servers
Example output for configured servers:
Testing Resources:
Found 3 resources:
Use 'download-resource my-server-id "<resource-name>"' to download any resource
1. Name: config.json
URI: file:///path/to/config.json
Description: Application configuration file
MIME Type: application/json
2. Name: logo.png
URI: file:///path/to/logo.png
MIME Type: image/png
Standard Testing Features
- Server Info: Name, version, protocol version
- Tools: Available tools with parameter schemas
- Prompts: Available prompts with argument definitions
- Error Handling: Timeouts and capability-based filtering
Use --verbose flag to see raw JSON responses and detailed debugging information.
Development
Setup Development Environment
# Clone repository
git clone https://github.com/paulrobello/par-mcp-inspector-tui.git
cd par-mcp-inspector-tui
# Install dependencies
uv sync
# Run formatting, linting, and type checking
make checkall
# Run the application
uv run ptmi tui
Development Commands
# Format, lint, and type check
make checkall
# Individual tools
make format # Format with ruff
make lint # Lint with ruff
make typecheck # Type check with pyright
# Update dependencies
uv sync -U
# Build package
uv build
Architecture Overview
For detailed architectural diagrams showing the application flow, component structure, protocol communication, and data flow, see the Architecture Diagrams document.
The diagrams include:
- Application Flow Diagram - CLI command routing and component interactions including download-resource command
- TUI Component Architecture - UI layout and widget organization
- MCP Protocol Flow - Communication sequence between components
- Client Transport Architecture - STDIO and TCP transport implementations
- Data Flow Through Layers - Information flow across system layers
- Form Validation Flow - Real-time validation system for execute button control
- Dynamic Form Architecture - Form widget structure and validation relationships
- File Type Detection Flow - Magic number detection and MIME type handling for resource downloads
Project Structure
src/par-mcp-inspector-tui/
โโโ __init__.py # Package metadata
โโโ __main__.py # CLI entry point
โโโ models/ # Data models
โ โโโ base.py # MCP protocol base types
โ โโโ server.py # Server configuration
โ โโโ tool.py # Tool definitions
โ โโโ resource.py # Resource definitions
โ โโโ prompt.py # Prompt definitions
โโโ client/ # MCP client implementations
โ โโโ base.py # Abstract client interface
โ โโโ stdio.py # STDIO transport client
โ โโโ tcp.py # TCP transport client
โโโ services/ # Service layer
โ โโโ mcp_service.py # MCP connection service
โ โโโ server_manager.py # Server configuration management
โโโ tui/ # Terminal UI components
โโโ app.py # Main TUI application
โโโ app.tcss # Textual CSS styling
โโโ widgets/ # Custom UI widgets
โโโ server_panel.py # Server list and connection
โโโ connection_status.py # Connection status display
โโโ resources_view.py # Resources browser
โโโ prompts_view.py # Prompts interface
โโโ tools_view.py # Tools interface
โโโ response_viewer.py # Response display
โโโ dynamic_form.py # Dynamic form builder with validation
โโโ notification_panel.py # Notifications
Troubleshooting
Common Issues
-
Server won't connect:
- Check the command/path for STDIO servers
- Verify host/port for TCP servers
- Use CLI debug commands for detailed connection testing
- Enable debug mode for detailed error messages
-
No tools/resources showing:
- Use
--verboseflag to see server capabilities - Check if server supports the requested endpoints (resources/tools/prompts)
- Verify server implements MCP protocol correctly
- Some servers may only implement partial MCP functionality
- Use
-
Request timeouts:
- Server may not support the requested endpoint
- Check server capabilities with
debugcommand - Verify server is responsive and not hanging
-
Form validation errors:
- Check parameter types and requirements
- Ensure all required fields are filled
- Review server documentation for parameter formats
-
Resource download issues:
- Use
debugcommand to see available resource names with color-coded display - Ensure resource name matches exactly (case-sensitive)
- Check if server is configured (temporary servers need to be added to configuration)
- Verify resource actually contains downloadable content
- Use
--verboseflag with download command for detailed error information
- Use
Debugging Tools
CLI Debugging
# Test any STDIO server without configuration
uv run ptmi connect <command> --verbose --debug
# Test any TCP server without configuration
uv run ptmi connect-tcp <host> <port> --verbose --debug
# Debug configured servers
uv run ptmi debug <server-id-or-name> --verbose --debug
# List all configured servers
uv run ptmi servers
# Download resources from configured servers
uv run ptmi download-resource <server-id> "<resource-name>" --verbose
TUI Debug Mode
# Enable debug logging in TUI
uv run ptmi tui --debug
Enhanced Debug Features
The debug commands provide enhanced resource display:
- Color-coded output: Green names, cyan URIs, yellow descriptions, magenta MIME types
- Download instructions: Ready-to-use
download-resourcecommands for configured servers - Smart guidance: Different messages for configured vs temporary servers
Capability Checking
The application automatically checks server capabilities to avoid timeouts:
- If a server reports
nullfor resources/tools/prompts capabilities, those endpoints are skipped - Use
--verboseto see raw server capability information - Servers with
{}(empty object) capabilities will still be tested
Contributing
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
How to Contribute
- Fork the repository
- Create a feature branch
- Make your changes
- Run
make checkallto ensure code quality - Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Paul Robello - probello@gmail.com
Related Projects
- Model Context Protocol - The protocol specification
- MCP Servers - Official MCP server implementations
- Textual - The TUI framework used by this application
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file par_mcp_inspector_tui-0.1.0.tar.gz.
File metadata
- Download URL: par_mcp_inspector_tui-0.1.0.tar.gz
- Upload date:
- Size: 49.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
499627fcbf7db72f4dd9d430fbef70d6e46933c3d01adf314658da9a0f4051a1
|
|
| MD5 |
74fb4df5b6659137a0f984aec601b677
|
|
| BLAKE2b-256 |
c252d148934db940633637435a6bf24c14d64e98e2161deb5b46bd7a45999d08
|
Provenance
The following attestation bundles were made for par_mcp_inspector_tui-0.1.0.tar.gz:
Publisher:
publish.yml on paulrobello/par-mcp-inspector-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
par_mcp_inspector_tui-0.1.0.tar.gz -
Subject digest:
499627fcbf7db72f4dd9d430fbef70d6e46933c3d01adf314658da9a0f4051a1 - Sigstore transparency entry: 317203338
- Sigstore integration time:
-
Permalink:
paulrobello/par-mcp-inspector-tui@0090878f7e7c1858b926b811b771048c8685f6c9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/paulrobello
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0090878f7e7c1858b926b811b771048c8685f6c9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file par_mcp_inspector_tui-0.1.0-py3-none-any.whl.
File metadata
- Download URL: par_mcp_inspector_tui-0.1.0-py3-none-any.whl
- Upload date:
- Size: 65.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f4e18b006446e1ed67cbde3d902ae009bd7b34fa58a9e8125de201e6b733c8a
|
|
| MD5 |
5c804b5241957ea79e9e340baad97c11
|
|
| BLAKE2b-256 |
826ccf2cf4c1bb03c1d52f51430a633e8a5ef7faf1a7fae2e150740f6540e283
|
Provenance
The following attestation bundles were made for par_mcp_inspector_tui-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on paulrobello/par-mcp-inspector-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
par_mcp_inspector_tui-0.1.0-py3-none-any.whl -
Subject digest:
1f4e18b006446e1ed67cbde3d902ae009bd7b34fa58a9e8125de201e6b733c8a - Sigstore transparency entry: 317203352
- Sigstore integration time:
-
Permalink:
paulrobello/par-mcp-inspector-tui@0090878f7e7c1858b926b811b771048c8685f6c9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/paulrobello
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0090878f7e7c1858b926b811b771048c8685f6c9 -
Trigger Event:
workflow_dispatch
-
Statement type: