Skip to main content

MCP server for Listmonk newsletter management

Project description

Listmonk MCP Server

An MCP (Model Context Protocol) server implementation for Listmonk, providing programmatic access to newsletter and mailing list management functionality.

Listmonk MCP Logo

Project Status

Implementation Complete - The core MCP server is fully implemented and functional.

Goal

Create an MCP server that enables LLMs and AI assistants to interact with Listmonk instances through the Model Context Protocol. This will allow for:

  • Subscriber management (add, remove, update subscribers)
  • Mailing list operations (create, manage lists)
  • Campaign management (create, send newsletters)
  • Analytics and reporting access
  • Template and content management

Architecture

This server will bridge the MCP protocol with Listmonk's REST API, providing a standardized interface for AI models to interact with Listmonk installations.

Features

  • Complete Listmonk API Coverage: All major Listmonk operations supported
  • 18 MCP Tools: Comprehensive subscriber, list, campaign, and template management
  • MCP Resources: Easy access to subscriber, list, campaign, and template data
  • Async Operations: Built with modern async/await patterns
  • Type Safety: Full Pydantic model validation
  • Environment Configuration: Easy setup with environment variables

Installation

Using uv (Recommended)

git clone https://github.com/rhnvrm/listmonk-mcp.git
cd listmonk-mcp

Using pip

git clone https://github.com/rhnvrm/listmonk-mcp.git
cd listmonk-mcp
pip install -e .

Quick Start

1. Set up Listmonk (Local Development)

For testing, you can run a local Listmonk instance using Docker:

# Option 1: Use the provided compose file
docker compose -f docs/listmonk-docker-compose.yml up -d

# Option 2: Download the latest compose file
curl -LO https://github.com/knadh/listmonk/raw/master/docker-compose.yml
docker compose up -d

# Access Listmonk at http://localhost:9000
# Default credentials: admin / listmonk

2. Create API User and Token

  1. Access the Listmonk admin interface at http://localhost:9000/admin
  2. Login with the default credentials: admin / listmonk
  3. Navigate to Admin → Users (http://localhost:9000/admin/users)
  4. Create a new API user:
    • Click "Add new"
    • Enter a username (e.g., api-user)
    • Assign appropriate role/permissions
    • Save the user
  5. Generate an API token:
    • Click on the created user
    • Click "Generate API token"
    • Copy the generated token

3. Configure Environment Variables

The MCP server requires the following environment variables:

export LISTMONK_MCP_URL=http://localhost:9000
export LISTMONK_MCP_USERNAME=your-api-username
export LISTMONK_MCP_PASSWORD=your-generated-api-token

Important: The password field should contain the API token (not the user's login password). The server uses Listmonk's token authentication format: Authorization: token username:api_token.

Troubleshooting Configuration:

  • Verify variables: echo $LISTMONK_MCP_URL should show your Listmonk URL
  • Test API access: curl -H "Authorization: token username:api_token" http://localhost:9000/api/health
  • Common errors: "invalid session" or 403 errors indicate incorrect credentials

4. Run the MCP Server

# Using uv (recommended)
uv run python -m listmonk_mcp.server

# Or using the entry point
listmonk-mcp

Common Issues:

  • Connection refused: Listmonk server not running or wrong URL
  • Module not found: Install dependencies with uv install or pip install -e .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

listmonk_mcp-0.0.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

listmonk_mcp-0.0.1-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file listmonk_mcp-0.0.1.tar.gz.

File metadata

  • Download URL: listmonk_mcp-0.0.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for listmonk_mcp-0.0.1.tar.gz
Algorithm Hash digest
SHA256 092d265656c3d2c2c1e8b2116f021cb5d91ad75695e737f5c938412357964b40
MD5 59258c15b51cc898080e5deefc2fed22
BLAKE2b-256 ce24751d0588b371dd2d9adfe99432dda1902d188800b1f853ff65a5ee879aad

See more details on using hashes here.

Provenance

The following attestation bundles were made for listmonk_mcp-0.0.1.tar.gz:

Publisher: publish.yml on rhnvrm/listmonk-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file listmonk_mcp-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: listmonk_mcp-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for listmonk_mcp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65703819723a95779ce2207e8e6830c00fc208c4994cd6685aceac59d1dddb6a
MD5 ac7ad9e6437c75f4db6d4093fecb5c85
BLAKE2b-256 ad6a6ca14ecaef491f049b81c695b318c6e103c4b2038c84cc62f05c94a6ccfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for listmonk_mcp-0.0.1-py3-none-any.whl:

Publisher: publish.yml on rhnvrm/listmonk-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page