webmin-mcp-server

webmin-mcp-server

MCP server for Webmin system administration. 61 tools across 12 modules covering system monitoring, services, users, cron, packages, files, storage (SMART + LVM), security (Fail2ban), MySQL databases, Webmin ACL, and disk quotas. Four-tier safety framework with safe mode on by default. Python, MIT license, Docker and local deployment supported.

Category
访问服务器

README

Webmin MCP Server

License: MIT Python 3.11+ Docker MCP

An MCP (Model Context Protocol) server that provides Claude with tools to manage Linux systems via Webmin's administration interface.

Features

  • Multi-Server Support -- Manage multiple Webmin servers with user-friendly aliases
  • System Monitoring -- System info, memory, disk, network, and process status
  • Service Management -- Start, stop, restart, enable, and disable services
  • User & Group Administration -- Create, modify, and delete system users and groups
  • Scheduled Tasks -- View, create, edit, and delete cron jobs
  • Package Management -- Package info and available updates
  • File Operations -- Read, write, copy, rename, and delete remote files
  • Storage -- SMART disk health monitoring and LVM volume management
  • Security -- Fail2ban jail status and banned IP management
  • Database -- MySQL databases, users, and server status
  • Webmin ACL -- Manage Webmin user accounts and module permissions
  • Disk Quotas -- Monitor and set disk quota limits for users and groups
  • Audit & Backup -- Webmin action logs, SSH config, and configuration backups
  • Safety Framework -- Tiered safety system with safe mode to prevent dangerous operations

Quick Start

  1. Install (choose one):

    From source:

    git clone https://github.com/gjenkins20/webmin-mcp-server.git
    cd webmin-mcp-server
    pip install -e .
    

    With Docker:

    docker pull gjenkins20/webmin-mcp-server
    
  2. Configure -- Create a webmin-servers.json (see Configuration):

    {
      "default_server": "my-server",
      "servers": {
        "my-server": {
          "host": "192.168.1.100",
          "port": 10000,
          "username": "admin",
          "password": "your-password",
          "use_https": true,
          "verify_ssl": false,
          "safe_mode": true
        }
      }
    }
    
  3. Add to Claude Desktop (claude_desktop_config.json):

    From source:

    {
      "mcpServers": {
        "webmin": {
          "command": "python",
          "args": ["-m", "src.server"],
          "cwd": "/path/to/webmin-mcp-server",
          "env": {
            "WEBMIN_CONFIG_FILE": "/path/to/webmin-servers.json"
          }
        }
      }
    }
    

    With Docker:

    {
      "mcpServers": {
        "webmin": {
          "command": "docker",
          "args": [
            "run", "--rm", "-i",
            "-v", "/path/to/webmin-servers.json:/app/webmin-servers.json:ro",
            "gjenkins20/webmin-mcp-server"
          ]
        }
      }
    }
    

Requirements

  • Python 3.11+
  • A running Webmin instance (typically on port 10000)
  • Webmin credentials with appropriate permissions

Webmin Server Setup

The MCP server uses Webmin's XML-RPC API. Ensure your Webmin server is configured:

  1. Enable RPC Access: In Webmin -> Webmin Users -> (your user) -> enable "Can accept RPC calls"
  2. Install XML::Parser: The Perl XML::Parser module must be installed:
    # Debian/Ubuntu
    sudo apt install libxml-parser-perl
    
    # RHEL/CentOS
    sudo yum install perl-XML-Parser
    
  3. Module Access: Grant the user access to required modules (System Status, Bootup and Shutdown, Users and Groups, Scheduled Cron Jobs, Network Configuration)

Configuration

Multi-Server Configuration (Recommended)

Create a webmin-servers.json file to manage multiple Webmin servers. See webmin-servers.example.json for a complete example.

Configuration sources (priority order):

  1. WEBMIN_CONFIG_FILE env var -- path to JSON config file
  2. WEBMIN_SERVERS_JSON env var -- inline JSON string
  3. ./webmin-servers.json -- local file in current directory
  4. ~/.config/webmin-mcp/servers.json -- user config directory
  5. Legacy WEBMIN_* env vars -- single server (creates "default" alias)

Single Server Configuration (Legacy)

For a single server, set environment variables:

export WEBMIN_HOST="your-webmin-server.com"
export WEBMIN_PORT="10000"
export WEBMIN_USERNAME="admin"
export WEBMIN_PASSWORD="your-password"
export WEBMIN_USE_HTTPS="true"
export WEBMIN_VERIFY_SSL="true"  # Set to false for self-signed certs

