tieba-mcp
Provides read-only access to public Baidu Tieba content, including forum search, thread/post detail retrieval, and listing a user's public posts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tieba-mcpsearch 孙笑川吧 for recent posts about 丁真"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tieba-mcp
MCP server for reading public Baidu Tieba content — 在真实浏览器会话内读取百度贴吧公开内容的 MCP 服务。
⚠️ 免责声明
本项目仅用于学习与研究目的,请遵守《百度贴吧用户协议》及相关法律法规。
禁止商业用途,禁止大规模抓取、禁止将抓取数据对外售卖或用于实质性替代平台功能。
本项目读取的是登录用户本人可见的公开内容,请控制请求频率(默认已内置 1s 节流)。
使用本项目产生的任何后果由使用者自行承担。
功能
工具 | 说明 |
| 吧内搜索,返回帖子列表(标题/摘要/回复数/作者/发布时间) |
| 按 tid 获取帖子详情(楼主楼层、作者、吧名、回复数) |
| 获取指定用户的公开发帖列表(可选,需 MediaCrawler) |
| 环境与登录态自检 |
全部为只读操作。请求经常驻的真实 Edge/Chromium 浏览器会话发出(携带你注入的登录态), 因此不会被贴吧的非浏览器客户端风控拦截;搜索/详情接口走贴吧 PC 版 JSON API,响应毫秒级。
Related MCP server: Playwright MCP Server
架构
MCP 层 (index.js, Node stdio)
└── 常驻 worker (worker.py, Playwright + Edge)
├── 浏览器持久化上下文(登录态复用)
├── 贴吧 PC JSON API(搜索/详情,带签名)
└── [可选] MediaCrawler CLI(tieba_creator)PC 签名密钥不硬编码:由 extract_sign_secret.py 从贴吧公开前端 JS(tb3.bdstatic.com
公共 CDN 的 base 包,每个浏览器加载贴吧首页都会收到)中运行时提取,写入 sign_secret.txt
(已 gitignore)。
快速开始
依赖:
Node.js ≥ 20
Python 3.10+ 与 Playwright:
pip install playwrightMicrosoft Edge(
channel="msedge",无需额外下载浏览器)(可选,仅
tieba_creator需要)MediaCrawler 检出目录
安装与配置:
npm install
python extract_sign_secret.py # 提取 PC 签名密钥 -> sign_secret.txt
# 如遇"百度安全验证"拦截:加 --proxy http://127.0.0.1:7892(你的代理地址)或重试一次获取登录态(可选,用于更高稳定性):
浏览器登录 tieba.baidu.com
F12 → Application → Cookies →
https://tieba.baidu.com→ 找到 BDUSS(httpOnly,需在 Cookie 面板而非 console 中复制,document.cookie拿不到)将 cookie 通过环境变量
TIEBA_COOKIE注入,如BDUSS=xxx; STOKEN=yyy
注册到 Claude Code:
claude mcp add tieba -- node index.js
# 或带环境变量:
claude mcp add tieba --env TIEBA_COOKIE="BDUSS=xxx" -- node index.js环境变量
变量 | 默认值 | 说明 |
| 空 | 登录 cookie( |
| 空 | 签名密钥,手动指定时优先于 |
|
| 两次 API 请求的最小间隔(秒) |
|
| 浏览器持久化目录(登录态) |
| 空 | MediaCrawler 检出目录(仅 |
|
| worker 使用的 Python 解释器 |
|
| 抓取结果落盘目录(仅 creator 工具使用) |
提示:贴吧对无代理的国内 IP 可能有安全验证,连接不稳定时可开启全局代理(系统代理会被 浏览器自动使用)。
工作原理
浏览器内请求:请求通过
page.evaluate在浏览器上下文中发出(credentials: include), 携带真实浏览器指纹与你的登录态,绕开非浏览器客户端的 TLS 指纹风控。PC 签名:贴吧 PC JSON API 要求参数签名(sorted params + secret → md5)。密钥与算法 均来自贴吧公开前端 JS(
tb3.bdstatic.com/tb/pc/pc-common/static/js/base.*.js中t === Dt.PC ? '<key>' : ...结构),extract_sign_secret.py按该结构提取;若贴吧调整 打包结构,可手动设置TIEBA_SIGN_SECRET。限速:worker 内置请求节流(
TIEBA_MIN_INTERVAL),默认 1 秒。
许可与致谢
本项目整体采用 NON-COMMERCIAL LEARNING LICENSE 1.1(见 LICENSE 与 NOTICE)
签名实现与浏览器请求模式源自 MediaCrawler 的贴吧模块(
media_platform/tieba/client.py),致谢 NanmiCoder
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Crawl, scrape, search the web, and automate browsers at scale with anti-bot bypass.
Headless browser primitives for AI agents when sites need real JS rendering.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to crawl and extract data from Chinese social media platforms like Bilibili, Xiaohongshu, and Douyin. Provides search, content detail retrieval, and creator information tools with persistent browser sessions and QR code login support.76-
- AlicenseNot gradedqualityDmaintenanceEnables browser automation and web scraping with multi-session management, supporting page navigation, element interaction, network request capture, and content extraction across multiple concurrent browser instances.14MIT
- AlicenseBqualityDmaintenanceProvides a remote browser session and MCP tools for restricted search and extraction on sites like XHS, Yelp, and TripAdvisor, with human-in-the-loop login.51Apache 2.0
- AlicenseAqualityDmaintenanceEnables browser automation with anti-detection features, including navigation, interaction, form filling, and session management.229MIT
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/f25h-233/tieba-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server