1Panel MCP Server 是 1Panel 的模型上下文协议(MCP)服务器的实现。
访问 发布页面 并下载与您的系统对应的可执行文件。
示例安装(适用于 amd64):
chmod +x mcp-1panel-linux-amd64
mv mcp-1panel-linux-amd64 /usr/local/bin/mcp-1panel

确保本地已安装 Go 1.23 或更高版本。然后运行:
git clone https://github.com/1Panel-dev/mcp-1panel.git
cd mcp-1panel

make build
将 ./build/mcp-1panel 移动到系统 PATH 包含的目录中。
确保本地已安装 Go 1.23 或更高版本。然后运行:
go install github.com/1Panel-dev/mcp-1panel@latest
确保您的机器上已正确安装并配置了 Docker。
官方镜像支持以下架构:
1Panel MCP Server 支持两种运行模式:stdio 和 sse。
在 Cursor 或 Windsurf 的配置文件中添加:
{
"mcpServers": {
"mcp-1panel": {
"command": "mcp-1panel",
"env": {
"PANEL_ACCESS_TOKEN": "<您的 1Panel 访问令牌>",
"PANEL_HOST": "例如 http://localhost:8080"
}
}
}
}

{
"mcpServers": {
"mcp-1panel": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PANEL_HOST",
"-e",
"PANEL_ACCESS_TOKEN",
"1panel/1panel-mcp-server"
],
"env": {
"PANEL_HOST": "例如 http://localhost:8080",
"PANEL_ACCESS_TOKEN": "<您的 1Panel 访问令牌>"
}
}
}
}

mcp-1panel -host http://localhost:8080 -token <您的 1Panel 访问令牌> -transport sse -addr http://localhost:8000
{
"mcpServers": {
"mcp-1panel": {
"url": "http://localhost:8000/sse"
}
}
}

-token: 1Panel 访问令牌-host: 1Panel 访问地址-transport: 传输类型(stdio 或 sse,默认:stdio)-addr: 启动 SSE 服务器地址(默认:http://localhost:8000)服务器提供了多种工具用于与 1Panel 交互:
| 工具 | 类别 | 描述 |
|---|---|---|
| get_dashboard_info | 系统 | 列出仪表板状态 |
| get_system_info | 系统 | 获取系统信息 |
| list_websites | 网站 | 列出所有网站 |
| create_website | 网站 | 创建网站 |
| list_ssls | 证书 | 列出所有证书 |
| create_ssl | 证书 | 创建证书 |
| list_installed_apps | 应用 | 列出已安装的应用 |
| install_openresty | 应用 | 安装 OpenResty |
| install_mysql | 应用 | 安装 MySQL |
| list_databases | 数据库 | 列出所有数据库 |
| create_database | 数据库 | 创建数据库 |