open-index/open-npm huggingface dataset:
npm package: @smithery/gateway
Description: Run MCP stdio servers over SSE
Latest version: 1.4.11
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

**Supergateway** runs a **MCP stdio-based servers** over **SSE (Server-Sent Events)** with one command. This is useful for remote access, debugging, or connecting to SSE-based clients when your MCP server only speaks stdio.

Supported by [superinterface.ai](https://superinterface.ai) and [supercorp.ai](https://supercorp.ai).

## Installation & Usage

Run Supergateway via `npx`:

```bash
npx -y supergateway --stdio "uvx mcp-server-git"
```

- **`--port 8000`**: Port to listen on (default: `8000`)
- **`--stdio`**: Command that runs an MCP server over stdio

Once started:
- **SSE endpoint**: `GET http://localhost:8000/sse`
- **POST messages**: `POST http://localhost:8000/message`

## Example with MCP Inspector

1. **Run Supergateway**:
   ```bash
   npx -y supergateway --port 8000 \
       --stdio "npx -y @modelcontextprotocol/server-filesystem /Users/MyName/Desktop"
   ```
2. **Use MCP Inspector**:
   ```bash
   npx @modelcontextprotocol/inspector --uri http://localhost:8000/sse
   ```
   You can then read resources, list tools, or run other MCP actions through Supergateway.

## Using with ngrok

You can use [ngrok](https://ngrok.com/) to share your local MCP server with remote clients:

```bash
npx -y supergateway --port 8000 \
    --stdio "npx -y @modelcontextprotocol/server-filesystem ."
# In another terminal:
ngrok http 8000
```

ngrok then provides a public URL.

## Configs

### Starting the MCP with Smithery configs
You can use a Smithery config by running (locally):
```
cat examples/exa.yaml | npx . --config -
```

### Using Config Over MCP Wire Protocol

MCP clients can configure the server over the wire using the experimental `config` capability. Here's how:

1. **Check Capabilities**: First verify the server supports config by checking its capabilities:
   ```json
   {
     "capabilities": {
       "experimental": {
         "config": {}
       }
     }
   }
   ```

2. **Send Config Request**: Send a JSON-RPC request to the `experimental/config` method:
   ```json
   {
     "jsonrpc": "2.0",
     "method": "config",
     "params": {
       "config": ... // The config object over MCP
     }
   }
   ```

The server will validate the config against its schema and apply it if valid. Any errors in the config will be returned in the JSON-RPC response.