cnblogs-mcp
블로그원(cnblogs) MCP 서비스
MCP(Model Context Protocol) 프로토콜을 통해 블로그원(cnblogs) Open API를 AI가 호출할 수 있는 도구로 캡슐화했습니다. 모든 MCP 클라이언트(QwenPaw, Claude Desktop, Cline 등)에서 자연어를 사용하여 직접 블로그원 게시물을 작성할 수 있습니다.
기능
✅
create_post— Markdown 블로그 게시물을 블로그원에 게시✅
.env를 통한 토큰 관리 (하드코딩 없음)✅ 모든 MCP 클라이언트 연결 지원
Related MCP server: feishu-markdown-mcp
목차
빠른 시작
1. 프로젝트 복제 / 다운로드
git clone https://github.com/你的用户名/cnblogs-mcp.git
cd cnblogs-mcp2. 가상 환경 생성
python -m venv .venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows3. 의존성 설치
pip install -r requirements.txt4. 토큰 설정
cp .env.example .env.env 파일을 편집하여 블로그원 Personal Access Token을 입력하세요:
CNBLOGS_TOKEN=your_token_here5. 테스트 실행
# 验证 MCP 服务能正常启动
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}\n' \
| python cnblogs_mcp.py 2>/dev/null | grep '"name"'정상 출력:
{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"create_post",...}]}}토큰 획득
블로그원(cnblogs)에 로그인
「토큰 생성」을 클릭하고 이름과 권한(「에세이 게시」 권한 필요)을 설정
생성된 토큰을 복사하여
.env파일에 입력
⚠️ 토큰은 한 번만 표시되므로 안전하게 보관하세요.
클라이언트 연결
1. QwenPaw
QwenPaw 작업 디렉토리에서 agent.json을 찾아 MCP 클라이언트를 추가하세요:
{
"mcp": {
"clients": {
"cnblogs": {
"name": "cnblogs",
"description": "博客园博文发布",
"enabled": true,
"transport": "stdio",
"command": "/absolute/path/to/cnblogs-mcp/.venv/bin/python",
"args": ["/absolute/path/to/cnblogs-mcp/cnblogs_mcp.py"],
"env": {
"DOTENV_PATH": "/absolute/path/to/cnblogs-mcp/.env"
}
}
}
}
}QwenPaw 재시작:
qwenpaw daemon restart2. Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json에 다음을 추가하세요:
{
"mcpServers": {
"cnblogs": {
"command": "/absolute/path/to/cnblogs-mcp/.venv/bin/python",
"args": ["/absolute/path/to/cnblogs-mcp/cnblogs_mcp.py"],
"env": {
"DOTENV_PATH": "/absolute/path/to/cnblogs-mcp/.env"
}
}
}
}Claude Desktop 재시작.
3. Cline / Roo Code
VS Code 설정에서 「MCP」를 검색하여 MCP Servers를 찾은 후 추가하세요:
{
"cnblogs": {
"command": "/absolute/path/to/cnblogs-mcp/.venv/bin/python",
"args": ["/absolute/path/to/cnblogs-mcp/cnblogs_mcp.py"],
"env": {
"DOTENV_PATH": "/absolute/path/to/cnblogs-mcp/.env"
}
}
}4. 기타 MCP 클라이언트
범용 구성 템플릿:
매개변수 | 값 |
|
|
|
|
|
|
💡 MCP 클라이언트가
DOTENV_PATH를 지원하지 않는 경우,env.CNBLOGS_TOKEN을 사용하여 토큰을 직접 전달할 수도 있습니다.
수동 테스트
cd cnblogs-mcp
# 测试 1:初始化 + 工具列表
printf '...' | python cnblogs_mcp.py
# 测试 2:发布一篇博文
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"create_post","arguments":{"title":"测试","body":"## 你好\n\n这是一篇测试文章。"}}}\n' | python cnblogs_mcp.py 2>/dev/null정상 반환:
{"success": true, "postId": 12345678, "postUrl": "https://www.cnblogs.com/你的博客名/p/12345678"}오류 처리
오류 메시지 | 원인 | 해결 방법 |
|
|
|
| 토큰 무효 또는 만료 | 블로그원에서 토큰 재생성 |
| 토큰 권한 부족 | 토큰 생성 시 「에세이 게시」 권한 체크 확인 |
| 요청 형식 오류 | title 및 body가 비어 있는지 확인 |
| 네트워크 문제 | 네트워크 확인 후 재시도 |
MCP 연결 후 도구 목록이 비어 있음 |
|
|
API 참조
도구: create_post
매개변수:
매개변수 | 유형 | 필수 | 설명 |
| string | ✅ | 게시물 제목 |
| string | ✅ | 게시물 본문 (Markdown 형식) |
반환값:
{
"success": true,
"postId": 19246558,
"postUrl": "https://www.cnblogs.com/你的博客名/p/19246558"
}또는 오류 발생 시:
{
"success": false,
"error": "错误描述"
}개발
프로젝트 구조
cnblogs-mcp/
├── cnblogs_mcp.py # MCP 服务主文件
├── requirements.txt # Python 依赖
├── .env.example # 环境变量模板(不含真实 Token)
├── .env # 你的本地配置(已在 .gitignore 中)
├── .gitignore
├── README.md
└── LICENSE의존성
fastmcp>=3.0.0
python-dotenv>=1.0.0
requests>=2.31.0License
MIT — Star, Fork 및 PR을 환영합니다!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityFmaintenanceEnables AI agents to publish articles to WeChat Official Account (微信公众号). Supports image upload, draft creation, and publishing via standardized MCP protocol.51
- AlicenseNot gradedqualityFmaintenanceConverts Markdown to Feishu/Lark document format and provides an MCP service for integration with the Model Context Protocol.29MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for managing Blogger posts: create, update, retrieve posts, and upload images to GCS via natural language.2MIT
- AlicenseAqualityAmaintenanceEnables publishing local Markdown files to Velog with idempotent updates. Supports login, post management, and series operations through natural language.10MIT
Related MCP Connectors
Create, update, and publish changelog entries on your Patchlog changelog from any MCP client.
MCP-native collaborative markdown editor with real-time AI document editing
Publish AI-generated HTML & Markdown to a hosted, shareable URL via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mintonzhang/cnblogs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server