English · فارسی
A one-command installer that turns an Ubuntu/Debian server into an independently authenticated MCP (Model Context Protocol) server you can connect to from Claude, exposed securely through its own Cloudflare Tunnel. No open inbound ports.
⚠️ This grants root-level remote administration. Anyone with the connector URL has root on the server. Use one tunnel and one token per server, and never share the URL.
Run as a user with sudo on the target server:
sudo bash -c "$(curl -fsSL https://github.com/archerhabibi/MCP/releases/latest/download/install-server-mcp.sh)"The installer is interactive, so it must be started this way (not curl … | bash).
You will be asked for:
- Public hostname for this server, e.g.
srv1-mcp.example.com - Cloudflare Tunnel token for this server
- MCP access token – leave empty to auto-generate a 64-char one (min. 40 chars)
At the end it prints your connector URL:
https://<hostname>/<MCP_TOKEN>/mcp
Paste it into Claude → Settings → Connectors → Add custom connector, choose No sign-in and leave headers empty.
In your tunnel, add a Public Hostname:
| Field | Value |
|---|---|
| Hostname | your hostname |
| Service | http://127.0.0.1:8008 |
curl -fsSLO https://github.com/archerhabibi/MCP/releases/latest/download/install-server-mcp.sh
curl -fsSLO https://github.com/archerhabibi/MCP/releases/latest/download/SHA256SUMS
sha256sum -c SHA256SUMS --ignore-missing
sudo bash install-server-mcp.sh- Ubuntu or Debian with systemd, run as root
- A Cloudflare account with a Tunnel (token) and a hostname
| Item | Location |
|---|---|
| App + virtualenv | /opt/server-mcp |
| Secrets (0600) | /etc/server-mcp/server.env, tunnel.env |
| Audit log | /var/log/server-mcp/audit.jsonl |
| Services | server-mcp, server-mcp-tunnel (does not touch an existing cloudflared.service) |
- Token is a secret first URL segment; wrong/missing token → plain
404 - Constant-time token comparison, minimum token length 40
- Server binds to
127.0.0.1:8008only; reachable solely through the tunnel - DNS-rebinding protection (allowed hosts/origins pinned to your hostname)
- No HTTP access log (token never written to logs); every tool call is audited
- Pinned to
mcp>=1.10,<2
hello · get_system_info · run_command (root bash) · list_files · read_file ·
write_file · manage_service · list_processes · get_network_info · docker_ps
systemctl status server-mcp server-mcp-tunnel
journalctl -u server-mcp -f
sudo tail -f /var/log/server-mcp/audit.jsonl
sudo sed -n 's/^MCP_ACCESS_TOKEN=//p' /etc/server-mcp/server.env # show tokenUpdate / rotate tokens: re-run the installer; answer n to "Reuse" to enter new values.
sudo bash -c "$(curl -fsSL https://github.com/archerhabibi/MCP/releases/latest/download/uninstall-server-mcp.sh)"Then delete the tunnel/hostname in Cloudflare and consider the old token revoked.
نصبکنندهی تکدستوری که سرور اوبونتو/دبیان شما را به یک MCP سرور با احراز هویت مستقل تبدیل میکند و از طریق Cloudflare Tunnel اختصاصی (بدون باز کردن پورت ورودی) به Claude وصل میشود.
⚠️ این ابزار دسترسی root از راه دور میدهد. هر کس آدرس کانکتور را داشته باشد روت سرور را دارد. برای هر سرور یک تونل و یک توکن جدا استفاده کنید و آدرس را هرگز منتشر نکنید.
روی سرور مقصد (با دسترسی sudo) اجرا کنید:
sudo bash -c "$(curl -fsSL https://github.com/archerhabibi/MCP/releases/latest/download/install-server-mcp.sh)"اسکریپت تعاملی است؛ پس باید دقیقاً به همین شکل اجرا شود (نه curl … | bash).
مقادیر موردنیاز:
- هاستنیم عمومی این سرور (مثلاً
srv1-mcp.example.com) - توکن Cloudflare Tunnel همین سرور
- توکن MCP – خالی بگذارید تا خودکار ساخته شود (حداقل ۴۰ کاراکتر)
در پایان آدرس کانکتور چاپ میشود:
https://<hostname>/<MCP_TOKEN>/mcp
آن را در Claude ← Settings ← Connectors ← Add custom connector وارد کنید، گزینهی No sign-in را بزنید و هدری وارد نکنید.
در تونل، یک Public Hostname بسازید: هاستنیم شما ← سرویس http://127.0.0.1:8008
اسکریپت را دوباره اجرا کنید و به سؤال «Reuse» پاسخ n بدهید.
sudo bash -c "$(curl -fsSL https://github.com/archerhabibi/MCP/releases/latest/download/uninstall-server-mcp.sh)"سپس تونل/هاستنیم را از Cloudflare حذف کنید و توکن قبلی را باطلشده بدانید.