Dev Blog MCP Server
Enables AI assistants to publish blog posts directly to Dev.to via the Model Context Protocol.
README
Dev Blog MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to publish blog posts directly to Dev.to. This server provides a seamless way to integrate blog publishing capabilities into your AI workflows.
Features
- 🚀 Direct Dev.to Publishing: Publish blog posts directly to Dev.to via MCP
- 📝 Rich Content Support: Full Markdown support with tags, series, and cover images
- 🔒 Secure API Integration: Uses environment variables for API key management
- 🛠️ Easy Integration: Simple setup with uv package manager
- 📊 Comprehensive Logging: Detailed logging for debugging and monitoring
Prerequisites
Before you begin, ensure you have the following installed:
- Python 3.13+
- uv (Python package manager)
- Git (for version control)
- Dev.to API Key (get it from Dev.to Settings)
Installation
1. Install uv (if not already installed)
# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or using pip
pip install uv
2. Clone the Repository
git clone https://github.com/anuragck2/dev-blog-mcp-server.git
cd dev-blog-mcp-server
3. Install Dependencies
# Install project dependencies using uv
uv sync
4. Environment Setup
Create a .env file in the project root:
# Copy the example environment file
cp .env.example .env
# Edit the .env file and add your Dev.to API key
echo "DEVTO_API_KEY=your_devto_api_key_here" > .env
Get your Dev.to API key:
- Go to Dev.to Settings
- Scroll down to the "API Keys" section
- Generate a new API key
- Copy the key and add it to your
.envfile
Usage
Running the MCP Server
# Activate the virtual environment and run the server
uv run python main.py
The server will start and listen for MCP connections via stdio transport.
Using with MCP Inspector
The MCP Inspector is a powerful tool for testing and debugging MCP servers. Here's how to set it up:
1. Install MCP Inspector
# Install MCP Inspector globally
npm install -g @modelcontextprotocol/inspector
2. Configure MCP Inspector
Create a configuration file for the MCP Inspector:
{
"mcpServers": {
"dev-blog-mcp-server": {
"command": "uv",
"args": ["run", "python", "main.py"],
"cwd": "/path/to/your/dev-blog-mcp-server"
}
}
}
3. Run MCP Inspector
# Start the MCP Inspector
mcp-inspector
This will open a web interface where you can:
- Test the
publish_blog_to_devtotool - View server logs
- Debug MCP communication
- Monitor tool execution
Using with Claude Desktop
To use this MCP server with Claude Desktop:
- Open Claude Desktop Settings
- Add MCP Server Configuration
Add the following to your Claude Desktop configuration:
{
"mcpServers": {
"dev-blog-mcp-server": {
"command": "uv",
"args": ["run", "python", "main.py"],
"cwd": "/path/to/your/dev-blog-mcp-server"
}
}
}
- Restart Claude Desktop
After adding the configuration, restart Claude Desktop to load the new MCP server.
API Reference
publish_blog_to_devto Tool
Publishes a blog post to Dev.to with the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
title |
string | ✅ | The title of the blog post |
body_markdown |
string | ✅ | The content in Markdown format |
tags |
List[string] | ❌ | List of tags (e.g., ["python", "webdev"]) |
published |
boolean | ❌ | Set to true to publish immediately, false for draft |
series |
string | ❌ | The name of the series this article belongs to |
canonical_url |
string | ❌ | Canonical URL if cross-posted |
cover_image |
string | ❌ | URL of the cover image |
Example Usage
# Example tool call
publish_blog_to_devto(
title="Getting Started with MCP",
body_markdown="# Introduction\n\nThis is a great article about MCP!",
tags=["mcp", "ai", "tutorial"],
published=False, # Save as draft
series="MCP Fundamentals"
)
Development
Project Structure
dev-blog-mcp-server/
├── main.py # Main MCP server implementation
├── pyproject.toml # Project configuration and dependencies
├── .env.example # Environment variables template
├── sample_prompt.md # Sample prompts for testing
├── README.md # This file
└── uv.lock # Dependency lock file
Adding New Features
- Add new tools by creating functions decorated with
@mcp.tool() - Update dependencies in
pyproject.toml - Test with MCP Inspector before deploying
- Update documentation in this README
Testing
# Run the server in development mode
uv run python main.py
# Test with MCP Inspector
mcp-inspector
Troubleshooting
Common Issues
-
"DEVTO_API_KEY environment variable not set"
- Ensure your
.envfile exists and contains the correct API key - Verify the API key is valid and has the necessary permissions
- Ensure your
-
"Network or API request error"
- Check your internet connection
- Verify the Dev.to API is accessible
- Ensure your API key has not expired
-
MCP Inspector connection issues
- Verify the server is running
- Check the configuration file paths
- Ensure all dependencies are installed
Debug Mode
Enable debug logging by modifying the logging level in main.py:
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- 📧 Issues: GitHub Issues
- 📖 Documentation: MCP Documentation
- 🐦 Twitter: @anuragck2
Acknowledgments
- Model Context Protocol for the amazing MCP framework
- Dev.to for providing the publishing API
- uv for the fast Python package manager
- FastMCP for the excellent MCP server framework
Happy Blogging! 🚀
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。