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.
shell
git clone https://github.com/yourusername/1panel-mcp-server.git
cd 1panel-mcp-server
shell
npm install
# Or if you use pnpm
pnpm install
shell
cp .env.example .env
.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)
# Start the server
npm start
# For development with auto-reload
npm run dev
.cursor/mcp.json
with the following configuration:json
{
"mcpServers": {
"Deploy to 1Panel": {
"url": "http://localhost:3000/sse"
}
}
}
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
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
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.
This project is an experimental MCP server for automated website deployment to 1Panel. For more details, refer to the GitHub repository.