README
🚀 1Panel MCP 服务器
1Panel MCP Server 是 1Panel 的 Model Context Protocol (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 install 安装
确保本地已安装 Go 1.23 或更高版本,然后运行:
go install github.com/1Panel-dev/mcp-1panel@latest
方法四:通过 Docker 安装
确保 Docker 已正确安装并配置在您的机器上。官方镜像支持以下架构:
- amd64
- arm64
- arm/v7
- s390x
- ppc64le
💻 使用示例
1Panel MCP 服务器支持两种运行模式:stdio 和 sse。
基础用法
stdio 模式
- 使用本地二进制文件 在 Cursor 或 Windsurf 的配置文件中添加:
{
"mcpServers": {
"mcp-1panel": {
"command": "mcp-1panel",
"env": {
"PANEL_ACCESS_TOKEN": "<your 1Panel access token>",
"PANEL_HOST": "such as http://localhost:8080"
}
}
}
}
- 使用 Docker 运行
{
"mcpServers": {
"mcp-1panel": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PANEL_HOST",
"-e",
"PANEL_ACCESS_TOKEN",
"1panel/1panel-mcp-server"
],
"env": {
"PANEL_HOST": "such as http://localhost:8080",
"PANEL_ACCESS_TOKEN": "<your 1Panel access token>"
}
}
}
}
sse 模式
- 启动 MCP 服务器:
mcp-1panel -host http://localhost:8080 -token <your 1Panel access token> -transport sse -addr http://localhost:8000
- 在 Cursor 或 Windsurf 中配置:
{
"mcpServers": {
"mcp-1panel": {
"url": "http://localhost:8000/sse"
}
}
}
高级用法
以下是命令行选项说明:
-token: 1Panel 访问令牌-host: 默认监听地址-transport: 支持的传输类型(默认为 http)-addr: 监听地址和端口-loglevel: 日志级别-version: 显示版本信息
📚 详细文档
MCP 服务器提供了以下工具:
| 属性 | 详情 |
|------|------|
| 工具名 | mcp-server、mcp-client、mcp-config、mcp-monitor、mcp-database、mcp-proxy |
| 功能描述 | 分别用于启动 MCP 服务器、与 MCP 服务器交互、配置和管理 MCP 服务器的配置文件、监控 MCP 服务器的状态和性能指标、管理与 MCP 服务器关联的数据库、设置代理以转发请求到 MCP 服务器 |
这些工具可以帮助您更好地管理和监控 MCP 服务器。
Scan to contact