Skip to main content

dms-mcp

An MCP server for administering docker-mailserver. Each tool wraps the container's setup script (docker exec -i <container> setup ...), locally or on a remote host over SSH.

Tools

Area Tools
Accounts list_accounts, add_account, update_password, delete_account, list_restrictions, restrict_account
Aliases list_aliases, add_alias (supports @domain catch-all), delete_alias
Quotas set_quota, delete_quota
DKIM generate_dkim, show_dkim_record
Fail2ban fail2ban_status, fail2ban_ban, fail2ban_unban
Ops mail_log (tail + filter), mail_queue, flush_queue, server_status
  • Passwords go over stdin and never appear in process arguments. If you omit the password, the tool generates a 24-character one and returns it.
  • delete_account keeps stored mail unless delete_mail=true.
  • Every input is validated (addresses, domains, IPs, quotas), and in SSH mode every argument is shell-quoted.
  • Tools carry read-only/destructive hints, so MCP clients can ask for confirmation before destructive actions.

Install

No clone needed. Run it straight from PyPI with uv:

uvx dms-mcp --version

or install it as a command with pipx or pip:

pipx install dms-mcp     # or: pip install dms-mcp

Configure

Env var Default Purpose
DMS_CONTAINER mailserver Container name
DMS_SSH_HOST (unset) e.g. admin@mail.example.com, which runs docker on that host over SSH (needs key auth)
DMS_DOCKER_BIN docker Docker binary on the target host
DMS_TIMEOUT 60 Per-command timeout in seconds

Instead of DMS_SSH_HOST, you can also set DOCKER_HOST=ssh://admin@mail.example.com or DOCKER_CONTEXT; the docker CLI handles both natively.

Claude Code

claude mcp add dms -s user \
  -e DMS_SSH_HOST=admin@mail.example.com -e DMS_CONTAINER=mailserver \
  -- uvx dms-mcp

Claude Desktop / Cursor / other clients (mcpServers JSON)

{
  "mcpServers": {
    "dms": {
      "command": "uvx",
      "args": ["dms-mcp"],
      "env": { "DMS_SSH_HOST": "admin@mail.example.com", "DMS_CONTAINER": "mailserver" }
    }
  }
}

If you installed with pipx/pip, use "command": "dms-mcp" and drop args.

Security

Running this server is the same as having shell access to the mail container, and docker access usually means root on that host. Use a dedicated SSH key, and consider restricting it with a command= wrapper in authorized_keys that only allows docker exec -i mailserver ....

Development

python3 -m venv .venv && .venv/bin/pip install -e .
.venv/bin/python tests/test_server.py   # uses a stub docker binary, no server needed

Releasing

CI (.gitea/workflows/ci.yaml) runs the tests on every push and PR. To publish to PyPI:

  1. Bump version in pyproject.toml and commit.
  2. Tag and push: git tag v0.1.0 && git push origin v0.1.0

The publish job checks that the tag matches the version in pyproject.toml, then uploads using the PYPI_API_TOKEN org secret.

Metadata

Release files for dms-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dms-mcp 0.1.0
File Size Uploaded Provenance Actions
dms_mcp-0.1.0.tar.gz 8.5 kB Without provenance Details for dms_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dms-mcp 0.1.0
File Interpreter ABI Platform Actions
dms_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for dms_mcp-0.1.0-py3-none-any.whl

Total release size: 16.6 kB

Release files / dms_mcp-0.1.0.tar.gz

Download URL dms_mcp-0.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
acb37445460dbdbe44eae1aeb86c2f598fd109bec33335b1e829d5c05b4f804d
BLAKE2b-256 checksum
How to use checksums
3e29e6937777ec3880e6178e3e0101bee34c6a779aa2ccd2355bd1f3f75c9eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / dms_mcp-0.1.0-py3-none-any.whl

Download URL dms_mcp-0.1.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ed12788b6d495d2b77113a1530fc8aeb467f7a869112f28d2c74219efd8e020
BLAKE2b-256 checksum
How to use checksums
8461ce20c60fc9b8fbf1c0eaaed041fa83aafaf90977b7a130e458a9a8da88d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for dms-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page