ruibaby_1panel_mcp

ruibaby_1panel_mcp

by ruibaby
A MCP server for automating website deployment to 1Panel, including website creation and file upload.

1Panel MCP Server for Automated Website Deployment

Overview

The 1Panel MCP Server is a specialized tool designed for automated website deployment to 1Panel servers. It leverages the Model Context Protocol (MCP) to streamline the process of creating and uploading static websites. This project is currently experimental and not yet ready for production use.

Video Demo

Features

  • Automated Deployment: Automates the deployment of websites to 1Panel servers.
  • Website Creation: Creates websites if they don’t already exist.
  • File Upload: Uploads static website files to 1Panel.
  • MCP Compatibility: Fully compatible with the MCP standard protocol.

Installation

  1. Clone the repository:
    shell git clone https://github.com/yourusername/1panel-mcp-server.git cd 1panel-mcp-server
  2. Install dependencies:
    shell npm install # Or if you use pnpm pnpm install
  3. Configure environment variables:
    shell cp .env.example .env
  4. Edit the .env file with your 1Panel server information:
    shell 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)

Usage

Start the Server

# Start the server
npm start

# For development with auto-reload
npm run dev

Configure MCP in Cursor IDE

  1. Open Cursor.
  2. Create .cursor/mcp.json with the following configuration:
    json { "mcpServers": { "Deploy to 1Panel": { "url": "http://localhost:3000/sse" } } }

Deploy Websites

In Cursor, use the following command in the AI chat:

Deploy to 1Panel with domain=yourdomain.com

Or:

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

API Reference

MCP Tool: deploy_website

Deploys a website to 1Panel.

Parameters:
- domain (required): Website domain.
- buildDir (optional): Build directory path.

Response:

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

Implementation Details

Deployment Process

  1. Check Build Directory: Verifies if the specified build directory exists.
  2. Website Creation: Creates a new static website through 1Panel API if it doesn’t exist.
  3. File Upload: Uploads all files from the build directory to the website.
  4. Statistics: Returns detailed statistics about the upload process.

Troubleshooting

If you encounter deployment issues:
1. Ensure your API Key is valid and has sufficient permissions.
2. Verify that the website directory exists and has write permissions.
3. Check the 1Panel server logs for more detailed error information.
4. If file uploads fail, it may be due to file permission or format issues.

About

This project is an experimental MCP server for automated website deployment to 1Panel. For more details, refer to the GitHub repository.

Resources

Stats

  • Stars: 3
  • Watchers: 1
  • Forks: 0

Languages

  • JavaScript: 100.0%

Features & Capabilities

Categories
mcp_server model_context_protocol javascript api_integration automation 1panel website_deployment

Implementation Details

Stats

0 Views
0 Likes
3 GitHub Stars

Repository Info

ruibaby Organization

Similar Servers

continuedev_continue by continuedev
0
0
0