A modern, full-stack application for exploring and interacting with Model Context Protocol (MCP) servers. MCP Explorer provides a user-friendly interface to connect to MCP servers, discover available tools, and execute them with custom parameters.
- Easy MCP Server Connection: Connect to any MCP server via STDIO protocol
- Tool Discovery: Automatically list all available tools from connected servers
- Interactive Tool Execution: Execute tools with custom arguments and view results
- Real-time Status Monitoring: Monitor connection status in real-time
- Modern UI: Built with Next.js and React for a smooth user experience
- REST API: Comprehensive REST API for programmatic access
- Docker Support: Easy deployment with Docker Compose
- CORS Enabled: Full CORS support for cross-origin requests
- Architecture
- Technology Stack
- Prerequisites
- Quick Start with Docker Compose
- Manual Setup
- Project Structure
- API Endpoints
- Frontend Usage
- Development
- Troubleshooting
MCP Explorer follows a layered architecture with clear separation of concerns:
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js Frontend (React) β
β (Port 3000) β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β HTTP Requests
β
βββββββββββββββββββΌββββββββββββββββββββββββββββββββ
β FastAPI Backend (Python) β
β (Port 8000) β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βββββββββββ΄βββββββββββ
β β
βββββββββΌβββββββββ ββββββββΌβββββββββββ
β MCP Clients β β Connection β
β (STDIO) β β Manager β
ββββββββββββββββββ βββββββββββββββββββ
β
βββββββββββββββββββββββ¬ββββββββββββββββββ
β β
βββββββββΌβββββββββ ββββββΌβββββββββββ
β MCP Server 1 β β MCP Server 2 β
ββββββββββββββββββ βββββββββββββββββ
For detailed architecture information, see backend/ARCHITECTURE.md.
- Python 3.13+: Modern Python runtime
- FastAPI: High-performance web framework
- Uvicorn: ASGI server
- Pydantic: Data validation
- MCP SDK (1.25.0+): Official Model Context Protocol library
- Next.js: React framework with server-side rendering
- React 18: UI library
- TypeScript: Type-safe JavaScript
- Tailwind CSS: Utility-first CSS framework
- Radix UI: Headless UI component library
- React Hook Form: Flexible form handling
- Docker: Containerization
- Docker Compose: Multi-container orchestration
- Ruff: Python linter and formatter
- Docker: Install Docker
- Docker Compose: Install Docker Compose
OR for manual setup:
- Python 3.13+
- Node.js 18+
- npm or pnpm
git clone https://github.com/yourusername/mcp-explorer.git
cd mcp-explorerdocker-compose up -dThis will start:
- Frontend: Available at http://localhost:3000
- Backend API: Available at http://localhost:8000
docker-compose psYou should see:
NAME STATUS
mcp-explorer-frontend Up
mcp-explorer-backend Up
- Web Interface: Open http://localhost:3000 in your browser
- API Documentation: Visit http://localhost:8000/docs
docker-compose downTo remove volumes as well:
docker-compose down -v-
Navigate to backend directory:
cd backend -
Create virtual environment (optional but recommended):
python3.13 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -e . -
Run the development server:
python main.py
Or with Uvicorn directly:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
The backend will be available at http://localhost:8000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install # or pnpm install -
Run the development server:
npm run dev # or pnpm devThe frontend will be available at
http://localhost:3000
mcp-explorer/
βββ backend/ # Python FastAPI application
β βββ main.py # Application entry point
β βββ pyproject.toml # Python dependencies
β βββ Dockerfile # Backend container config
β βββ ARCHITECTURE.md # Detailed architecture docs
β β
β βββ src/
β βββ factory.py # FastAPI app factory
β βββ lifespan.py # App lifecycle events
β βββ exceptions.py # Global exceptions
β β
β βββ api/ # API layer
β β βββ dependencies.py # FastAPI dependencies
β β βββ schemas.py # Request/response models
β β βββ endpoints/
β β βββ stdio.py # STDIO connection endpoints
β β
β βββ mcp/ # MCP integration
β β βββ manager.py # Connection manager
β β βββ exceptions.py # MCP-specific exceptions
β β βββ client/ # MCP client implementations
β β β βββ base.py # IMCPClient protocol
β β β βββ stdio.py # STDIO client
β β β βββ http.py # HTTP client (planned)
β β βββ connection/ # Connection models
β β βββ connection.py
β β βββ config.py
β β βββ type.py
β β
β βββ utils/ # Utilities
β βββ logging/
β
βββ frontend/ # Next.js React application
β βββ package.json # Node dependencies
β βββ Dockerfile # Frontend container config
β βββ next.config.mjs # Next.js configuration
β βββ tsconfig.json # TypeScript config
β β
β βββ app/ # Next.js app directory
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β β βββ globals.css # Global styles
β β
β βββ components/ # React components
β β βββ mcp-explorer.tsx # Main explorer component
β β βββ connection-sidebar.tsx
β β βββ tools-panel.tsx
β β βββ results-panel.tsx
β β βββ ui/ # Radix UI components
β β
β βββ hooks/ # Custom React hooks
β β βββ use-mcp-connection.ts # MCP connection hook
β β
β βββ lib/ # Utilities
β β βββ types.ts # TypeScript types
β β βββ utils.ts # Helper functions
β β
β βββ public/ # Static assets
β
βββ test-server/ # Example MCP test server
β βββ main.py
β βββ tools.py
β βββ pyproject.toml
β
βββ docker-compose.yml # Docker Compose configuration
βββ README.md # This file
GET /- API information
| Method | Endpoint | Description |
|---|---|---|
POST |
/mcp/stdio/connect |
Connect to an MCP server |
POST |
/mcp/stdio/disconnect |
Disconnect from server |
GET |
/mcp/stdio/status |
Get connection status |
GET |
/mcp/stdio/list-tools |
List available tools |
POST |
/mcp/stdio/execute |
Execute a tool |
GET /docs- Swagger UI (interactive)GET /redoc- ReDoc documentationGET /openapi.json- OpenAPI schema
-
Use the connection sidebar to create a new connection
-
Provide server details:
- Name: Connection identifier
- Command: The executable (e.g.,
python) - Args: Command arguments (e.g.,
-m my_mcp_server) - Environment: Optional environment variables
-
Click "Connect"
- Once connected, the available tools appear in the tools panel
- Select a tool to see its input schema
- Fill in the required parameters
- Click "Execute"
- View results in the results panel
-
Start development server:
cd backend python main.py -
Run linter/formatter:
ruff check . ruff format .
-
Access API documentation: http://localhost:8000/docs
-
Start development server:
cd frontend npm run dev -
Build for production:
npm run build
-
Run linter:
npm run lint
The project enforces code quality standards:
Backend (Ruff):
- Line length: 79 characters (PEP 8)
- Target: Python 3.13
- Enabled rules: pycodestyle, pyflakes, pep8-naming, pydocstyle, pyupgrade, isort, flake8-bugbear, flake8-comprehensions, flake8-simplify
# Check logs
docker-compose logs
# Rebuild containers
docker-compose build --no-cache
# Start again
docker-compose upEnsure the backend is running and accessible:
curl http://localhost:8000/- Verify backend is running:
http://localhost:8000 - Check CORS settings in
backend/src/factory.py - Ensure both services are on the same Docker network
- Verify the MCP server command is correct
- Check server logs in the results panel
- Ensure all required dependencies are installed
If ports 3000 or 8000 are in use:
Option 1: Stop other services using those ports
lsof -i :3000 # Check port 3000
lsof -i :8000 # Check port 8000Option 2: Modify docker-compose.yml:
services:
frontend:
ports:
- "3001:3000" # Changed to 3001
backend:
ports:
- "8001:8000" # Changed to 8001- Backend Architecture Documentation
- Backend README
- FastAPI Documentation
- Next.js Documentation
- Model Context Protocol
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Connection persistence and history
- Authentication and authorization
- HTTP/SSE MCP client support
- Connection pooling
- Performance metrics and monitoring
- Tool execution templates
- Result export functionality
Happy exploring! π