Expose, discover, and connect to Model Context Protocol servers through stunl
The stunl mcp subcommand lets you share local MCP servers with your team through secure tunnels. Expose a local MCP server, browse available servers, or connect Claude Desktop to a remote MCP server -- all with a single command.
Requires an agent key (st_agent_ prefix) from your team settings in the portal.
$ stunl mcp expose -port 8080 -name "my-tools"
Probing MCP server at localhost:8080/mcp...
Found 5 tools, 2 resources, 1 prompt
● MCP Server exposed
╭── ◎ ── MCP
│ Name my-tools
│ URL https://my-tools.mcp.stunl.io/mcp
│ Protocol streamable-http
│ Tools 5 | Resources 2 | Prompts 1
$ stunl mcp list
NAME TOOLS RESOURCES OWNER
my-tools 5 2 val
db-query 3 0 alice
code-search 8 1 bob
$ stunl mcp connect my-tools
# Bridges stdio (JSON-RPC) to the remote MCP server
Exposes a local MCP server through a tunnel. On startup, stunl probes your server by calling initialize, tools/list, resources/list, and prompts/list to discover capabilities. It then creates a tunnel and registers the server with the portal API. A heartbeat is sent every 30 seconds to keep the registration alive.
| Flag | Default | Description |
|---|---|---|
| -port | required | Port your MCP server listens on |
| -name | required | Name for your MCP server |
| -description | Human-readable description | |
| -path | /mcp | HTTP path for the MCP endpoint |
| -protocol | streamable-http | sse or streamable-http |
| -visibility | team | team, private, or public |
| -subdomain | Custom subdomain for the tunnel | |
| -domain | Custom domain for the tunnel | |
| -key | Agent key (or set STUNL_API_KEY) |
Lists all MCP servers currently exposed by your team. Shows server name, number of tools, resources, and owner. Requires an agent key.
A stdio-to-HTTP bridge designed for Claude Desktop integration. Reads JSON-RPC messages from stdin, POSTs them to the remote MCP server, and writes responses to stdout.
Takes a server name (resolved via the portal) or a --url flag for direct connection.
┌─────────────┐ stdio ┌───────────┐ HTTPS ┌────────────┐ gRPC ┌────────────────┐
│ Claude │ ◄──────────► │ stunl │ ◄────────► │ stunl │ ◄──────► │ stunl client │
│ Desktop │ JSON-RPC │ connect │ │ server │ │ (mcp expose) │
└─────────────┘ └───────────┘ └────────────┘ └───────┬────────┘
│
┌──────▼───────┐
│ Local MCP │
│ Server │
└──────────────┘
Add the following to your Claude Desktop configuration file to connect to a team MCP server.
{
"mcpServers": {
"my-tools": {
"command": "stunl",
"args": ["mcp", "connect", "my-tools"],
"env": {
"STUNL_API_KEY": "st_agent_xxx"
}
}
}
}
{
"mcpServers": {
"custom-server": {
"command": "stunl",
"args": ["mcp", "connect", "--url", "https://my-tools.mcp.stunl.io/mcp"]
}
}
}
$ stunl mcp expose -port 3001 -name "db-tools" \
-protocol sse -description "Database query and schema tools"
$ stunl mcp expose -port 8080 -name "private-tools" \
-visibility private -subdomain my-private-mcp
$ stunl mcp expose -port 9000 -name "api-tools" -path /api/mcp