uc-mcp服务器
MCP(模型上下文协议)服务器,用于以编程方式与 未知饮食 论坛。使用真实的Chrome实例绕过Cloudflare保护,并通过Cheerio提供结构化数据提取。
](https://www.npmjs.com/package/uc-mcp-server) 
特性
- Cloudflare旁路 --用途
puppeteer-real-browser带有头部的Chrome实例,可自动解决旋转栅门挑战 - Cookie持久性 --会话Cookie已保存到
cookies.json并在重启过程中重复使用 - 自动恢复 --检测分离的框架/浏览器崩溃错误并自动重新启动
- 6个MCP工具 --登录、搜索、线程读取、分页、代码提取和调试
工具
| 工具 | 说明 | 参数 |
|---|---|---|
check_login | 检查浏览器会话是否已登录 | -- |
login | 自动填写凭据并登录 | username, password |
search_forum | 搜索UC或浏览子论坛 | query, subforum? |
get_thread | 获取带有分页的线程帖子 | url, fetch_all_pages? |
extract_code | 提取C++/C#/Python/Lua代码块 | url, limit?, export_to_file? |
debug_page | 检查原始页面结构以进行调试 | url |
提取代码详细信息
| 参数 | 默认值 | 说明 |
|---|---|---|
url | 必需 | 线程URL |
limit | 10 (最大值 50) | 内联返回的最大块数 |
export_to_file | false | 保存 全部 块到 exports/_.json |
当达到限制时,响应包括 truncated: true, last_post_id (所以你知道在哪里继续),并提示跳过了多少块。每个区块还携带一个 postId 这样你就可以追溯到页面上的确切帖子。
堆栈
- 运行时: 包子
- 语言:TypeScript(ESM)
- 协议: @模型上下文协议/sdk
- 浏览器: 木偶师真实浏览器
- 解析: 再见
需求
- 包子 v1.0+
- 安装了谷歌Chrome浏览器(木偶师真实浏览器需要)
安装
# via npm
npx uc-mcp-server
# or clone
git clone https://github.com/amaralkaff/mcp-unknowncheat.git
cd mcp-unknowncheat
bun install使用Claude代码进行设置
claude mcp add uc-mcp bun -- run "/path/to/mcp-unknowncheat/src/index.ts"或者使用npx:
claude mcp add uc-mcp npx -- uc-mcp-server使用Claude Desktop进行设置
添加 %APPDATA%\Claude\claude_desktop_config.json (Windows)或 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"uc-mcp": {
"command": "npx",
"args": ["uc-mcp-server"]
}
}
}用法
第一次运行时,Chrome会以头部模式打开。手动登录或使用 login 工具:
login({ username: "your_username", password: "your_password" })Cookie会自动保存。后续运行会重用会话。
例子
# Check login status
check_login()
# Browse the Apex Legends subforum
search_forum({ subforum: "apex-legends" })
# Search across all forums
search_forum({ query: "pubg offsets" })
# Get a thread (single page)
get_thread({ url: "https://www.unknowncheats.me/forum/..." })
# Get all pages of a thread
get_thread({ url: "https://www.unknowncheats.me/forum/...", fetch_all_pages: true })
# Extract code blocks (up to 10 inline)
extract_code({ url: "https://www.unknowncheats.me/forum/..." })
# Extract all code blocks and save to file
extract_code({ url: "https://www.unknowncheats.me/forum/...", export_to_file: true })项目结构
src/
├── index.ts # MCP server entry + tool registration
├── browser.ts # Chrome lifecycle, Cloudflare bypass, cookie persistence
├── types.ts # Shared TypeScript interfaces
├── tools/
│ ├── check-login.ts
│ ├── login.ts
│ ├── search-forum.ts
│ ├── get-thread.ts
│ ├── extract-code.ts
│ └── debug-page.ts
└── parsers/
├── thread.ts # Post extraction, pagination
├── search-results.ts # Search result parsing
├── code-blocks.ts # Code extraction + language detection
└── tags.ts # Thread tag detection ([Source], [Release], etc.)备注
- 所有日志记录用途
console.error()—console.log()保留用于MCP stdio传输 - 默认情况下,线程分页限制为50页
fetch_all_pages - 语言检测支持:C++、C#、Python、Lua
- 导出的文件保存到
./exports/并且被排除在git和npm之外
问题
发现错误或想要请求功能?在以下网址打开问题:
https://github.com/amaralkaff/mcp-unknowncheat/issues
