能力标签
🔌
MCP工具

Rustunnel

基于 Rust · 让 AI 助手直接操作你的系统与工具
英文名:rustunnel
⭐ 630 Stars 🍴 44 Forks 💻 Rust 📄 AGPL-3.0 🏷 AI 7.5分
7.5AI 综合评分
mcpapi-gatewayreverse-proxyrust
✦ AI Skill Hub 推荐

Rustunnel 是 AI Skill Hub 本期精选MCP工具之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析
Rustunnel 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 Rustunnel,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。Rustunnel 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 Rustunnel 评为 AI 评分 7.5 分,属于同类工具中的优质选择。
📋 工具概览

Rustunnel 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 630
开发语言
Rust
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
AGPL-3.0
AI 综合评分
7.5 分
工具类型
MCP工具
Forks
44
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

Rustunnel 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/joaoh82/rustunnel

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "rustunnel": {
      "command": "npx",
      "args": ["-y", "rustunnel"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 Rustunnel 执行以下任务...
Claude: [自动调用 Rustunnel MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "rustunnel": {
      "command": "npx",
      "args": ["-y", "rustunnel"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 70/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

rustunnel

CI License: AGPLv3 Rust

rustunnel logo

The open-source tunnel that scales with you. Don't pay for idle time. Secure, Rust-fast, and Pay-as-you-go.

Expose local services through a public server over encrypted WebSocket connections with TLS termination, HTTP/TCP proxying, a live dashboard, Prometheus metrics, and audit logging.

You can self-host or use our managed service.

---

Architecture overview

rustunnel architecture

                        ┌──────────────────────────────────────────┐
                        │           rustunnel-server               │
                        │                                          │
Internet ──── :80 ─────▶│  HTTP edge (301 → HTTPS)                 │
Internet ──── :443 ────▶│  HTTPS edge  ──▶ yamux stream ──▶ client │
Client ───── :4040 ────▶│  Control-plane WebSocket (TLS)           │
Browser ──── :8443 ────▶│  Dashboard UI + REST API                 │
Prometheus ─ :9090 ────▶│  Metrics endpoint                        │
Internet ── :20000+ ───▶│  TCP tunnel ports (one per TCP tunnel)   │
                        └──────────────────────────────────────────┘
                                          │ yamux multiplexed streams
                                          ▼
                              ┌─────────────────────┐
                              │   rustunnel client   │
                              │  (developer laptop)  │
                              └──────────┬──────────┘
                                         │ localhost
                                         ▼
                                ┌────────────────┐
                                │  local service  │
                                │  e.g. :3000    │
                                └────────────────┘

---

Requirements

1 — Install dependencies

apt update && apt install -y \
  pkg-config libssl-dev curl git \
  certbot python3-certbot-dns-cloudflare

Install Rust (as the build user, not root):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

Ports for incoming tunnel traffic (requires CAP_NET_BIND_SERVICE or root).

http_port = 80 https_port = 443

via the ACME protocol (requires Cloudflare credentials below).

Production VPS (requires deploy/server.toml to be configured first)

make docker-run

To build

RequirementVersionNotes
Rust toolchain1.76+Install via [rustup](https://rustup.rs)
pkg-configanyNeeded by reqwest (TLS)
libssl-devanyOn Debian/Ubuntu: apt install libssl-dev
Node.js + npm18+Only needed to rebuild the dashboard UI

Local development setup

Build

```bash

Compile all workspace crates (debug mode)

cargo build --workspace

Install and configure dnsmasq to resolve *.localhost → 127.0.0.1

brew install dnsmasq echo "address=/.localhost/127.0.0.1" | sudo tee -a $(brew --prefix)/etc/dnsmasq.conf sudo brew services start dnsmasq

Production deployment (Ubuntu / systemd)

The steps below match a deployment where: - Domain: edge.rustunnel.com - Wildcard DNS: *.edge.rustunnel.com → <server IP> - TLS certs: Let's Encrypt via Certbot + Cloudflare DNS challenge

2 — Build release binaries

git clone https://github.com/joaoh82/rustunnel.git
cd rustunnel
cargo build --release -p rustunnel-server -p rustunnel-client

Binaries will be at: - target/release/rustunnel-server - target/release/rustunnel

4 — Install the server binary

```bash install -Dm755 target/release/rustunnel-server /usr/local/bin/rustunnel-server

Optionally install the client system-wide

install -Dm755 target/release/rustunnel /usr/local/bin/rustunnel


Or use the Makefile target (runs build + install + systemd setup):
bash sudo make deploy ```

the server (see the PostgreSQL setup step above). Schema migrations run

Docker deployment

A full Docker guide covering both local development (self-signed cert) and production VPS (Let's Encrypt) is available in docs/docker-deployment.md.

Build the image (includes Next.js dashboard + Rust server)

make docker-build

Installation

Option 1 — Homebrew (macOS and Linux, recommended)

brew tap joaoh82/rustunnel
brew install rustunnel

Homebrew installs pre-built binaries — no Rust toolchain required. The formula is updated automatically on every release. This installs both rustunnel (the CLI client) and rustunnel-mcp (the MCP server for AI agent integration).

Option 2 — Pre-built binary

Download the archive for your platform from the latest GitHub Release, extract it, and move the rustunnel binary to a directory on your $PATH:

```bash

Setup wizard

The easiest way to create your config file is the interactive setup wizard:

rustunnel setup

It prompts for your region and auth token, then writes ~/.rustunnel/config.yml with the correct server address and a commented tunnels: example section.

rustunnel setup — create ~/.rustunnel/config.yml

Region [auto / eu / us / ap / self-hosted] (default: auto):
  Selecting nearest region… eu 12ms · us 143ms · ap 311ms · → eu (Helsinki, FI) 12ms
  Server set to: eu.edge.rustunnel.com:4040

Auth token (leave blank to skip): rt_live_abc123...

Created: /Users/you/.rustunnel/config.yml
Run `rustunnel start` to connect using this config.

Pick a specific region (eu, us, ap) to connect directly, or auto (the default) to let the client probe all regions and pick the nearest. Choose self-hosted if you run your own server — the wizard will then prompt for your server address.

After running setup, use rustunnel start to connect with all tunnels defined in the config, or use rustunnel http <port> / rustunnel tcp <port> for one-off tunnels.

Omit for self-hosted / single-server setups.

region: auto

Quick setup (Claude Desktop — hosted server)

{
  "mcpServers": {
    "rustunnel": {
      "command": "rustunnel-mcp",
      "args": [
        "--server", "edge.rustunnel.com:4040",
        "--api",    "https://edge.rustunnel.com:8443"
      ]
    }
  }
}

Installation

Homebrew (macOS and Linux) — installs rustunnel-mcp alongside the CLI:

brew tap joaoh82/rustunnel
brew install rustunnel

Build from source:

make release-mcp
sudo install -m755 target/release/rustunnel-mcp /usr/local/bin/rustunnel-mcp

Full setup guide, configuration options, and workflow examples are in docs/mcp-server.md.

Quick start with the hosted server

Once you have a token, run the setup wizard:

```bash rustunnel setup

Example for macOS Apple Silicon

curl -L https://github.com/joaoh82/rustunnel/releases/latest/download/rustunnel-<version>-aarch64-apple-darwin.tar.gz \ | tar xz sudo install -Dm755 rustunnel /usr/local/bin/rustunnel


Available targets:

| Platform | Archive |
|----------|---------|
| macOS Apple Silicon | `rustunnel-<version>-aarch64-apple-darwin.tar.gz` |
| macOS Intel | `rustunnel-<version>-x86_64-apple-darwin.tar.gz` |
| Linux x86_64 (glibc) | `rustunnel-<version>-x86_64-unknown-linux-gnu.tar.gz` |
| Linux x86_64 (musl, static) | `rustunnel-<version>-x86_64-unknown-linux-musl.tar.gz` |
| Linux arm64 | `rustunnel-<version>-aarch64-unknown-linux-gnu.tar.gz` |
| Windows x86_64 | `rustunnel-<version>-x86_64-pc-windows-msvc.zip` |

**Option 3 — Build from source**

Requires Rust 1.76+.
bash git clone https://github.com/joaoh82/rustunnel.git cd rustunnel cargo build --release -p rustunnel-client sudo install -Dm755 target/release/rustunnel /usr/local/bin/rustunnel

Quick start (CLI flags)

```bash

Guidelines

  • Keep PRs focused — one logical change per PR.
  • Add or update tests for any new behaviour.
  • Follow the existing code style; cargo fmt is enforced by CI.
  • For larger changes or new features, open an issue first to discuss the approach.

---

6 — Create the server config file

Create /etc/rustunnel/server.toml with the content below. Replace your-admin-token-here with a strong random secret (e.g. openssl rand -hex 32).

```toml

Optional: write an append-only audit log (JSON-lines) for auth attempts,

Client configuration

Config file

Default location: ~/.rustunnel/config.yml

```yaml

~/.rustunnel/config.yml

Config file reference (server)

KeyTypeDefaultDescription
server.domainstringBase domain for tunnel URLs
server.http_portu16HTTP edge port
server.https_portu16HTTPS edge port
server.control_portu16WebSocket control-plane port
server.dashboard_portu164040Dashboard port
tls.cert_pathstringPath to TLS certificate (PEM)
tls.key_pathstringPath to TLS private key (PEM)
tls.acme_enabledboolfalseEnable built-in ACME renewal
tls.acme_emailstring""Contact email for ACME
tls.acme_stagingboolfalseUse Let's Encrypt staging CA
tls.acme_account_dirstring/var/lib/rustunnelACME state directory
tls.cloudflare_api_tokenstring""Cloudflare DNS API token (prefer env var CLOUDFLARE_API_TOKEN)
tls.cloudflare_zone_idstring""Cloudflare Zone ID (prefer env var CLOUDFLARE_ZONE_ID)
auth.admin_tokenstringMaster auth token
auth.require_authboolReject unauthenticated clients
database.urlstringPostgreSQL connection URL (required)
database.captured_pathstring/var/lib/rustunnel/captured.dbPer-region SQLite file for captured HTTP request bodies
server.dashboard_originstring""Allowed CORS origin for the dashboard UI (e.g. http://localhost:3000)
logging.levelstringtrace / debug / info / warn / error
logging.formatstringjson or pretty
logging.audit_log_pathstringnullPath for audit log (JSON-lines); omit to disable
limits.max_tunnels_per_sessionusizeMax tunnels per connected client
limits.max_connections_per_tunnelusizeMax concurrent connections per tunnel
limits.rate_limit_rpsu32Per-tunnel request rate cap (req/s)
limits.ip_rate_limit_rpsu32100Per-source-IP rate cap (req/s); 0 = disabled
limits.request_body_max_bytesusizeMax proxied request body size (bytes)
limits.tcp_port_range[u16, u16]Inclusive [low, high] TCP tunnel port range
limits.udp_port_range[u16, u16][0, 0]Inclusive [low, high] UDP tunnel port range; [0, 0] disables UDP tunnels
region.idstring"default"Region identifier recorded in tunnel history (e.g. "eu", "us", "ap")
region.namestring"Default"Human-readable region name shown in the dashboard
region.locationstring""Physical location label (e.g. "Helsinki, FI")

---

Dashboard UI and REST API port.

dashboard_port = 8443

Cloudflare API token with DNS:Edit permission for the zone.

dns_cloudflare_api_token = YOUR_CLOUDFLARE_API_TOKEN EOF

chmod 600 /etc/letsencrypt/cloudflare.ini


Request a certificate covering the bare domain and the wildcard (required for HTTP subdomain tunnels):
bash certbot certonly \ --dns-cloudflare \ --dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini \ -d "edge.rustunnel.com" \ -d "*.edge.rustunnel.com" \ --agree-tos \ --email your@email.com

Certbot writes the certificate to:
/etc/letsencrypt/live/edge.rustunnel.com/fullchain.pem /etc/letsencrypt/live/edge.rustunnel.com/privkey.pem

These paths are already set in the config above. Certbot sets up automatic renewal via a systemd timer.

rustunnel reads TLS certificates from disk at startup, so it must be restarted after each renewal.
Add a Certbot deploy hook to do this automatically:
bash cat > /etc/letsencrypt/renewal-hooks/deploy/restart-rustunnel.sh <<'EOF' #!/bin/sh systemctl restart rustunnel.service EOF chmod +x /etc/letsencrypt/renewal-hooks/deploy/restart-rustunnel.sh

Allow the `rustunnel` service user to read the certificates:
bash

Quick reference

```bash

Region preference: auto (probe & pick nearest), or eu / us / ap.

Port reference

PortProtocolPurpose
80TCPHTTP edge — redirects to HTTPS; also ACME HTTP-01 challenge
443TCPHTTPS edge — TLS-terminated tunnel ingress
4040TCPControl-plane WebSocket — clients connect here
8443TCPDashboard UI and REST API
9090TCPPrometheus metrics (/metrics)
20000–20099TCPTCP tunnel range (configurable via tcp_port_range)
20100–20199UDPUDP tunnel range (configurable via udp_port_range)

---

REST API

The dashboard port exposes a REST API for programmatic access to tunnels, tokens, captured requests, and tunnel history. All endpoints (except the health check) require an Authorization: Bearer <token> header.

/api/tunnels, /api/groups, and their per-tunnel sub-resources are scoped by caller: the admin token sees everything; a user-scoped API token sees only its own tunnels and groups; tunnels the caller can't see return 404, never 403. See docs/api-reference.md § Visibility scope for the full rules.

Quick reference

MethodPathDescription
GET/api/statusHealth check (no auth)
GET/api/tunnelsList active tunnels
GET/api/tunnels/:idGet a single tunnel
DELETE/api/tunnels/:idForce-close a tunnel
GET/api/tunnels/:id/requestsCaptured HTTP requests
POST/api/tunnels/:id/replay/:req_idFetch stored request for replay
GET/api/tokensList API tokens
POST/api/tokensCreate an API token
DELETE/api/tokens/:idDelete an API token
GET/api/historyPaginated tunnel history

Full request/response schemas, query parameters, and examples are in docs/api-reference.md.

A machine-readable OpenAPI 3.0 spec is served at GET /api/openapi.json (no auth required).

---

Full suite (unit + integration)

make test

AI agent integration (MCP server)

rustunnel ships a rustunnel-mcp binary that implements the Model Context Protocol over stdio, letting AI agents (Claude, GPT-4o, custom agents) open and manage tunnels without any manual intervention.

Claude Code plugin

The easiest way to use rustunnel with Claude Code. Install the plugin and it handles all MCP configuration automatically — just enter your token once and start asking Claude to expose ports.

/plugin install rustunnel

The plugin prompts for your server address and API token at enable time, stores them securely, and starts the MCP server in the background. No .mcp.json editing or manual setup needed.

Plugin directory: plugins/claude-code/ Documentation: docs/claude-plugin.md

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
部署方案
  • Docker:rustunnel 提供官方镜像,docker compose up 一键启动
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
rustunnel 中文教程rustunnel 安装报错怎么办rustunnel MCP 配置rustunnel Docker 部署rustunnel Agent 工作流rustunnel 与同类工具对比rustunnel 最佳实践rustunnel 适合谁用
⚡ 核心功能
👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
👥 适合人群
Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师
🎯 使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
⚖️ 优点与不足
✅ 优点
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

该工具使用 AGPL-3.0 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

⚠️ AGPL 3.0 — 最严格的 Copyleft,网络服务端使用也需开源,SaaS 使用受限。

🔗 相关工具推荐
📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合
❓ 常见问题 FAQ
rustunnel 是一款Rust开发的AI辅助工具。开源MCP工具:Self-hosted, secure tunnel server in Rust. Expose local HTTP/HTTPS/TCP/UDP servi。⭐630 · Rust 主要应用场景包括:本地服务暴露。
💡 AI Skill Hub 点评

经综合评估,Rustunnel 在MCP工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

⬇️ 获取与下载
⬇ 下载源码(GPL)
⚠️ 本工具使用 AGPL-3.0 协议。您可以自由下载和使用,但衍生作品必须以相同协议开源,不可商业闭源。使用前请确认符合协议要求。
📚 深入学习 Rustunnel
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 rustunnel
原始描述 开源MCP工具:Self-hosted, secure tunnel server in Rust. Expose local HTTP/HTTPS/TCP/UDP servi。⭐630 · Rust
Topics mcpapi-gatewayreverse-proxyrust
GitHub https://github.com/joaoh82/rustunnel
License AGPL-3.0
语言 Rust
🔗 原始来源
🐙 GitHub 仓库  https://github.com/joaoh82/rustunnel 🌐 官方网站  https://rustunnel.com

收录时间:2026-05-25 · 更新时间:2026-05-26 · License:AGPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。