mcp -csdn-final
MCP server from luyanchang/mcp-server-csdn-final
claude mcp add --transport stdio luyanchang-mcp-server-csdn-final docker run -d -p 8101:8101 mcp-server-csdn-app:1.2 \ --env CSDN_COOKIE="your CSDN cookie"
How to use
This MCP server provides a REST API to publish Markdown articles directly to CSDN from your own tooling or CI workflows. It is built with Spring Boot and exposes endpoints for converting Markdown to HTML, applying article metadata (tags, categories, descriptions), and publishing the content to your CSDN account using a configured CSDN cookie. After starting the server (via Docker in the recommended setup), you can send HTTP requests to create, update, or publish articles, and leverage the included Spring AI integrations for assisted content generation if you enable those features. The API surface is designed to be RESTful and friendly for automation pipelines, with JSON payloads describing the article content, metadata, and target publishing options.
How to install
Prerequisites:
- Docker (recommended for running the server as shown in the README)
- Optional: Java/JDK, Maven if you prefer building locally
Installation steps (Docker-based):
- Ensure Docker is running on your machine.
- Pull or build the Docker image as described by the project (the README references mcp-server-csdn-app:1.2).
- Run the server container with the required environment:
- Expose port 8101 (or your configured port) and map it to the host: -p 8101:8101
- Provide CSDN cookie via environment variable CSDN_COOKIE inside the container.
Alternative local build (if you prefer running a JAR):
- Install Java 17+ and Maven.
- Clone the repository and navigate to it.
- Build the project: mvn clean package -DskipTests
- Run the generated jar (adjust the actual jar name if different): java -jar target/mcp-server-csdn-app.jar
If you choose Docker, you can also use the provided build.sh script to build the image locally and run it:
- sh build.sh
- docker run -d -p 8101:8101 mcp-server-csdn-app:1.2
Note: The CSDN cookie is required for authenticating with the CSDN API. Set it in the environment or in application.yml when running outside Docker.
Additional notes
Tips:
- The CSDN cookie is sensitive; avoid hard-coding it in source control. Use environment variables or secret management.
- If the CSDN cookie expires, you’ll need to update it in the running container (or in application.yml before starting) to resume publishing.
- The server listens on port 8101 by default; ensure your firewall or proxy allows traffic to this port.
- When using Docker, you can adjust the port mapping to fit your deployment environment; update the mcpServers config accordingly.
- Markdown is converted to HTML internally (via Flexmark) before publishing; you can perform server-side previews if you expose the HTML output in your API payload.
- Enable Spring AI features if you want content generation or augmentation; ensure any required credentials or configurations are provided in the application.yml or environment.