MCP server by Aurora100729
+ "Don't click. Don't type commands. Just describe what you want."
- A new paradigm for server administration — conversational, intentional, magical.
💡 Why this existsTraditional server management means juggling SSH terminals, browser tabs, doc pages, and command-line cheat sheets — every single day.
|
🌟 What's inside
|
Built With
📖 Compass
How It Works ·
Tool Catalog ·
Quick Start ·
CLI Flags ·
MCP Config ·
SSH Remote ·
Examples
Layout ·
Troubleshooting ·
Security ·
Changelog
🏗️ How It Works
一句话:MCP Go SDK 把每个工具暴露给 AI,工具内部用 HTTP 客户端调用 1Panel REST API。
🧬 Architecture in 30 seconds
|
🛠️ Tech Foundation| 组件 | 技术 |
|---|---|
| 语言 | Go 1.25 — 静态编译、零依赖部署 |
| MCP 实现 | |
🧪 单个工具的内部结构(以 stop_process 为例)
// 1. 定义输入类型 — jsonschema tag 自动生成 AI 可读的 schema
type StopProcessInput struct {
PID int `json:"PID" jsonschema:"process ID to stop/kill"`
}
// 2. 注册为 MCP 工具
var StopProcessTool = mcp.NewServerTool[StopProcessInput, any](
"stop_process",
"[DANGEROUS] Kill/stop a running process by PID",
func(ctx context.Context, _ *mcp.ServerSession, params *mcp.CallToolParamsFor[StopProcessInput]) (*mcp.CallToolResultFor[any], error) {
// 3. 调用 1Panel REST API
client := utils.NewPanelClient("POST", "/process/stop",
utils.WithPayload(map[string]interface{}{"PID": params.Arguments.PID}))
var result interface{}
return client.Request(&result)
},
)
每个工具都遵循三段式:Input 类型 → MCP 注册 → HTTP 调用,结构清晰可复用。
🌐 三种传输模式适用场景
| 模式 | 适用场景 | 性能 |
|---|---|---|
| stdio | 本地 MCP 客户端(Claude Desktop / Windsurf / Cursor) | ⚡⚡⚡ 最快,零网络开销 |
| sse | 浏览器或老式 HTTP 客户端 | ⚡⚡ 单向流推送 |
| streamable-http | 现代远程客户端(推荐) | ⚡⚡⚡ 双向 HTTP 流 |
Tool Catalog
📊 Click to expand the full toolset (24 categories · 90+ tools)
| Domain | Count | Signature Tools |
|---|:-:|---|
| 🌐 Generic Passthrough | 1 | panel_request — call any 1Panel endpoint directly |
| 📊 System & Dashboard | 2 | get_system_info · get_dashboard_info |
| 🌍 Websites | 10 | list_websites · create_website · update_website_https |
| 🔐 SSL Certificates | 2 | list_ssls · create_ssl |
| 🛍️ App Store | 9 | app_store_list · install_mysql · install_openresty · app_operate |
| 💾 Databases | 7 | list_databases · create_database · database_backup · redis_status |
| 🐳 Docker Containers | 8 | list_containers · container_create · container_exec · container_logs |
| 🖼️ Docker Images | 5 | list_images · image_pull · image_build · image_prune |
| 🌐 Networks & Volumes | 7 | list_networks · create_volume · delete_network |
| 📜 Docker Compose | 6 | list_compose · compose_up · compose_operate |
| 📁 Files | 11 | panel_file_list · panel_file_read · panel_file_compress · panel_file_wget |
| 🛡️ Firewall | 8 | firewall_status · list_firewall_rules · create_firewall_ip_rule |
| ⏰ Cron Jobs | 5 | list_crons · create_cron · handle_cron |
| 🔧 Processes | 2 | list_processes · stop_process |
| 🔑 SSH Service | 5 | ssh_info · ssh_operate · ssh_logs · ssh_generate_key |
| ⚡ Remote SSH Exec ⭐ | 2 | ssh_remote_exec · ssh_port_check |
| 📝 Logs | 3 | operation_logs · login_logs · system_logs |
| 📈 Monitoring | 2 | monitor_search · monitor_clean |
| 💼 Backups | 4 | list_backup_accounts · backup_operate · database_backup |
| 📷 Snapshots | 4 | list_snapshots · create_snapshot · recover_snapshot |
| ⚙️ System Settings | 5 | get_settings · update_password · update_panel_port · panel_upgrade |
| 🧪 Toolbox | 10 | toolbox_dns · toolbox_hosts · toolbox_swap · toolbox_fail2ban_status |
| 🌱 Runtimes | 3 | list_runtimes · create_runtime · runtime_operate |
| 💻 Local Shell | 1 | shell_exec — local cmd / bash / pwsh |
| 📂 Local Filesystem | 6 | local_file_read · local_file_write · local_file_search |
Full registration code:
main.go::addTools().
⚡ Quick Start
1️⃣ Build from source
git clone https://github.com/Aurora100729/mcp-1panel-full.git
cd mcp-1panel-full
go build -o mcp-1panel-full .
Requires Go 1.25+.
2️⃣ Get a 1Panel API key
1Panel → Profile (top-right) → API Interface → Enable
→ Copy Key → Add your client IP to whitelist ⚠️
3️⃣ Run
# stdio (default — for MCP clients)
./mcp-1panel-full --token YOUR_API_KEY --host http://127.0.0.1:9999
# Streamable HTTP (recommended for HTTP)
./mcp-1panel-full --transport streamable-http --addr 0.0.0.0:8000 \
--token YOUR_API_KEY --host http://127.0.0.1:9999
# SSE (legacy HTTP)
./mcp-1panel-full --transport sse --addr 0.0.0.0:8000 \
--token YOUR_API_KEY --host http://127.0.0.1:9999
4️⃣ Or run with Docker
docker build -t mcp-1panel-full .
docker run -d --name mcp-1panel \
-p 8000:8000 \
mcp-1panel-full \
--transport streamable-http --addr 0.0.0.0:8000 \
--token YOUR_API_KEY \
--host http://host.docker.internal:9999
🎛️ CLI Flags
| 1Panel Connection | Default | Description |
|---|---|---|
--token | required | 1Panel API Key |
--host | required | 1Panel address, e.g. http://127.0.0.1:9999 |
| Transport | Default | Description |
|---|---|---|
--transport | stdio | stdio · sse · streamable-http |
--addr | http://localhost:8000 | HTTP listening address (HTTP transports only) |
| SSH Defaults (optional) | Default | Description |
|---|---|---|
--ssh-host | empty | Default SSH host (IP or domain) |
--ssh-user | empty | Default SSH username |
--ssh-key | empty | Default private key path |
--ssh-password | empty | Default password (plaintext — discouraged) |
--ssh-port | 22 | Default SSH port |
💡 Pre-fill SSH defaults so AI calls only need command.
🔌 MCP Client Config
Windsurf / Claude Desktop / Cursor (click to toggle)
{
"mcpServers": {
"mcp-1panel-full": {
"command": "C:\\path\\to\\mcp-1panel-full.exe",
"args": [
"--token", "YOUR_API_KEY",
"--host", "http://127.0.0.1:9999",
"--ssh-host", "your.server.ip",
"--ssh-user", "ubuntu",
"--ssh-key", "C:\\Users\\You\\.ssh\\id_rsa",
"--ssh-port", "22"
]
}
}
}
Linux / macOS (click to toggle)
{
"mcpServers": {
"mcp-1panel-full": {
"command": "/usr/local/bin/mcp-1panel-full",
"args": [
"--token", "YOUR_API_KEY",
"--host", "http://127.0.0.1:9999"
]
}
}
}
SSH Remote Execution
The crown jewel of this server — a single tool that lets your AI run anything on remote hosts.
📞 Two ways to callOption A — Pass everything per call:
Option B — Use CLI defaults:
|
🔐 Auth methods supported| Field | Purpose |
|---|---|
| Auto-fallback to |
📤 Output format
exit=0
--- stdout ---
ubuntu
VM-0-5-ubuntu
--- stderr ---
Plus structured JSON: { host, user, port, command, stdout, stderr, exitCode }.
💬 Real-World Conversations
Watch how natural language unfolds into precise tool calls.
🩺 "How is my server doing?"
📦 "Install Redis on port 6380."
🗄️ "Backup all my MySQL databases."
|
🔥 "Block IP 1.2.3.4 in firewall."
🐛 "Why is nginx failing?"
⚡ "Free up /tmp on remote server."
|
🗂️ Project Layout
mcp-1panel-full/
│
├── 🚪 main.go # Entry · CLI flags · tool registration
├── 📦 utils/ # HTTP client · helpers
│
├── 🛠️ operations/ # 1Panel API tools — domain-grouped
│ ├── 🌐 generic/ # panel_request passthrough
│ ├── 📊 system/ # System / Dashboard
│ ├── 🌍 website/ # Sites
│ ├── 🔐 ssl/ # SSL certificates
│ ├── 🛍️ app/ # App store
│ ├── 💾 database/ # MySQL · PostgreSQL · Redis
│ ├── 🐳 container/ # Docker · Compose
│ ├── 📁 file/ # File management
│ ├── 🛡️ firewall/ # Firewall rules
│ ├── ⏰ cron/ # Scheduled jobs
│ ├── 🔧 process/ # Process management
│ ├── 🔑 sshmanage/ # SSH service + remote exec ⭐
│ ├── 📝 panellog/ # Audit logs
│ ├── 📈 monitor/ # Performance monitoring
│ ├── 💼 backup/ # Backup / restore
│ ├── 📷 snapshot/ # System snapshots
│ ├── ⚙️ setting/ # System settings
│ ├── 🧪 toolbox/ # DNS · Hosts · Swap · Fail2Ban
│ ├── 🌱 runtime/ # PHP / Node / Python runtimes
│ └── 📐 types/ # Shared types
│
├── 🧰 tools/ # Local capability tools
│ ├── 💻 shell/ # Local shell exec
│ └── 📂 localfs/ # Local filesystem
│
├── 📋 logs/ # Runtime logs (auto-created)
├── 🐳 Dockerfile
├── 📦 go.mod
└── 📖 README.md # ← you are here
🩺 Troubleshooting
dial tcp :22: SSH error
CLI default --ssh-host is not active. Check:
mcp_config.jsonincludes--ssh-host- Restart the MCP client itself (not just refresh tools)
- Inspect
logs/mcp-1panel-full.logfor[ssh] defaults set: ...
请求参数错误 / 1Panel API 400 errors
Some 1Panel endpoints validate required fields strictly. This project pre-fills sensible defaults for hot endpoints (list_databases, list_backup_records, firewall_status, monitor_search).
If something still fails, fall back to panel_request with an explicit payload.
Not Found (code: 404) from 1Panel API
API paths differ between 1Panel versions. This project targets v2.0.15.
For newer or custom routes, use the universal panel_request tool.
Token authentication failed
- Confirm 1Panel API interface is enabled
- Confirm the client IP is in the whitelist
- Tokens are case-sensitive — copy the entire string
transport error: transport closed
The MCP client lost the stdio process. Force a restart:
| Client | Action |
|---|---|
| Windsurf | Ctrl+Shift+P → Reload Window |
| Claude Desktop | Quit completely, then relaunch |
| Cursor | Restart Cursor |
🛡️ Security
⚠️ This tool grants total control — full 1Panel admin + remote SSH exec + local shell. Treat it like root credentials.
Must do
- 🚫 Never run in untrusted or public environments
- 🚫 Never commit tokens / private keys (already gitignored:
*.pem*.key) - 🚫 Avoid
--ssh-passwordin plain config files — use keys - ⚠️ Confirm
[DANGEROUS]tagged tools before executing
Should do
- 🔐 Store private keys at
~/.ssh/withchmod 600 - 🔐 Use a dedicated 1Panel API key with IP allow-listing
- 🔄 Rotate API keys + SSH keys regularly
- 📜 Use read-only credentials for production where possible
📜 Changelog
v1.0.0 2026-04 (click to toggle)
✨ New
ssh_remote_exec&ssh_port_check— password / key / encrypted-key auth- CLI flags
--ssh-host--ssh-user--ssh-key--ssh-password--ssh-portfor sticky defaults - 90+ tool registry · structured output everywhere
🩹 Fixes (1Panel v2.0.15)
firewall_status— adds requirednamefieldmonitor_search— auto-fills time windowlist_databases— correctsorderByvalidationlist_backup_records— defaultstypelist_processes— switches to/process/:pid(/process/listeningremoved upstream)
🛠️ Internal
- Logs path now resolves next to executable — survives any working directory
- Removed duplicate tool registrations (
tools/localssh)
💎 Acknowledgements
|
1Panel Modern Linux panel |
mcp-1panel Original MCP server |
MCP The protocol |
x/crypto/ssh SSH client for Go |
📄 License
Released under GNU General Public License v3.0 — see LICENSE.
Any modification, redistribution or derivative work must remain open under the same license and preserve copyright.
@@ Conversations > Commands. Intent > Syntax. AI > Toil. @@
+ Built with care · Open to all · Made for the curious