Get the FREE Ultimate OpenClaw Setup Guide →

mcp -csdn

MCP server from CorgiBoyG/mcp-server-csdn

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio corgiboyg-mcp-server-csdn docker run -i mcp-server-csdn:1.0.0

How to use

This MCP server enables automated publishing of Markdown articles to the CSDN platform. It runs as a Spring-based MCP Server and exposes a tool method (saveArticle) that can be invoked by the AI layer through the standard MCP tools interface. The server supports both stdio and SSE modes for AI communication. To use it, ensure the server is running (either directly via Java/JAR or via Docker as described in installation steps) and that the CSDN cookie is configured in application.yml under csdn.api.cookie. Once running, you can instruct the AI to call the saveArticle tool with the required fields, such as title, markdowncontent, and tags. The service handles converting Markdown to CSDN-friendly content and posts the article to CSDN, returning the result and the article URL if successful. The overall flow is AI → @Tool (saveArticle) → CSDN article publishing service, with domain-driven structure separating domain logic, infrastructure adapters, and gateway API interactions.

How to install

Prerequisites:

  • Java 17+ (JDK)
  • Maven 3.6+ (for local build) or Docker (for Docker deployment)
  • Optional: Docker daemon running if you choose to run via Docker

Option A: Local build and run (stdlibio mode)

  1. Clone the repository: git clone <repo-url> cd mcp-server-csdn
  2. Build the project with Maven: mvn clean package
  3. Run the application (stdio mode by default): java -jar target/mcp-server-csdn-app.jar

Option B: Docker deployment (recommended for MCP Server integrations)

  1. Build the Docker image (if you have the Dockerfile): docker build -t mcp-server-csdn:1.0.0 .
  2. Run the container exposing the MCP port (8101 by default) and mounting data: docker run -d
    -p 8101:8101
    -v $(pwd)/data:/app/data
    mcp-server-csdn:1.0.0

Prerequisites recap:

  • Ensure Java 17+ is installed for local runs, or use Docker for isolated runs.
  • If running via Docker, ensure Docker is installed and running.
  • Configure CSDN credentials in src/main/resources/application.yml (csdn.api.cookie) before starting.

Additional notes

Tips and common considerations:

  • Cookie validity: CSDN login cookie may expire; update regularly to maintain publishing ability.
  • Content formatting: Markdown content is supported; ensure proper formatting for headings, links, and images.
  • Tags and categories: Configure article categories and tags in the application.yml under csdn.api to match CSDN settings.
  • Logging: Logs are written to data/log/mcp-server-csdn.log; monitor for publishing errors or authentication issues.
  • Mode selection: The SSE mode requires enabling web-application-type in application.yml; default stdio mode is typically sufficient for development.
  • Extensibility: The architecture follows DDD; to add new publishing targets, implement new ICSDNService ports and corresponding adapters following the repository's structure.

Related MCP Servers

Sponsor this space

Reach thousands of developers