Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dvlpjrs/guMCP/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The remote server module provides HTTP/SSE (Server-Sent Events) transport for MCP servers, enabling remote access and multi-user support. It automatically discovers and serves all servers in the servers directory. Source:src/servers/remote.py
Main Function
Source:src/servers/remote.py:255
Command-Line Arguments
Host address for the Starlette server
Port for the Starlette server
Core Functions
discover_servers
Automatically discovers and loads all servers from the servers directory. Source:src/servers/remote.py:40
- Scans all directories in
src/servers/ - Looks for
main.pyin each directory - Loads modules with
serverandget_initialization_optionsattributes - Stores loaded servers in global
serversdictionary - Logs successful loads and warnings for invalid servers
create_starlette_app
Creates a Starlette application with SSE endpoints for all discovered servers. Source:src/servers/remote.py:102
Configured Starlette application with routes for all servers
/{server_name}/{session_key}- SSE connection endpoint/{server_name}/{session_key}/messages/- Message posting endpoint/- Root health check/health_check- Health check endpoint
create_metrics_app
Creates a separate Starlette app for Prometheus metrics. Source:src/servers/remote.py:85
Starlette app serving metrics on
/metrics endpointrun_metrics_server
Runs the metrics server on a separate port. Source:src/servers/remote.py:248
Host address for metrics server
Port for metrics server (default: 9091)
API Endpoints
SSE Connection Endpoint
Name of the server (e.g., “slack”, “github”)
URL-encoded session identifier. For Gumloop:
{user_id}:{api_key}, otherwise just {user_id}Message Endpoint
Name of the server
Session identifier from SSE connection
404- Session not found or expired- Handled by SSE transport’s
handle_post_message
Health Check Endpoints
Metrics Endpoint
Metrics
The server tracks Prometheus metrics:active_connections
Source:src/servers/remote.py:29
connection_total
Source:src/servers/remote.py:32
Session Management
User Session Storage
Source:src/servers/remote.py:24-26
- With API key:
{server_name}:{user_id}:{api_key} - Without API key:
{server_name}:{user_id}
- SSE connection creates transport and server instance
- Server instance is reused for reconnections (maintains state)
- Transport is cleaned up when connection closes
- Server instance persists for future reconnections
Usage
Starting the Server
Custom Port Configuration
Using Environment Variables
Integration Example
Python Client
cURL
Logging
Source:src/servers/remote.py:16-19
- Server discovery:
Discovered {count} servers - Server loading:
Loaded server: {server_name} - Connection:
New SSE connection requested for {server_name} with session: {user_id} - Connection established:
SSE connection established for {server_name} session: {user_id} - Connection closed:
Closed SSE connection for {server_name} session: {user_id}
Server Requirements
Servers must follow this structure:Configuration
Metrics Port
Source:src/servers/remote.py:37
See Also
- Local Server (stdio) - Local stdin/stdout transport
- Main Server Entry Point - Server launcher