# Rustunnel

> 为本地服务创建公网隧道。

- **URL**: https://followmcp.com/zh/servers/rustunnel
- **Category**: 开发工具
- **Origin**: 官方
- **Stars**: 669
- **FMRS Score**: 59/100 (Grade C)
- **Source**: https://github.com/joaoh82/rustunnel
- **Transports**: stdio（本地进程）
- **Runtimes**: 预编译二进制
- **Auth**: 需要 API Key / 凭据

## Overview
Rustunnel 是一个开源隧道服务及其 MCP 服务器，可让 AI 代理创建和管理通向本地 HTTP、TCP 或 UDP 服务的公网隧道。服务器可自行托管，也可连接托管服务；MCP 服务器通过 stdio 与客户端通信。

## Best for
- 需要让 AI 代理创建或管理本地开发服务公网隧道的开发者。
- 希望自行托管隧道服务器或使用 Rustunnel 托管服务的团队。

## Not for
- 不需要将本地服务暴露到公网的用户。
- 需要未经授权即可访问本地网络或服务的用户。

## Required permissions
- 需要 Rustunnel API 令牌或自托管管理员令牌；令牌通过 RUSTUNNEL_TOKEN 环境变量提供。
- 创建隧道会让指定的本地服务可经公网地址访问。
- 自托管服务器需要配置网络监听、TLS、身份验证及相应服务端基础设施。

## Risks
- 公网隧道可能让服务及其数据暴露给可访问该地址的人；请限制服务权限并妥善处理敏感数据。
- 泄露令牌可能允许他人使用账户或服务器权限；请保护令牌并在需要时撤销。
- 隧道会转发流量；错误的目标端口或服务配置可能导致非预期服务被暴露。

## Client config (JSON)
```json
{"mcpServers":{"rustunnel":{"command":"rustunnel-mcp","args":["--server","eu.edge.rustunnel.com:4040","--api","https://eu.edge.rustunnel.com:8443"],"env":{"RUSTUNNEL_TOKEN":"<your-token>"}}}}
```

## Tools (6)
- `create_tunnel`: 创建 HTTP、TCP、UDP、P2P 或负载均衡隧道，并返回公网地址。
- `list_tunnels`: 列出当前活动隧道。
- `close_tunnel`: 按隧道 ID 强制关闭隧道。
- `list_regions`: 列出可用服务器区域。
- `get_connection_info`: 返回供云端或沙盒代理使用的 CLI 连接命令。
- `get_tunnel_history`: 检索过去的隧道活动记录。
