Beehiiv Analytics MCP Server
This server provides read-only access to Beehiiv publication analytics and content data through the Model Context Protocol.
Publications - List all accessible publications and get detailed information about specific publications by ID
Posts - Retrieve posts for a publication with customizable limits (default: 10), access detailed post information by post ID, and view post statistics
Subscribers - List subscribers for a publication with customizable limits (default: 10) and get detailed information about specific subscribers by ID
Segments - List all audience segments for a publication and access detailed segment information by segment ID
All operations require appropriate publication IDs and some require additional identifiers. The server integrates with MCP-compatible clients like Claude Desktop and Cursor IDE.
Click on "Deploy 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., "@Beehiiv Analytics MCP Server show me the top performing posts from last month"
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.
Beehiiv MCP Server
A Model Context Protocol (MCP) server for Beehiiv analytics, providing read access to publications, posts, and segments data, plus a guarded tool for unsubscribing subscribers.
Features
Publications
List all publications
Get detailed publication information
Posts
List posts with filtering options (status, audience, platform, etc.)
Get detailed post information with optional content expansion
Get aggregate statistics for all posts in a publication
Segments
List all segments for a publication
Get detailed segment information
Subscribers
Unsubscribe one or more subscribers by email (dry-run by default, reversible)
Related MCP server: Google Analytics MCP Server
Prerequisites
Python 3.8 or higher
A Beehiiv API key (Get one here)
An MCP-compatible client (e.g., Claude Desktop, Cursor)
Installation
1. Clone or Download this Repository
git clone https://github.com/ousepachn/beehiivanalyticsMCP.git
cd beehiivanalyticsMCPOr download and extract the ZIP file from GitHub.
2. Create a Virtual Environment (Recommended)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate3. Install Dependencies
pip install -r requirements.txt4. Set Up Your API Key
Create a .env file in the project root:
cp .env.example .envThen edit .env and add your Beehiiv API key:
BEEHIIV_API_KEY=your_api_key_hereImportant: Never commit your .env file to version control. It's already included in .gitignore.
Configuration
For Claude Desktop
Locate your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the following configuration (adjust paths as needed):
{
"mcpServers": {
"beehiiv-analytics": {
"command": "/absolute/path/to/venv/bin/python3",
"args": ["/absolute/path/to/beehiiv_mcp_server.py"],
"env": {
"BEEHIIV_API_KEY": "your_api_key_here"
}
}
}
}Example for macOS:
{
"mcpServers": {
"beehiiv-analytics": {
"command": "/Users/yourusername/beehiivMCP/venv/bin/python3",
"args": ["/Users/yourusername/beehiivMCP/beehiiv_mcp_server.py"],
"env": {
"BEEHIIV_API_KEY": "your_api_key_here"
}
}
}
}Restart Claude Desktop
For Cursor IDE
Open Cursor settings
Navigate to MCP settings
Add the server configuration similar to Claude Desktop above
Alternative: Using mcp_config.json
You can also use the included mcp_config.json.example file:
Copy the example file:
cp mcp_config.json.example mcp_config.jsonEdit
mcp_config.jsonand update the paths and API key
Note: The mcp_config.json file is gitignored by default to protect your API key.
Testing
Test API Connectivity
Run the test script to verify your API key works:
python test_beehiiv_api.pyTest the MCP Server
Run the example usage script:
python example_usage.pyRun All Tests
python test_all.pyAvailable Tools
The server provides the following MCP tools:
list_publications- List all publications accessible with your API keyget_publication_details- Get detailed information about a specific publicationlist_posts- List posts with various filters (status, audience, platform, date sorting)get_post_details- Get detailed post information with optional content expansionget_posts_summary_stats- Get aggregate statistics for all posts in a publicationlist_segments- List all segments for a publicationget_segment_details- Get detailed information about a specific segmentunsubscribe_subscribers- Unsubscribe (mark inactive) one or more subscribers by email. Defaults to a dry run that reports what would change; passapply: trueto actually make the change. Already-inactive or not-found emails are skipped, so it's safe to re-run.
Usage Examples
Using with Claude Desktop
Once configured, you can ask Claude:
"List all my publications"
"Show me the 10 most recent posts from publication X"
"What are the stats for my latest post?"
"List all segments for publication Y"
"Show me what would happen if I unsubscribed jane@example.com and john@example.com from publication X" (dry run)
"Unsubscribe jane@example.com from publication X" (pass
apply: trueto actually make the change)
Programmatic Usage
See example_usage.py for a complete example of using the API client directly.
Troubleshooting
API Key Issues
Make sure your API key is set correctly in the environment variable or config file
Verify your API key is valid at the Beehiiv Developer Portal
Check that your API key has the necessary permissions
Path Issues
Use absolute paths in your MCP configuration
Ensure the Python path points to your virtual environment's Python
Verify the server script path is correct
Connection Issues
Check your internet connection
Verify the Beehiiv API is accessible
Check firewall settings if applicable
API Documentation
For detailed API information, refer to the official Beehiiv API documentation:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions:
Check the Troubleshooting section
Review the Beehiiv API Documentation
Open an issue on GitHub
Acknowledgments
Built for the Model Context Protocol
Uses the Beehiiv API
Available Tools
8 toolsget_post_detailsB
Get detailed information about a specific post
Inputs: publication_id (required), post_id (required).
get_postsC
Get posts for a publication
Inputs: publication_id (required), limit.
get_publication_detailsC
Get detailed information about a specific publication
Inputs: publication_id (required).
get_publicationsC
Get list of publications
Inputs: no named parameters.
get_segment_detailsC
Get detailed information about a specific segment
Inputs: publication_id (required), segment_id (required).
get_segmentsC
Get segments for a publication
Inputs: publication_id (required).
get_subscriber_detailsC
Get detailed information about a specific subscriber
Inputs: publication_id (required), subscriber_id (required).
get_subscribersC
Get subscribers for a publication
Inputs: publication_id (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Every tool has a clearly distinct purpose targeting different resources (posts, publications, segments, subscribers) with consistent get_<resource> and get_<resource>_details patterns. There is no ambiguity between tools as each serves a unique data retrieval function.
All tools follow a perfectly consistent verb_noun pattern with 'get_' prefix and snake_case naming. The naming convention is predictable throughout the set, making it easy to understand each tool's function at a glance.
With 8 tools, this server is well-scoped for analytics purposes. Each tool earns its place by covering different data retrieval aspects of the Beehiiv platform, providing comprehensive read access without being overwhelming.
The toolset provides excellent read coverage with consistent get operations for all major resources, but lacks any write, update, or delete capabilities. For an analytics server, this may be intentional, but it creates a read-only surface that limits agent workflows to data retrieval only.
Maintenance
Related MCP Connectors
Read subscribers, posts and segments; add subscribers, tags and draft posts in beehiiv.
Manage beehiiv newsletters, posts, podcasts, community, subscribers, and analytics.
Read-only SaaS business intelligence from GA4, Stripe, and Google Search Console.
Read-only revenue analytics from Stripe, Paddle, Polar, Lemon Squeezy, Creem and Freemius.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides deep, structured access to Substack publications with real-time content analysis, including sentiment analysis, readability metrics, and publishing patterns.13MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Analytics through Admin and Data APIs, allowing retrieval of account details, reports, and realtime data via natural language.Apache 2.0

Revinho MCP serverofficial
AlicenseNot gradedqualityDmaintenanceEnables AI agents to read-only access business intelligence in a Revinho workspace, combining Google Analytics 4, Stripe, and optionally Google Search Console to answer questions about changes, performance, revenue, underperformance, and opportunities.1MIT- AlicenseNot gradedqualityCmaintenanceEnables natural-language access to Google Analytics 4 properties and reports, including page views, users, events, traffic sources, device metrics, and custom reports, with automatic OAuth 2.0 authentication and token management.MIT