Back to MCP directory
publicPublicdnsLocal runtime

aaPanel

aaPanel MCP接口服务,提供面板系统管理、PHP网站、MySQL数据库、Docker容器及邮件管理功能

article

README

🚀 aaPanel MCP 接口

aaPanel MCP 接口提供了丰富的功能,可用于获取面板系统信息、管理网站、数据库、Docker 容器和镜像,以及进行电子邮件管理等,能有效提升面板操作的便捷性和效率。

✨ 主要特性

  • 系统与网络信息获取:获取面板系统信息和网络状态。
  • 网站管理:查询 PHP 网站列表,并可创建新的 PHP 网站。
  • 数据库管理:查询 MySQL 数据库列表。
  • Docker 管理
    • 容器管理:查看容器列表及详细信息。
    • 镜像管理:查看本地镜像列表。
  • 电子邮件管理:可添加电子邮件账户并查看电子邮件列表。
  • 配置信息获取:获取面板公共配置信息。
  • 功能持续更新:更多功能正在开发中...

📦 安装指南

从源代码安装

# 克隆仓库
git clone https://github.com/aaPanel/mcp-server.git
cd mcp_btpanel

# 安装依赖项
go mod tidy

# 构建项目
make build

# 构建 Windows 版本
.\build.bat build

直接下载

您也可以从发布页面下载预编译的二进制文件。

📚 详细文档

先决条件

  • Go 1.18+ 版本
  • aaPanel API 访问权限
  • aaPanel API 令牌

配置指南

环境变量配置

通过环境变量配置程序:

# 设置 aaPanel 地址
export BT_BASE_URL="http://your-panel-address:8888"

# 设置 aaPanel API 令牌
export BT_API_TOKEN="your-api-token"

在 Cursor 中配置

在 Cursor 中使用时,按照以下步骤进行配置:

  1. 打开 Cursor 设置 > 扩展 > MCP 工具
  2. 添加新的 MCP 工具
  3. 按照以下格式填写配置:
{
    "mcpServers": {
        "mcp-aapanel": {
            "command": "C:\\path\\to\\mcp-server.exe",
            "env": {
                "BT_BASE_URL": "http://192.168.xx.xx:8888/",
                "BT_API_TOKEN": "xxxxxxxxxxxxxxxxxxxxxxxx"
            }
        }
    }
}

添加新功能

  1. 在相应的模块目录中创建或修改文件
  2. 定义新的工具常量和工具对象
  3. 实现处理函数
  4. 在 main.go 中的 registerTools 函数中注册工具

构建与部署

使用 Makefile 进行构建:

# 构建项目
make build

# 构建 Windows 版本
make build-windows

# 清理构建 artifact
make clean

# 查看更多命令
make help

📄 许可证

该项目 licensed under the MIT License。有关详细信息,请参阅 LICENSE 文件。

🤝 贡献指南

欢迎提交问题和功能请求!如果您希望贡献代码:

  1. 叉取此仓库
  2. 创建或修改功能分支 ( git checkout -b feature/amazing-feature )
  3. 提交更改 ( git commit -m 'Add some amazing feature' )
  4. 推送到分支 ( git push origin feature/amazing-feature )
  5. 提交 Pull Request
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client