proton4444/patreon-mcp
3.1
If you are the rightful owner of patreon-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server designed for Patreon creators to manage content creation, automation, and analytics.
Tools
4
Resources
0
Prompts
0
Patreon MCP Server
A Model Context Protocol (MCP) server for managing Patreon content creation, automation, and analytics. This server provides tools for creating posts, managing collections, automating browser interactions, and handling file operations for Patreon creators.
Features
🚀 Core Tools
- File Manager: Create, read, write, delete, and organize files and directories
- Browser Automation: Automate Patreon interactions using Playwright
- Post Creator: Create, publish, schedule, and manage Patreon posts
- Collection Manager: Organize posts into collections and series
📝 Post Management
- Create drafts and publish posts
- Schedule posts for future publication
- Support for text, image, video, audio, and poll posts
- Tier-based access control (public, patron-only, tier-specific)
- Media attachment handling
- Tag management
🗂️ Collection Features
- Create and manage post collections
- Series support with ordered posts
- Collection metadata and cover images
- Bulk operations on collections
🤖 Browser Automation
- Headless browser support (Chromium, Firefox, WebKit)
- Screenshot capture
- Element interaction (click, type, hover)
- Text extraction
- Navigation and waiting for elements
📁 File Operations
- File and directory management
- Copy, move, and delete operations
- Directory listing
- Content reading and writing
Installation
Prerequisites
- Node.js 18+
- npm or yarn
- Patreon Creator account
- Patreon API credentials
Setup
- Clone and install dependencies:
git clone <repository-url>
cd patreon-mcp
npm install
- Install Playwright browsers:
npm run playwright:install
- Configure environment:
cp .env.example .env
# Edit .env with your Patreon API credentials
- Initialize TypeScript:
npm run build
Configuration
Environment Variables
Copy .env.example to .env and configure the following:
Required Patreon API Settings
PATREON_CLIENT_ID=your_client_id_here
PATREON_CLIENT_SECRET=your_client_secret_here
PATREON_ACCESS_TOKEN=your_access_token_here
PATREON_REFRESH_TOKEN=your_refresh_token_here
PATREON_CAMPAIGN_ID=your_campaign_id_here
Browser Settings
BROWSER_HEADLESS=true
BROWSER_TYPE=chromium
BROWSER_WIDTH=1280
BROWSER_HEIGHT=720
File Paths
DRAFTS_PATH=./drafts
COLLECTIONS_PATH=./collections
MEDIA_PATH=./media
LOGS_PATH=./logs
Getting Patreon API Credentials
- Go to Patreon Developer Portal
- Create a new client application
- Note your Client ID and Client Secret
- Set up OAuth redirect URI
- Obtain access and refresh tokens through OAuth flow
Usage
Development
npm run dev
Production
npm run build
npm start
Available Scripts
npm run dev- Start development server with hot reloadnpm run build- Build TypeScript to JavaScriptnpm start- Start production servernpm run playwright:install- Install Playwright browsers
MCP Tools
File Manager Tool
{
"name": "file_manager",
"arguments": {
"action": "create|read|write|delete|list|copy|move",
"path": "/path/to/file",
"content": "file content",
"destination": "/destination/path",
"recursive": true
}
}
Browser Automation Tool
{
"name": "browser_automation",
"arguments": {
"action": "navigate|click|type|screenshot|extract_text|wait_for_element|scroll",
"url": "https://patreon.com",
"selector": ".css-selector",
"text": "text to type",
"browser": "chromium|firefox|webkit",
"headless": true
}
}
Post Creator Tool
{
"name": "post_creator",
"arguments": {
"action": "create_draft|publish_post|schedule_post|update_post|delete_post",
"title": "Post Title",
"content": "Post content",
"type": "text|image|video|audio|poll",
"tier": "public|patron_only|tier_1|tier_2|tier_3",
"tags": ["tag1", "tag2"],
"media_paths": ["/path/to/image.jpg"],
"schedule_date": "2024-01-01T12:00:00Z"
}
}
Collection Manager Tool
{
"name": "collection_manager",
"arguments": {
"action": "create_collection|add_to_collection|remove_from_collection|list_collections|get_collection|update_collection|delete_collection",
"collection_id": "collection_123",
"name": "Collection Name",
"description": "Collection description",
"post_ids": ["post_1", "post_2"],
"is_series": true,
"cover_image": "/path/to/cover.jpg"
}
}
Project Structure
patreon-mcp/
├── src/
│ ├── index.ts # Main server entry point
│ ├── tools/ # MCP tool implementations
│ │ ├── file-manager.ts
│ │ ├── browser-automation.ts
│ │ ├── post-creator.ts
│ │ └── collection-manager.ts
│ ├── types/ # TypeScript type definitions
│ │ └── patreon.ts
│ └── utils/ # Utility functions
│ ├── logger.ts
│ └── config.ts
├── tests/ # Test files
│ └── fixtures/ # Test fixtures
├── drafts/ # Draft posts storage
├── collections/ # Collections storage
├── media/ # Media files
├── logs/ # Application logs
├── .env.example # Environment variables template
├── package.json
├── tsconfig.json
└── README.md
Data Storage
Local File Storage
- Drafts: Stored as JSON files in
./drafts/ - Collections: Stored as JSON files in
./collections/ - Media: Files stored in
./media/ - Logs: Application logs in
./logs/
Data Format Examples
Post Draft
{
"id": "post_1234567890_abc123",
"title": "My Awesome Post",
"content": "This is the post content...",
"type": "text",
"tier": "patron_only",
"status": "draft",
"tags": ["update", "news"],
"media_attachments": [],
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:00:00Z"
}
Collection
{
"id": "collection_1234567890_def456",
"name": "Tutorial Series",
"description": "A series of tutorial posts",
"post_ids": ["post_1", "post_2", "post_3"],
"tags": ["tutorial", "series"],
"is_series": true,
"post_count": 3,
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:00:00Z"
}
Logging
The server includes comprehensive logging with:
- Multiple log levels (debug, info, warn, error)
- File rotation
- Colored console output
- Structured logging with timestamps
- Tool-specific logging contexts
Error Handling
- Comprehensive error catching and logging
- Graceful degradation for non-critical failures
- Detailed error messages for debugging
- Automatic cleanup of resources
Security Considerations
- Environment variables for sensitive data
- No hardcoded credentials
- Secure file path handling
- Input validation and sanitization
- Browser automation in sandboxed environment
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and questions:
- Check the logs in
./logs/ - Verify your
.envconfiguration - Ensure Playwright browsers are installed
- Check Patreon API credentials and permissions
Roadmap
- Analytics and reporting tools
- Webhook support for real-time updates
- Database integration options
- Advanced scheduling features
- Bulk import/export functionality
- Integration with other social platforms
- Advanced media processing
- Template system for posts