Skip to main content
Glama
Dev.to Blog Publisher MCP Server

Dev.to Blog Publisher MCP Server

by Kiruthick7

🚀 Dev.to Model Context Protocol (MCP) Server

Python MCP FastMCP Dev.to API Packaging License: MIT

A production-ready Model Context Protocol (MCP) server built in Python using FastMCP. It exposes Dev.to publishing capabilities as native, schema-validated tools directly invocable by agentic LLMs and IDE assistants such as Claude Desktop, Cursor, and other MCP-compliant agents.


📐 Architecture & Interaction Flow

The server establishes a secure stdio (standard input/output) channel using JSON-RPC 2.0. Rather than making manual API calls, your AI agent autonomously binds parameters to the tool schema and executes the publish command natively.

sequenceDiagram
    autonumber
    actor Developer
    participant Agent as Claude Desktop / Cursor (MCP Client)
    participant MCP as Python FastMCP Server (stdio)
    participant DevTo as Dev.to REST Gateway

    Developer->>Agent: "Draft and publish an article on Snowflake ETL"
    Agent->>Agent: Read schema for `publish_blog_to_devto`
    Agent->>MCP: JSON-RPC Call: `publish_blog_to_devto(title, body, tags, published=False)`
    MCP->>MCP: Validate API key & payload format
    MCP->>DevTo: POST https://dev.to/api/articles (Headers: api-key)
    DevTo-->>MCP: HTTP 201 Created (JSON Response with Article URL)
    MCP-->>Agent: "Article published successfully! URL: https://dev.to/..."
    Agent-->>Developer: Confirmation with live article URL

Related MCP server: Dev Blog MCP Server

✨ Features & Capabilities

  • Native Tool Integration: Exposes publish_blog_to_devto with strict parameter validation.

  • Drafts or Live Publishing: Seamlessly switch between publishing immediate live articles or drafting articles (published: bool = False) for manual review on Dev.to.

  • Metadata & Canonical URLs: Built-in support for article tags, series identifiers, custom cover images, and canonical URL cross-posting.

  • High-Performance Transport: Uses standard I/O (stdio) to avoid port collisions and firewall restrictions on local development machines.

  • Blazing Fast Virtual Environment: Managed with Astral's uv package manager for sub-second environment initialization and dependency resolution.


🛠️ Tool Schema Reference

publish_blog_to_devto

Parameter

Type

Required

Description

title

string

Yes

The headline or title of the blog post.

body_markdown

string

Yes

Full article content written in Markdown format.

tags

string[]

No

List of up to 4 tags (e.g. ["python", "ai", "datascience"]).

published

boolean

No

false to save as a draft (default), true to publish immediately.

series

string

No

Name of the series to group the post into.

canonical_url

string

No

Original article URL if cross-posting from an external blog.

cover_image

string

No

Direct image URL to display as the article's hero banner.


🚀 Quickstart Guide

1. Prerequisites

  • Python 3.10+

  • Astral uv (Python package installer):

    curl -LsSf https://astral.sh/uv/install.sh | sh
  • Dev.to API Key: Generate your key at dev.to/settings/extensions under DEV Community API Keys.


2. Installation & Setup

  1. Clone the repository:

    git clone https://github.com/Kiruthick7/mcp.git
    cd mcp
  2. Create and activate a virtual environment with uv:

    uv venv
    source .venv/bin/activate
  3. Install dependencies:

    uv sync
  4. Configure environment variables:

    cp .env.template .env

    Add your Dev.to API key in .env:

    DEVTO_API_KEY=your_devto_api_key_here

🔌 Connecting to MCP Clients

A. Claude Desktop Integration

Edit your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the devto-publisher server block:

{
  "mcpServers": {
    "devto-publisher": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/mcp",
        "run",
        "dev-server.py"
      ],
      "env": {
        "DEVTO_API_KEY": "your_devto_api_key_here"
      }
    }
  }
}

Note: Replace /ABSOLUTE/PATH/TO/mcp with your actual repository path (run pwd inside the repository).

Restart Claude Desktop, and you will see the hammer 🔨 tool icon showing publish_blog_to_devto ready to use!


B. Testing with the MCP Inspector

You can interactively test and debug your MCP server using the official Anthropic MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory $(pwd) run dev-server.py

This launches a local web UI at http://localhost:5173 where you can inspect schemas, send test payloads, and verify Dev.to API responses.


🔒 Security & Best Practices

  1. Token Isolation: Never hardcode API keys. Keys are passed via local .env or client environment parameters.

  2. Local Stdio Sandboxing: Because execution uses stdio, no external HTTP ports are exposed on your host machine.

  3. Safe Draft Defaults: By default, published: false prevents accidental live publication until content is reviewed in Dev.to drafts.


📄 License

This project is licensed under the MIT License.

Available Tools

1 tool
publish_blog_to_devtoA
Publishes a blog post to dev.to.

Args:
    title (str): The title of the blog post.
    body_markdown (str): The content of the blog post in Markdown format.
    tags (Optional[List[str]]): A list of tags for the blog post (e.g., ["python", "webdev"]).
    published (bool): Set to True to publish immediately, False to save as a draft.
    series (Optional[str]): The name of the series this article belongs to.
    canonical_url (Optional[str]): The canonical URL of the article if it's cross-posted.
    cover_image (Optional[str]): URL of the cover image for the article.

Returns:
    str: A message indicating the success or failure of the publishing operation,
         including the article URL if successful.

Inputs: title (required), body_markdown (required), tags, series, +3 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 1 tool

    Disambiguation5/5

    There is only one tool, so there is nothing for an agent to confuse it with. Its purpose is stated explicitly and the parameters map cleanly to the publishing action.

    Naming Consistency5/5

    The single name publish_blog_to_devto follows a clear verb_noun_target snake_case convention. Even with one tool, the pattern is predictable and readable.

    Tool Count3/5

    One tool is a very thin surface, but it does match the narrow 'publisher' framing of the server. It sits at the borderline where a couple more operations would make the server genuinely useful.

    Completeness2/5

    The surface only covers creation — there is no way to list, fetch, update, or delete published articles or drafts. An agent that needs to fix a typo in a live post or verify a draft's state hits a dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers