Skip to main content
Glama
rulecom

mcp-rule

Official
by rulecom

mcp-rule

A Model Context Protocol (MCP) implementation for the Rule.io marketing automation platform.

Installation

You can install the mcp-rule package directly with the Universal Executor (uvx):

uvx mcp-rule

For development, you can install from the source code:

git clone https://github.com/swesam/mcp-rule.git
cd mcp-rule
pip install -e .

Related MCP server: mailchimp-mcp

Features

This MCP implementation provides a standardized interface to Rule.io's API, allowing you to:

  • Manage subscribers (create, read, update, delete)

  • Work with tags

  • Access campaigns

  • Create and use custom fields

  • Track transactions

  • Set up automations

Direct API Usage

You can use the Rule.io client directly in your Python code:

from mcp_rule import RuleClient

# Initialize the client with your API key
client = RuleClient(api_key="your_api_key_here")

# List subscribers
subscribers = client.get_subscribers(limit=10)
for subscriber in subscribers:
    print(f"{subscriber.email} - Created: {subscriber.created}")

# Create a new subscriber
new_subscriber = client.create_subscriber(
    email="new@example.com",
    tags=["new_user", "newsletter"],
    fields={"first_name": "John", "last_name": "Doe"}
)

# Get tags
tags = client.get_tags()
for tag in tags:
    print(f"{tag.name} - Subscribers: {tag.subscriber_count}")

MCP Usage

The primary purpose of this package is to provide a Model Context Protocol implementation for Rule.io. Here's how to use it with MCP:

import asyncio
import json
from mcp import ContextRequest, ContextRequestMetadata, get_provider

async def example():
    # Get the Rule MCP provider
    provider = get_provider("rule")
    
    # Set up metadata with your API key
    metadata = ContextRequestMetadata(api_key="your_api_key_here")
    
    # Create a request to list subscribers
    request = ContextRequest(
        method="GET",
        path="/subscribers",
        query_params={"limit": "10"},
        metadata=metadata,
    )
    
    # Send the request
    response = await provider.handle_request(request)
    
    # Parse and use the response
    result = json.loads(response.body)
    subscribers = result.get("subscribers", [])
    for subscriber in subscribers:
        print(f"{subscriber['email']}")

# Run the example
asyncio.run(example())

API Endpoints

The following MCP endpoints are available:

Subscribers

  • GET /subscribers - List subscribers

  • GET /subscribers/{subscriber_id} - Get a specific subscriber

  • POST /subscribers - Create a new subscriber

  • PUT /subscribers/{subscriber_id} - Update a subscriber

  • DELETE /subscribers/{subscriber_id} - Delete a subscriber

Tags

  • GET /tags - List tags

  • POST /tags - Create a new tag

Campaigns

  • GET /campaigns - List campaigns

Custom Fields

  • GET /fields - List custom fields

  • POST /fields - Create a new custom field

Examples

Check out the examples directory for complete usage examples:

  • basic_usage.py - Direct API client usage

  • mcp_usage.py - MCP interface usage

Documentation

For more information about the Rule.io API, see:

For details on the Model Context Protocol (MCP), visit:

To-Do

[ ] Add more detailed error handling [ ] Implement more MCP endpoints [ ] Publish to a package registry (e.g., PyPI) [ ] Add unit tests for existing functionality

License

MIT

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    An MCP server for the Keila newsletter API that enables management of contacts, campaigns, segments, and senders. It allows users to create, schedule, and send newsletters directly through natural language interactions.
    17
  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that interfaces with the Mailchimp Marketing API to manage audiences, email campaigns, and subscribers. It enables users to create and schedule campaigns, handle member lists, and send test or live emails through natural language commands.
    13
    23
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    A production-grade MCP server that integrates with the Mailchimp Marketing API to manage campaigns, audiences, members, and reports. It provides 28 specialized tools for automating marketing tasks such as sending emails, managing subscriber tags, and analyzing performance data.
    71
    1
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    Comprehensive MCP server for the Mautic marketing automation API, providing 203 tools for managing contacts, campaigns, emails, segments, and more.
    2

View all related MCP servers

Related MCP Connectors

  • Sequenzy MCP server for AI-powered email marketing automation.

  • Mailchimp MCP Pack — manage audiences, campaigns, and members via Mailchimp Marketing API.

  • MCP server for Appcircle mobile CI/CD platform.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rulecom/mcp-rule'

If you have feedback or need assistance with the MCP directory API, please join our Discord server