toutiao-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
toutiao-mcp
An MCP (Model Context Protocol) server that automates a full pipeline: fetch global breaking news → publish to Toutiao (今日头条), orchestrated by any MCP-compatible AI client.
English
What this project does
Toutiao (今日头条) is a major content distribution platform in China. This project uses browser automation (Puppeteer) to help an AI assistant:
Event Registry API ──▶ get_breaking_news ──▶ toutiao_publish_article ──▶ ToutiaoQuick Start
Prerequisites: Node.js (recommended: current LTS).
Install dependencies
npm installConfigure environment variables
cp .env.example .envSet your Event Registry API key (only required when using source=eventregistry):
NEWS_API_KEY=your_event_registry_api_keyOptional: default news source for get_breaking_news:
# eventregistry | hackernews
NEWS_SOURCE=hackernewsRun in MCP Inspector (recommended for debugging)
npm run inspectProject Overview
Main Features
Publish Article demo (Codex)

Prompt used for this demo:
Please help me post a breaking news message on Toutiao,
and attach the following image: /Users/qingyu/Desktop/news_img.png
Please use toutiao-mcp to post. You can use toutiao-mcp's built-in skills to decide the article title and content yourself.Starts a visible browser, opens Toutiao, extracts the QR code, and watches login state in the background.
Demo GIF:

Runs a headless browser to validate whether the current session is still logged in, and updates cookies if needed.
Demo GIF:

Fetches breaking news from eventregistry (requires NEWS_API_KEY) or hackernews (no key required).
Demo GIF:

Deletes the local cookies.json file to reset login state.
Demo GIF:

MCP Tool List
Tool | Description | Parameters |
| Get QR code and wait for scan | — |
| Check Toutiao login status | — |
| Delete local cookies file | — |
| Fetch breaking news ( |
|
| Fetch Hacker News stories |
|
| Fetch a Hacker News item by id |
|
| Publish a Toutiao article |
|
Claude Desktop integration
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"toutiao-mcp": {
"command": "node",
"args": ["/absolute/path/to/toutiao-mcp/src/server.js"],
"env": {
"NEWS_API_KEY": "your_api_key"
}
}
}
}Notes & Troubleshooting
Puppeteer downloads a Chromium binary on first run; make sure your network is available.
cookies.jsoncontains sensitive session tokens and is ignored by.gitignoreby default. Do not commit it.toutiao_publish_articlerequiresimagePathto exist locally (absolute path recommended).If Toutiao UI changes, selectors may break and require updates in
src/toutiao/publish.js.
Skill option (Hacker News)
If you prefer a skill-based workflow (instead of relying on a paid/limited news API), this repo vendors the Hacker News skill at:
skills/hackernews/SKILL.md
Leave the fetching/curation to your agent using that skill, then publish via toutiao_publish_article.
License
Related MCP server: XiaoHongShu MCP
中文
项目做什么
今日头条 (Toutiao) 是国内主要的内容分发平台之一。本项目通过 Puppeteer 浏览器自动化,让支持 MCP 的 AI 客户端可以完成:
Event Registry API ──▶ get_breaking_news ──▶ toutiao_publish_article ──▶ 今日头条快速开始
环境要求:Node.js(建议使用 LTS 版本)。
1)安装依赖
npm install2)配置环境变量
cp .env.example .env在 .env 中配置 Event Registry API Key:
NEWS_API_KEY=your_event_registry_api_key可选:为 get_breaking_news 设置默认新闻来源:
# eventregistry | hackernews
NEWS_SOURCE=hackernews3)使用 MCP Inspector 调试(推荐)
npm run inspect项目简介
主要功能
发布文章演示(Codex)

该演示使用的提示词:
Please help me post a breaking news message on Toutiao,
and attach the following image: /Users/qingyu/Desktop/news_img.png
Please use toutiao-mcp to post. You can use toutiao-mcp's built-in skills to decide the article title and content yourself.启动可见浏览器打开头条,提取二维码,并在后台监听登录状态变化。
GIF 演示:

使用无头浏览器检测当前会话是否已登录,并在需要时更新 Cookie。
GIF 演示:

从 eventregistry(需要 NEWS_API_KEY)或 hackernews(无需 key)获取突发新闻/科技新闻。
GIF 演示:

删除本地 cookies.json,重置登录状态。
GIF 演示:

MCP 工具列表
工具 | 说明 | 参数 |
| 获取登录二维码并等待扫码 | 无 |
| 检查头条登录状态 | 无 |
| 删除本地 cookies 文件 | 无 |
| 获取突发新闻(支持 |
|
| 获取 Hacker News 故事列表 |
|
| 根据 id 获取 Hacker News 条目 |
|
| 发布头条文章 |
|
Claude Desktop 集成
将以下内容添加至 claude_desktop_config.json:
{
"mcpServers": {
"toutiao-mcp": {
"command": "node",
"args": ["/绝对路径/到/toutiao-mcp/src/server.js"],
"env": {
"NEWS_API_KEY": "your_api_key"
}
}
}
}注意事项与排错
Puppeteer 首次运行会下载 Chromium 内核,请确保网络通畅。
cookies.json含敏感会话令牌,默认已加入.gitignore,请勿提交到仓库。toutiao_publish_article需要本地存在的imagePath(建议使用绝对路径)。若头条页面结构变更导致选择器失效,可从
src/toutiao/publish.js开始排查与修复。
Skill 用法(Hacker News)
如果你希望不用第三方新闻 API,而改用 “skill 驱动” 的方式拉取/筛选科技新闻,本仓库已内置 Hacker News skill:
skills/hackernews/SKILL.md
你可以让 AI 先用该 skill 获取/整理内容,再调用 toutiao_publish_article 发布。
开源协议
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Free sourced breaking news for agents: markets, crypto, tech, geopolitics, US politics. A2A+RSS too.
Cloud browsers for AI agents: saved logins, residential IPs, live human takeover, 57 browser tools.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables reading and extracting content from WeChat public account articles using browser automation, allowing AI models to analyze and summarize WeChat articles through natural language requests.466MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to publish content to XiaoHongShu (Little Red Book) social platform, including checking login status and posting with titles, content, images, and hashtags through browser automation.4ISC
- AlicenseNot gradedqualityDmaintenanceEnables automated Douyin video uploads and account management using Playwright for browser simulation. It supports QR code login, cookie persistence, and automated metadata handling for publishing videos through natural language or API commands.7MIT
- FlicenseNot gradedqualityDmaintenanceAutomates the Douyin Creator Platform to manage login states and publish image-text content via the MCP protocol. It enables users to check authentication status, manage cookies, and automate article publishing with titles, text, and images.-