mcp-rule
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-rulelist my campaigns"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-ruleFor development, you can install from the source code:
git clone https://github.com/swesam/mcp-rule.git
cd mcp-rule
pip install -e .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 subscribersGET /subscribers/{subscriber_id}- Get a specific subscriberPOST /subscribers- Create a new subscriberPUT /subscribers/{subscriber_id}- Update a subscriberDELETE /subscribers/{subscriber_id}- Delete a subscriber
Tags
GET /tags- List tagsPOST /tags- Create a new tag
Campaigns
GET /campaigns- List campaigns
Custom Fields
GET /fields- List custom fieldsPOST /fields- Create a new custom field
Examples
Check out the examples directory for complete usage examples:
basic_usage.py- Direct API client usagemcp_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
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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