Content
# tieba-mcp
<p align="center">
<img src="assets/logo.svg" alt="tieba-mcp logo" width="240">
</p>
<p align="center">
<strong>Baidu Tieba MCP Server</strong> — Enable AI assistants to search Tieba, browse threads, and view user information
</p>
<p align="center">
<img src="https://img.shields.io/badge/node-%3E%3D22-brightgreen" alt="Node version">
<img src="https://img.shields.io/badge/license-MIT-blue" alt="License">
<img src="https://img.shields.io/badge/MCP-v1.0-4A9EFF" alt="MCP version">
</p>
---
## Introduction
`tieba-mcp` is a Baidu Tieba server based on [MCP (Model Context Protocol)](https://modelcontextprotocol.io/), allowing AI assistants like Claude to interact with Baidu Tieba directly.
There is currently no official MCP server for Baidu Tieba, and this project fills this gap.
### Features
- Pure read-only operations, no login or cookie required
- 6 MCP tools covering user, thread, and forum scenarios
- Based on stdio transport, compatible with all MCP clients
- Written in TypeScript, type-safe
## Quick Start
### Requirements
- Node.js >= 22
- MCP-enabled client (Claude Code, Claude Desktop, VS Code + Claude plugin, etc.)
### Installation and Configuration
**1. Clone the repository**
```bash
git clone https://github.com/Sartherland/tieba-mcp.git
cd tieba-mcp
npm install
npm run build
```
**2. Configure MCP client**
Claude Code — Create `.mcp.json` in the project root directory:
```json
{
"mcpServers": {
"tieba": {
"command": "node",
"args": ["dist/index.js"]
}
}
}
```
Claude Desktop — Edit `claude_desktop_config.json`:
```json
{
"mcpServers": {
"tieba": {
"command": "node",
"args": ["D:/Desktop/claude/tieba-mcp/dist/index.js"]
}
}
}
```
## Available Tools
### Forum-related
| Tool | Description |
|------|-------------|
| `tieba_forum_threads` | Browse forum thread list, supports sorting by latest reply/post |
| `tieba_forum_search` | Search within a forum, supports keyword and user filtering |
| `tieba_post` | Get thread content, including floor replies |
### User-related
| Tool | Description |
|------|-------------|
| `tieba_user_info` | Get user basic information (UID, username, avatar, etc.) |
| `tieba_user_posts` | Get user post list (paginated) |
| `tieba_user_like_forums` | Get user liked forums list |
### System
| Tool | Description |
|------|-------------|
| `tieba_health` | Check upstream API service status |
> All tools are read-only, no authentication required.
## Usage Examples
In Claude:
```
Help me find recent popular threads in "Graphics Card" forum
```
```
Search for threads about "new operators" in "Rainbow Six" forum
```
```
View basic information of user "Tieba God"
```
## Environment Variables
| Variable | Default Value | Description |
|----------|---------------|-------------|
| `TIEBA_API_BASE` | `https://cf.eztb.org` | Upstream API address |
## Architecture
```
AI Assistant (Claude)
│ MCP Protocol (stdio)
▼
tieba-mcp Server
│ HTTP / SSE
▼
Tieba-API-SCF (cf.eztb.org)
│
▼
Baidu Tieba Server
```
## Working Principle
This MCP server proxies requests through [Tieba-API-SCF](https://github.com/Dilettante258/Tieba-API-SCF), which is a REST wrapper for Baidu Tieba's internal API. All communication between the MCP server and the upstream API is encrypted with HTTPS.
## Project Structure
```
tieba-mcp/
├── src/
│ ├── index.ts # Entry: start stdio transport
│ ├── server.ts # McpServer creation and tool registration
│ ├── client/
│ │ └── tieba-client.ts # HTTP client (including SSE stream processing)
│ ├── tools/
│ │ ├── system.tools.ts # tieba_health
│ │ ├── user.tools.ts # User-related tools
│ │ └── forum.tools.ts # Forum-related tools
│ ├── schemas/common.ts # Shared Zod Schema
│ └── types/api.ts # API type definitions
├── assets/
│ ├── logo.svg # Logo
│ └── icon.svg # Small icon
├── tests/ # Test files
├── dist/ # Build output
├── package.json
├── tsconfig.json
└── README.md
```
## Related Projects
- [Tieba-API-SCF](https://github.com/Dilettante258/Tieba-API-SCF) — Upstream REST API service
- [aiotieba](https://github.com/Starry-OvO/aiotieba) — Python asynchronous Tieba API library
- [Model Context Protocol](https://modelcontextprotocol.io/) — Official MCP documentation
## License
[MIT](LICENSE)