SuperAPI AI Directory

wg-easy-mcp

Administer a self-hosted wg-easy (WireGuard Easy) instance: manage VPN clients, fetch configs and QR codes, create one-time links and check server status.

Open website

About this tool

wg-easy-mcp is a Model Context Protocol (MCP) server for managing wg-easy (WireGuard Easy) instances, with the repository at https://github.com/ni-c/wg-easy-mcp。它让 MCP clients such as Claude Code, Claude Desktop, and Codex can manage a WireGuard VPN: list, create, update, enable/disable, and delete clients, retrieve configuration files and QR codes, and check server status, all through the wg-easy v15 REST API.

Main capabilities:

  • Complete client lifecycle management through the wg-easy v15 REST API, including .conf files, QR codes, and one-time download links.
  • Partial updates are merged: update operations read the current client state and change only the specified fields, rather than overwriting the remaining fields with default values.
  • disable_client is deliberately not gated: other write operations first ask a human via MCP elicitation, whereas this operation only revokes access.
  • Eleven tools are an upper bound rather than a lower bound: setting WG_EASY_ALLOW_TOOLS=essential registers a curated set of six tools, and a model choosing the right tool from six is more reliable than from eleven.
  • The essential preset includes: get_server_info, list_clients, get_client, create_client, enable_client, disable_client. get_client_config, get_client_qrcode, and generate_one_time_link are not among them, nor is delete_client: these four either irreversibly destroy content or hand over the peer's private key.
  • Filtering can be done via WG_EASY_ALLOW_TOOLS and WG_EASY_DENY_TOOLS with comma-separated tool names, where a trailing * matches an entire tool family; an entry that matches no tools causes startup to abort and names that entry.
  • Structured output is provided: every tool declares an outputSchema and returns structuredContent alongside a text block.
  • Everything returned by the wg-easy API carries explicit untrusted-data markers and a 60,000-character budget.
  • Sensitive fields are redacted: field names are matched by suffix against password, passwd, passphrase, secret, token, apiKey, privateKey, preSharedKey, and any field starting with totp, with the value replaced by [redacted].
  • Response bodies are capped (8 MiB, rejected based on the declared content-length before reading any bytes), and the status is read before the body.

Usage: Configure via environment variables. You must use https://,明文 An http URL causes Basic Auth credentials and all WireGuard private keys to be transmitted unencrypted; unless the host is a local address, the server prints a warning. For self-signed certificates, a proper internal CA is recommended instead of WG_EASY_INSECURE_TLS. Without credentials, the server still starts and lists tools, but every tool call fails with setup instructions instead of accessing the wg-easy API.

Requirements:

  • A running wg-easy v15+ instance.
  • The account used by this server must have 2FA (TOTP) disabled—the wg-easy API only supports Basic Authentication and does not work when 2FA is enabled.
  • Note: the wg-easy REST API has not been declared stable and may change between versions; this server targets wg-easy v15.

Deployment:

  • Can be added to claude_desktop_config.json or ~/.codex/config.toml.
  • Multi-architecture images are provided (linux/amd64, linux/arm64), with SBOM and build provenance, published to the GitHub Container Registry.
  • The image uses MCP over stdio; clients need docker run -i (no ports exposed).
  • Clients that cannot start local processes (such as ChatGPT connectors, Claude on the web, Cursor, LibreChat) can access wg-easy-mcp through mcp-hub: a single container serves multiple stdio MCP servers over Streamable HTTP, with OAuth 2.1 login behind a single password and long-lived tokens for clients that cannot use OAuth.

Security and limitations:

  • The five tools create_client, update_client, enable_client, delete_client, and generate_one_time_link first ask a human via MCP elicitation; when the client cannot display a dialog, it falls back to a random token that is valid for 5 minutes and bound to the exact target.
  • Approval is bound to the exact edit, so approving a rename does not authorize a later call that expands routes.
  • disable_client is intentionally left ungated: it only revokes access.
  • WG_EASY_READ_ONLY=true registers only list_clients, get_client, and get_server_info; although get_client_config and get_client_qrcode are reads, they are not in that set because they read client private keys in plaintext.
  • get_client_config and get_client_qrcode return client private keys, and the URL generated by generate_one_time_link allows unauthenticated configuration downloads—tool output should be treated as sensitive.
  • A WG_EASY_URL containing embedded credentials (user:password@host) is rejected at startup.
  • WG_EASY_INSECURE_TLS only relaxes certificate verification for the wg-easy connection; it does not disable TLS verification process-wide.
  • Explicitly not exposed: server management; the tools cover only the client lifecycle, and the instance's own configuration, admin account, and host are not in the tool list.
  • Only wg-easy v15 or newer is supported; older versions use a different session-based API, which this server does not implement.

More information: the full guide, tool reference, and security notes are at wg-easy-mcp.ni-c.de (source in docs/). The full trust model is in SECURITY.md. Licensed under MIT © Willi Thiel.