掘金 MCP 服务器 - 使大语言模型通过 MCP 协议管理掘金文章
SaferSkills independently audited juejin-release-mcp (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<p align="center"> <img src="https://img.shields.io/badge/version-0.1.1-blue.svg" alt="Version"> <img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="Python Version"> <img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"> <img src="https://img.shields.io/badge/MCP-protocol-orange.svg" alt="MCP Protocol"> <a href="https://pypi.org/project/juejin-release-mcp/"><img src="https://badge.fury.io/py/juejin-release-mcp.svg" alt="PyPI version"></a> </p>
掘金 MCP 服务器 是一个基于 MCP 协议 的掘金平台接入服务,让 AI 助手(如 Claude、Cursor、Trae 等)能够直接管理你的掘金文章。
核心价值:告别手动复制粘贴,通过自然语言让 AI 帮你发布文章、管理草稿、查询内容,实现「动动嘴皮子就能写博客」的流畅体验。
使用它能带来什么:
如果这个项目帮到了你,请帮忙点个 Star ⭐️,你的支持是我们更新的动力!
publish_article 自动完成创建草稿 + 发布两步操作传统发布掘金文章的流程:
使用掘金 MCP 服务器后:
你:帮我发布一篇掘金文章,标题是「我的 2024 技术总结」,内容如下...
AI:已为您创建草稿并发布成功!文章链接:https://juejin.cn/post/xxx| 组件 | 版本要求 | 说明 |
|---|---|---|
| Python | ≥ 3.10 | 核心运行环境 |
| Cookie | - | 掘金登录凭证 |
list_by_user 请求sessionid 字段在 Network 中查看 Cookie
#### 方式一:uvx 运行(推荐,无需安装)
uvx juejin-release-mcp#### 方式二:pip 安装
pip install juejin-release-mcp#### 方式三:源码安装
git clone https://github.com/iceycn/juejin-release-mcp.git
cd juejin-release-mcp
pip install -e .#### Cursor / Trae 配置
在 MCP 配置文件中添加:
{
"mcpServers": {
"juejin": {
"command": "uvx",
"args": ["juejin-release-mcp"],
"env": {
"JUEJIN_COOKIE": "sessionid=your_sessionid"
}
}
}
}或使用 pip 安装后:
{
"mcpServers": {
"juejin": {
"command": "juejin-release-mcp",
"env": {
"JUEJIN_COOKIE": "sessionid=your_sessionid"
}
}
}
}#### 命令行运行
export JUEJIN_COOKIE="sessionid=your_sessionid"
juejin-release-mcp| 变量名 | 必填 | 说明 | 默认值 |
|---|---|---|---|
JUEJIN_COOKIE | ✅ | 掘金 Cookie,格式:sessionid=xxx | - |
JUEJIN_AID | ❌ | 应用 ID | 2608 |
JUEJIN_UUID | ❌ | 用户唯一标识 | - |
JUEJIN_CSRF_TOKEN | ❌ | 防爬校验令牌 | - |
JUEJIN_TIMEOUT | ❌ | 请求超时(秒) | 30 |
JUEJIN_MAX_RETRIES | ❌ | 最大重试次数 | 3 |
| 工具名 | 描述 | 必填参数 |
|---|---|---|
publish_article | 发布文章(创建草稿+发布) | title, content |
create_draft | 创建草稿 | title, content |
update_draft | 更新草稿 | draft_id |
delete_draft | 删除草稿 | draft_id |
list_drafts | 获取草稿列表 | - |
get_article | 获取文章详情 | article_id |
list_articles | 获取文章列表 | - |
update_article | 更新文章 | article_id |
delete_article | 删除文章 | article_id |
list_categories | 获取分类列表 | - |
list_tags | 获取标签列表 | - |
get_user_info | 获取用户信息 | - |
请帮我发布一篇掘金文章:
- 标题:我的第一篇技术博客
- 内容:# Hello World
这是我的第一篇博客文章,介绍一下我的开源项目...
- 分类:后端
- 标签:Python, MCP请列出我在掘金的所有草稿请显示掘金的文章分类和热门标签请帮我更新文章 7382918472656487462,在末尾添加「更新于 2024-01-01」本 MCP 服务对接的掘金 API(前缀 https://api.juejin.cn):
| 接口 | 方法 | 说明 |
|---|---|---|
/content_api/v1/article_draft/create | POST | 创建草稿 |
/content_api/v1/article_draft/update | POST | 更新草稿 |
/content_api/v1/article_draft/delete | POST | 删除草稿 |
/content_api/v1/article_draft/list_by_user | POST | 草稿列表 |
/content_api/v1/article/publish | POST | 发布文章 |
/content_api/v1/article/list_by_user | POST | 文章列表 |
/tag_api/v1/query_category_list | POST | 分类列表 |
/tag_api/v1/query_tag_list | POST | 标签列表 |
# 安装开发依赖
pip install -e ".[dev]"
# 运行测试
pytest
# 代码检查
ruff check src/
mypy src/
# 本地运行
export JUEJIN_COOKIE="sessionid=xxx"
python -m src.juejin_release_mcp.server# 构建
python -m build
# 检查
twine check dist/*
# 发布到 TestPyPI(可选)
twine upload --repository testpypi dist/*
# 发布到 PyPI
twine upload dist/*A: 请确保已正确设置环境变量,或在 MCP 配置中添加 env 配置。
A: Cookie 可能已过期,请重新获取并更新。
A: 请检查必填参数是否正确传递,特别是 title 和 content 字段。
MIT License © 2026
如果这个项目帮到了你,请给一个 Star ⭐️ 支持一下!
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.