1Panel MCP Server

by ruibaby
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows for automated website deployment to 1Panel servers, including creating websites if they don't exist, uploading static website files, and providing deployment statistics.

  • Provides video demonstration capabilities, with a specific demo video hosted on Bilibili showcasing the 1Panel deployment functionality.

1Panel MCP 服务器

用于将网站自动部署到 1Panel 的模型上下文协议 (MCP)服务器。

[!IMPORTANT] 目前,该项目是一个实验项目,并不意味着可以直接使用。

视频演示

https://www.bilibili.com/video/BV1SjQRY3EmM/

特征

  • 自动将网站部署到 1Panel 服务器
  • 如果网站尚不存在,则创建网站
  • 将静态网站文件上传到 1Panel
  • 完全兼容MCP标准协议

安装

# Clone the repository git clone https://github.com/yourusername/1panel-mcp-server.git cd 1panel-mcp-server # Install dependencies npm install # Or if you use pnpm pnpm install # Configure environment variables cp .env.example .env

使用您的 1Panel 服务器信息编辑.env文件:

PORT=3000 ONEPANEL_BASE_URL=http://your-1panel-ip:port/api/v1 ONEPANEL_API_KEY=your_api_key ONEPANEL_LANGUAGE=zh # Language options: zh (Chinese) or en (English)

用法

启动服务器

# Start the server npm start # For development with auto-reload npm run dev

在 Cursor IDE 中配置 MCP

要将此服务器与 Cursor IDE 一起使用,请添加以下 MCP 配置:

  1. 打开游标
  2. 创建.cursor/mcp.json
{ "mcpServers": { "Deploy to 1Panel": { "url": "http://localhost:3000/sse" } } }

使用 MCP 部署网站

在 Cursor 中,您可以在 AI 聊天中使用以下命令部署网站:

Deploy to 1Panel with domain=yourdomain.com

或者您可以使用以下格式:

Deploy website to 1Panel server, domain: yourdomain.com

API 参考

MCP 工具:deploy_website

将网站部署到 1Panel。

参数:

  • domain (必填):网站域名
  • buildDir (可选):构建目录路径

回复:

Successfully deployed to 1Panel! Domain: yourdomain.com URL: http://yourdomain.com Upload statistics: - Total files: 25 - Successfully uploaded: 25 - Failed to upload: 0

实现细节

部署过程

  1. 检查构建目录:验证指定的构建目录是否存在
  2. 网站创建:如果不存在,则通过 1Panel API 创建一个新的静态网站
  3. 文件上传:将构建目录中的所有文件上传到网站
  4. 统计信息:返回有关上传过程的详细统计信息

故障排除

如果遇到部署问题,请检查以下内容:

  1. 确保您的 API 密钥有效并且具有足够的权限
  2. 验证网站目录存在且具有写入权限
  3. 检查 1Panel 服务器日志以获取更多详细的错误信息
  4. 如果文件上传失败,可能是由于文件权限或格式问题
-
security - not tested
F
license - not found
-
quality - not tested

一个实现模型上下文协议的实验服务器,用于自动将网站部署到 1Panel 服务器,允许用户通过自然语言命令创建网站和上传静态文件。

  1. Video demo
    1. Features
      1. Installation
        1. Usage
          1. Start the server
          2. Configure MCP in Cursor IDE
          3. Use MCP to Deploy Websites
        2. API Reference
          1. MCP Tool: deploy_website
        3. Implementation Details
          1. Deployment Process
        4. Troubleshooting
          ID: oll043mmpu