MCP server by sivraamkrishnankv
Automatic Blog Publisher MCP
An MCP (Model Context Protocol) server that automatically publishes blog posts to dev.to. This tool allows you to seamlessly integrate blog publishing capabilities into MCP-compatible applications.
Features
- Automated Publishing: Publish blog posts directly to dev.to with a single function call
- Draft Support: Save posts as drafts or publish immediately
- Rich Metadata: Support for tags, series, cover images, and canonical URLs
- Error Handling: Comprehensive error handling with detailed logging
- MCP Integration: Built with FastMCP for seamless integration with MCP clients
Installation
Prerequisites
- Python 3.11 or higher
- A dev.to API key (get one from your dev.to settings)
Install with uv (recommended)
cd automatic-blog-publisher-mcp
uv sync
Install with pip
pip install -e .
Usage
Running the MCP Server
python main.py
The server will start and listen for MCP client connections via stdio.
Available Tool
publish_blog_to_devto
Publishes a blog post to dev.to with the following parameters:
title(str): The title of the blog postbody_markdown(str): The content of the blog post in Markdown formattags(Optional[List[str]]): A list of tags (e.g.,["python", "webdev"])published(bool): Set totrueto publish immediately,falseto save as draft (default:false)series(Optional[str]): The name of the series this article belongs tocanonical_url(Optional[str]): The canonical URL if cross-postingcover_image(Optional[str]): URL of the cover image
Example Usage:
{
"title": "My Awesome Blog Post",
"body_markdown": "# Hello World\n\nThis is my first automated blog post!",
"tags": ["python", "automation", "mcp"],
"published": true
}
Response:
Article published successfully! URL: https://dev.to/username/my-awesome-blog-post-abc123
Dependencies
mcp[cli]>=1.21.2: Model Context Protocol frameworkrequests>=2.32.5: HTTP client for API callspython-dotenv>=1.2.1: Environment variable managementdotenv>=0.9.9: Additional dotenv support
Development
Project Structure
automatic-blog-publisher-mcp/
├── main.py # Main MCP server implementation
├── pyproject.toml # Project configuration and dependencies
├── README.md # This file
└── uv.lock # Dependency lock file
Logging
The server uses Python's logging module configured to output to stderr (not stdout) as recommended for MCP servers. Logs include timestamps and are set to INFO level by default.
API Reference
The server communicates with the dev.to API at https://dev.to/api/articles using your personal API key. All requests are made securely with proper authentication headers.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
This project is open source. Please check the license file for details.
Support
If you encounter issues:
- Check that your
DEVTO_API_KEYis correctly set - Verify your API key has the necessary permissions on dev.to
- Check the server logs for detailed error messages
- Ensure all required parameters are provided when calling the publish function
Configuration
Project Metadata
| Property | Value |
|----------|-------|
| Name | automatic-blog-publisher-mcp |
| Version | 0.1.0 |
| Description | Add your description here |
| Python Requirement | >=3.11 |
| Readme | README.md |
Dependencies
The project requires the following Python packages:
| Package | Version Requirement | Purpose |
|---------|-------------------|---------|
| dotenv | >=0.9.9 | Environment variable loading |
| mcp[cli] | >=1.21.2 | Model Context Protocol framework with CLI tools |
| python-dotenv | >=1.2.1 | Python dotenv support |
| requests | >=2.32.5 | HTTP client for API requests |
Environment Setup
Create a .env file in the project root with the following variables:
# dev.to API Configuration
DEVTO_API_KEY=your_devto_api_key_here
# Optional: Additional configuration
LOG_LEVEL=INFO
Installation Commands
Using uv (recommended)
cd automatic-blog-publisher-mcp
uv sync
Using pip
pip install -e .
Build Configuration
The project uses standard Python packaging with the following build requirements:
- Build System: Standard Python setuptools
- Python Version: 3.11 or higher
- Package Type: Pure Python package
Build Configuration
The project uses standard Python packaging with the following build requirements:
- Build System: Standard Python setuptools
- Python Version: 3.11 or higher
- Package Type: Pure Python package