Content
# SuperGateway Introduction
This is a gateway tool that converts standard input/output (stdio) to Server-Sent Events (SSE). It allows you to run a stdio-based MCP (Model Context Protocol) server and access it remotely via SSE.
## Features
- Converts stdio-based MCP servers to SSE services
- Supports multiple clients connecting simultaneously
- Automatically recognizes and forwards JSON formatted output
- Supports CORS
- Supports health check endpoints
- Configurable log levels
## System Requirements
- Java 17 or higher
- Maven 3.6 or higher
## Build and Run
1. Build the project:
```bash
cd src/java
mvn clean package
```
2. Run the application:
```bash
java -jar target/supergateway-1.0.0.jar [options]
```
## Command Line Options
- `--version`: Display the version number
- `--stdio`: The MCP server command to run
- `--sse`: SSE URL connection address
- `--port`: (stdio→SSE) Server listening port [default: 8000]
- `--baseUrl`: (stdio→SSE) Base URL for SSE clients
- `--ssePath`: (stdio→SSE) SSE subscription path [default: "/sse"]
- `--messagePath`: (stdio→SSE) SSE message path [default: "/message"]
- `--logLevel`: Set log level: "info" or "none" [default: "info"]
- `--cors`: Enable CORS [default: false]
- `--healthEndpoint`: Add health check endpoints, separated by commas
- `--help`: Display help information
## Usage Example
```bash
java -jar target/supergateway-1.0.0.jar \
--stdio "java -jar your-mcp-server.jar" \
--port 8000 \
--baseUrl http://localhost:8000 \
--ssePath /sse \
--messagePath /message
```
## API Endpoints
### 1. SSE Connection
- URL: `GET /sse`
- Description: Establish an SSE connection to receive process output
- Response: The server will return an SSE event containing the message endpoint
### 2. Send Message
- URL: `POST /message?sessionId=<session_id>`
- Content-Type: `application/json`
- Description: Send a JSON formatted message to the process
- Response:
- 200: Message sent successfully
- 400: Invalid JSON message
- 503: Session does not exist or process is not ready
### 3. Health Check
- URL: `GET /health` (if health check endpoint is configured)
- Description: Check if the service is running normally
- Response: Returns "ok"
## Notes
1. Process output must be in JSON format to be forwarded to the SSE client
2. Each SSE client will automatically receive a unique sessionId
3. All messages must be valid JSON format
4. When sending messages, the correct sessionId obtained from the SSE connection must be used
5. The MCP server must support communication via standard input/output
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
git
A Model Context Protocol server for Git automation and interaction.