Or create a .env file (see .env.example).

Using Multiple Servers

With multi-server configuration, all tools accept an optional server parameter:

"Get system info from pi1"           -> Uses pi1 (default)
"Check disk usage on web-server"     -> Uses web-server
"List services on server: nas"       -> Uses nas

Use list_webmin_servers to see all configured servers and their aliases.

Available Tools

All tools accept an optional server parameter to target a specific Webmin server. See the full API reference for detailed parameters and response formats.

Category Tools Description
Server list_webmin_servers, test_server_connection, get_webmin_version Manage and test server connections
System get_system_info, get_memory_usage, get_system_time, list_runlevels, list_processes System monitoring and information
Services list_services, get_service_status, start_service, stop_service, restart_service, enable_service, disable_service Service lifecycle management
Users & Groups list_users, list_groups, create_user, modify_user, delete_user, change_password User and group administration
Cron list_cron_jobs, create_cron_job, edit_cron_job, delete_cron_job Scheduled task management
Network get_network_info Interface and routing details
Packages get_package_info, list_available_updates, get_package_count Package information and updates
Files read_file, write_file, delete_file, copy_file, rename_file, create_directory Remote file operations
Storage get_disk_usage, list_mounts, list_disks, get_disk_health, list_volume_groups, list_logical_volumes Disk, mount, SMART, and LVM management
SSH get_ssh_config SSH server configuration
Audit list_webmin_logs, list_backups Action logs and backups
Security list_fail2ban_jails, get_fail2ban_status, list_banned_ips Fail2ban intrusion prevention
Database list_mysql_databases, list_mysql_users, get_mysql_status MySQL database management
Webmin ACL list_webmin_users, get_webmin_user, list_webmin_modules, create_webmin_user, modify_webmin_user, delete_webmin_user Webmin user and permission management
Disk Quotas list_quota_filesystems, list_user_quotas, get_user_quota, get_group_quota, set_user_quota Disk quota monitoring and management

Safety Framework

The server includes a tiered safety system to prevent accidental damage.

Safety Tiers

Tier Description Safe Mode
Read No system changes Always allowed
Safe Low-risk changes Allowed
Moderate Reversible changes May block critical services
Dangerous Destructive operations Blocked

Safe Mode

Safe mode is enabled by default. When active:

  • Dangerous operations are blocked (user creation/deletion, password changes, cron deletion)
  • Critical services (ssh, webmin, systemd-*, dbus) cannot be stopped
  • File writes/deletes are restricted to /tmp and /var/tmp
  • Critical system users and paths are protected

Configure per-server in webmin-servers.json:

{
  "servers": {
    "production": { "safe_mode": true },
    "development": { "safe_mode": false }
  }
}

Or globally via environment: export WEBMIN_SAFE_MODE=false

Docker

Pull from Docker Hub

docker pull gjenkins20/webmin-mcp-server

Build locally

docker build -t webmin-mcp-server .

Run standalone

# With config file
docker run --rm -i \
  -v /path/to/webmin-servers.json:/app/webmin-servers.json:ro \
  gjenkins20/webmin-mcp-server

# With environment variables
docker run --rm -i \
  -e WEBMIN_HOST=192.168.1.100 \
  -e WEBMIN_USERNAME=admin \
  -e WEBMIN_PASSWORD=your-password \
  gjenkins20/webmin-mcp-server

Tagging strategy

Tag Description
latest Latest build from main branch
0.1.0 Specific release version
0.1 Latest patch for minor version
abc1234 Specific commit SHA

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Lint and format
ruff check src tests
ruff format src tests

# Type check
mypy src

See CONTRIBUTING.md for guidelines on contributing to the project.

Project Structure

webmin-mcp-server/
├── src/
│   ├── server.py         # MCP server setup
│   ├── webmin_client.py  # Webmin API client
│   ├── config.py         # Configuration management
│   ├── models.py         # Pydantic models
│   └── tools/            # MCP tool implementations
├── tests/                # Test suite
├── docs/
│   ├── api-reference.md  # Full API documentation
│   └── webmin_api_map.md # Webmin API endpoint mapping
├── .github/workflows/    # CI/CD (Docker build & push)
├── Dockerfile
└── webmin-servers.example.json

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选