Metadata-Version: 2.5
Name: listmonk-mcp
Version: 0.2.0
Summary: MCP server for Listmonk newsletter management
Project-URL: Homepage, https://github.com/rhnvrm/listmonk-mcp
Project-URL: Documentation, https://rhnvrm.github.io/listmonk-mcp/
Project-URL: Repository, https://github.com/rhnvrm/listmonk-mcp
Project-URL: Issues, https://github.com/rhnvrm/listmonk-mcp/issues
Project-URL: Changelog, https://github.com/rhnvrm/listmonk-mcp/blob/master/CHANGELOG.md
Author-email: Rohan Verma <hello@rohanverma.net>
License-Expression: MIT
License-File: LICENSE
Keywords: listmonk,mcp,model-context-protocol,newsletter
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.28.1
Requires-Dist: mcp<2,>=1.30.0
Requires-Dist: pydantic-settings<3,>=2.10
Requires-Dist: pydantic[email]<3,>=2.11
Requires-Dist: typer<1,>=0.16
Provides-Extra: dev
Requires-Dist: aiosmtpd<2,>=1.4.6; extra == 'dev'
Requires-Dist: mypy<2,>=1.18; extra == 'dev'
Requires-Dist: pytest-asyncio<2,>=1; extra == 'dev'
Requires-Dist: pytest-cov<8,>=6; extra == 'dev'
Requires-Dist: pytest-httpx<1,>=0.35; extra == 'dev'
Requires-Dist: pytest<10,>=8.4; extra == 'dev'
Requires-Dist: ruff<1,>=0.14; extra == 'dev'
Requires-Dist: twine<8,>=7; extra == 'dev'
Description-Content-Type: text/markdown

# Listmonk MCP

<img src="docs/_static/logo.png" alt="Listmonk MCP" width="160">

Connect MCP clients to your self-hosted [Listmonk](https://listmonk.app) instance. Manage subscribers and mailing lists, prepare and test campaigns, work with templates and media, and inspect analytics through Listmonk's REST API.

[Documentation](https://rhnvrm.github.io/listmonk-mcp/) · [PyPI](https://pypi.org/project/listmonk-mcp/) · [Changelog](CHANGELOG.md)

## Quick start

Requires Python 3.11+ and a running Listmonk instance. Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then add this configuration to an MCP client that supports stdio servers:

```json
{
  "mcpServers": {
    "listmonk": {
      "command": "uvx",
      "args": ["listmonk-mcp@0.2.0"],
      "env": {
        "LISTMONK_MCP_URL": "https://listmonk.example.com",
        "LISTMONK_MCP_USERNAME": "your-api-user",
        "LISTMONK_MCP_PASSWORD": "your-api-token"
      }
    }
  }
}
```

Create an **API user** in Listmonk's user management screen, assign the permissions and lists it needs, and generate an API token. `LISTMONK_MCP_PASSWORD` is that token, not your dashboard password. Requests use `Authorization: token username:api_token`; Listmonk enforces the user's permissions.

For a persistent installation:

```sh
uv tool install listmonk-mcp==0.2.0
listmonk-mcp --help
listmonk-mcp --version
```

Or install with `pip install listmonk-mcp==0.2.0` in a virtual environment. The client starts the MCP process; there is no separate HTTP listener or hosted MCP endpoint.

## What it supports

- **Campaigns:** search/list, create drafts, edit content, preview, send tests to existing subscribers, schedule, send, pause/cancel, archive, delete, and analytics.
- **Subscribers and lists:** paginated list-name search, subscriber updates, subscription management, activity, opt-in emails, blocklisting, and CSV/ZIP imports.
- **Templates and media:** campaign and transactional templates with subject preservation, previews, defaults, uploads, v7 media tags, and deletion.
- **Operations:** bounces, dashboard data, settings, logs, and maintenance.
- **Resources:** browsable `listmonk://` lists, subscribers, campaigns, templates, previews, and media.

Start with “Find the Weekly News mailing list, create a draft campaign, and send a test to my existing subscriber address.” Creating a campaign does not send it; sending is a separate tool. Tools act with the configured API user's permissions, including write and send access when granted. Bulk bounce operations require an explicit `all=true` to target every bounce.

## Compatibility

v0.2.0 targets the Listmonk v7.0.0-beta.2 API and retains the existing v6 workflows. See the [compatibility notes](https://rhnvrm.github.io/listmonk-mcp/compatibility/) for checked behavior and version-specific settings. The MCP Python SDK is bounded to `>=1.30.0,<2`; SDK 2.x removed the FastMCP interface used here.

## Configuration

Environment variables or a local `.env` file configure the server. Use `listmonk-mcp --config /absolute/path/to/listmonk.env` for an explicit file. See [.env.example](.env.example) and the [configuration reference](https://rhnvrm.github.io/listmonk-mcp/configuration/).

## Development

```sh
git clone https://github.com/rhnvrm/listmonk-mcp.git
cd listmonk-mcp
uv sync --frozen --extra dev
make check
uv build
```

`make check` runs linting, formatting checks, strict source type checks, and tests. CI runs Python 3.11–3.14. Tests use HTTP mocks by default; an opt-in integration suite exercises a disposable Listmonk instance, including a real MCP stdio connection. See [CONTRIBUTING.md](CONTRIBUTING.md).

Documentation is built with [oddship/moat](https://github.com/oddship/moat):

```sh
go install github.com/oddship/moat@latest
moat build docs/ _site/
moat serve _site/
```

## License

[MIT](LICENSE). An independent integration, not an official Listmonk project.
