Skip to content

Conversation

Copy link

Copilot AI commented Jul 29, 2025

This PR implements the MCP Host functionality that allows users to start MCP servers online with one click, providing a remote MCP URL with Server-Sent Events (SSE) for local use.

Key Features

Backend Infrastructure:

  • MCP Host Manager: Process lifecycle management with automatic cleanup and resource limits
  • REST API: Complete /v1/host/* endpoint suite for server management
  • Server-Sent Events: Real-time bidirectional communication between hosted servers and clients
  • Process Management: Secure spawning and monitoring of MCP server processes using child_process

Frontend Experience:

  • One-Click Start: "Start Server" button integrated into server details pages
  • Real-Time Monitoring: Live console output with timestamped, color-coded messages
  • Connection Management: Server status indicators, uptime tracking, and start/stop controls
  • MCP Client Integration: Generated SSE URLs for seamless local client connections

Technical Implementation

The system spawns MCP servers as child processes and exposes them via SSE endpoints. Each server gets a unique session ID and URL like:

http://localhost:3001/v1/host/events/ecaee985-d65a-45bf-94ea-81c4e22dc785

Safety Features:

  • Maximum 10 concurrent servers to prevent resource exhaustion
  • 30-minute idle timeout with automatic cleanup
  • Graceful process termination with SIGTERM/SIGKILL fallback
  • Session isolation and proper error handling

API Endpoints:

  • POST /v1/host/start - Start a new MCP server instance
  • GET /v1/host/events/:sessionId - SSE endpoint for real-time communication
  • GET /v1/host/status/:sessionId - Check server status and uptime
  • DELETE /v1/host/stop/:sessionId - Stop a running server
  • GET /v1/host/list - List all active hosted servers

User Experience

MCP Host Interface

The interface shows:

  1. Server Status Badge: Real-time status with uptime (e.g., "error", "18s")
  2. MCP Server URL: Copy-ready connection URL for local MCP clients
  3. Live Console: Terminal-style output with timestamps and message filtering
  4. Connection Indicators: WiFi icons showing connection status
  5. Controls: Start/Stop buttons and expandable output view

Users can now test MCP servers instantly without local installation, making the hub more interactive and useful for evaluation and development.

Fixes #49.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/modelcontextprotocol/servers
    • Triggering command: /usr/local/bin/node --require /home/REDACTED/work/mcp-agents-hub/mcp-agents-hub/node_modules/tsx/dist/preflight.cjs --import file:///home/REDACTED/work/mcp-agents-hub/mcp-agents-hub/node_modules/tsx/dist/loader.mjs src/server.ts (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ups216 <1203500+ups216@users.noreply.github.com>
Copilot AI changed the title [WIP] MCP Host Add MCP Host: One-Click Online Server Hosting with SSE Jul 29, 2025
Copilot AI requested a review from ups216 July 29, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP Host

2 participants