Skip to main content
Glama

cPanel MCP Server

MIT License

cPanel MCP Server

An MCP (Model Context Protocol) server that provides AI assistants with the ability to manage email accounts through cPanel's UAPI. This server enables automated email account creation, deletion, configuration, and forwarding management.

Features

  • Email Account Management: Create, delete, and list email accounts
  • Password Management: Change passwords for existing email accounts
  • Quota Management: Set and update mailbox storage limits
  • Email Forwarding: Create, delete, and list email forwarders
  • Client Settings: Retrieve email client configuration settings
  • Secure Authentication: Uses cPanel API tokens for secure access

Available Tools

Email Account Operations

  • add_email_account(email, password, quota=0) - Create a new email account
  • delete_email_account(email) - Delete an existing email account
  • list_email_accounts(domain) - List all email accounts for a domain
  • change_password(email, new_password) - Change an email account password
  • update_quota(email, quota) - Update mailbox size limit
  • get_email_settings(email) - Get email client configuration settings

Email Forwarding Operations

  • create_email_forwarder(email, destination) - Create an email forwarder
  • delete_email_forwarder(email, destination) - Delete an email forwarder
  • list_email_forwarders(domain) - List all forwarders for a domain

Requirements

  • Python 3.10 or higher
  • cPanel hosting account with API access
  • Valid cPanel API token

Installation

When using uv, no installation is necessary. Instead, you can simply invoke the server directly from Github with the uvx command

Configuration

The server requires the following environment variables:

Required Variables

  • USERNAME - Your cPanel username
  • HOSTNAME - Your cPanel hostname (e.g., example.com or server.example.com)
  • CPANEL_API_TOKEN - Your cPanel API token

Optional Variables

  • PORT - cPanel port (default: 2083)
  • SSL - Enable SSL connection (default: true)

Getting a cPanel API Token

  1. Log into your cPanel account
  2. Navigate to SecurityManage API Tokens
  3. Click Create Token
  4. Give it a descriptive name (e.g., "MCP Server")
  5. Set appropriate restrictions if needed
  6. Copy the generated token

Usage

MCP Client Configuration

Add the server to your MCP client configuration (e.g., Claude Desktop):

{ "mcpServers": { "cpanel-mcp": { "command": "uvx", "args": ["cpanel-mcp", "--repository", "https://github.com/ashrobertsdragon/cpanel-mcp"], "env": { "USERNAME": "your_cpanel_username", "HOSTNAME": "your.cpanel.hostname.com", "CPANEL_API_TOKEN": "your_api_token_here" } } } }

Example Usage

Once connected to an MCP client, you can use natural language commands:

Security Considerations

  • API Token Security: Never commit your API token to version control
  • Environment Variables: Use environment variables or secure secret management
  • Network Security: Ensure your cPanel server supports HTTPS (SSL)
  • Password Policy: Use strong passwords for email accounts

Troubleshooting

Common Issues

  1. Authentication Errors
    • Verify your API token is correct and active
    • Check that your username matches your cPanel account
    • Ensure the hostname includes the correct domain/subdomain
  2. Connection Issues
    • Verify the hostname and port are correct
    • Check if SSL is properly configured
    • Ensure your server allows API connections
  3. Permission Errors
    • Verify your cPanel account has email management permissions
    • Check if the API token has the necessary privileges

API Reference

The server uses cPanel's UAPI (Unified API) with the following modules:

  • Email Module: Core email account management
  • Functions Used:
    • add_pop - Create email account
    • del_pop - Delete email account
    • list_pops - List email accounts
    • passwd_pop - Change password
    • edit_pop_quota - Update quota
    • get_client_settings - Get email settings
    • add_forwarder - Create forwarder
    • delete_forwarder - Delete forwarder
    • list_forwarders - List forwarders

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

  • Check the troubleshooting section above
  • Review cPanel's UAPI documentation
  • Open an issue in the project repository

Changelog

v0.1.0

  • Initial release
  • Basic email account management
  • Email forwarding support
  • Quota and password management
  • MCP integration
-
security - not tested
A
license - permissive license
-
quality - not tested

Provides AI assistants with the ability to manage email accounts through cPanel's UAPI, enabling automated email account creation, deletion, configuration, and forwarding management.

  1. Features
    1. Available Tools
      1. Email Account Operations
      2. Email Forwarding Operations
    2. Requirements
      1. Installation
        1. Using uv (Recommended)
      2. Configuration
        1. Required Variables
        2. Optional Variables
      3. Getting a cPanel API Token
        1. Usage
          1. MCP Client Configuration
        2. Example Usage
          1. Security Considerations
            1. Troubleshooting
              1. Common Issues
            2. API Reference
              1. Contributing
                1. License
                  1. Support
                    1. Changelog
                      1. v0.1.0

                    Related MCP Servers

                    • -
                      security
                      F
                      license
                      -
                      quality
                      Enables users to manage Gmail accounts using AI agent-assisted operations via an MCP protocol, supporting email search, reading, deletion, and sending with a voice-powered interface.
                      Last updated -
                      22
                      8
                      TypeScript
                    • A
                      security
                      A
                      license
                      A
                      quality
                      Provides IMAP and SMTP capabilities, enabling developers to manage email services with seamless integration and automated workflows.
                      Last updated -
                      4
                      62
                      Python
                      BSD 3-Clause
                      • Apple
                      • Linux
                    • A
                      security
                      F
                      license
                      A
                      quality
                      An MCP-based email tool that enables AI models to access email services through standardized interfaces, allowing AI assistants to perform various email operations like sending emails, reading inboxes, and handling attachments.
                      Last updated -
                      17
                      28
                      TypeScript
                      • Apple
                      • Linux
                    • A
                      security
                      A
                      license
                      A
                      quality
                      Manage your emails effortlessly with a standardized interface for drafting, sending, retrieving, and organizing messages. Streamline your email workflow with complete Gmail API coverage, including label and thread management.
                      Last updated -
                      65
                      720
                      21
                      JavaScript
                      MIT License
                      • Apple
                      • Linux

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/ashrobertsdragon/cpanel-mcp'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server