2cbd6b28b2acdd567537c5349d77b678da3ce69b
Social Auto Hub (Monorepo)
This repository is now a workspace monorepo with clear visual separation:
apps/xhs-mcp: Xiaohongshu MCP service (xhs_*tools)apps/xhh-mcp: Xiaoheihe MCP service (xhh_*tools)packages/core: shared infrastructure (browser/config/cookie/server/utils)
Workspace Layout
apps/
xhs-mcp/
xhh-mcp/
packages/
core/
Quick Start
Prerequisites
- Node.js >= 22
- pnpm
Install
pnpm install
npx rebrowser-playwright install chromium
Build all packages
pnpm build
Run XHS service
pnpm start:xhs
Default runtime values:
PORT=9527COOKIE_DIR=~/.social-mcp-xhs
Run XHH service
pnpm start:xhh
Default runtime values:
PORT=9528COOKIE_DIR=~/.social-mcp-xhh
Compatibility Root Scripts
Root scripts are kept as forwarding wrappers:
pnpm buildpnpm lintpnpm testpnpm start:xhspnpm start:xhhpnpm dev:xhspnpm dev:xhh
You can also run package-level commands directly:
pnpm --filter @social/core build
pnpm --filter @social/xhs-mcp start
pnpm --filter @social/xhh-mcp start
MCP Endpoints
- XHS MCP:
http://127.0.0.1:9527/mcp - XHH MCP:
http://127.0.0.1:9528/mcp
REST Endpoints
- XHS REST:
http://127.0.0.1:9527/api/xhs/* - XHH REST:
http://127.0.0.1:9528/api/xhh/*
Each service uses its own bearer token file under its COOKIE_DIR.
Claude Desktop Example
{
"mcpServers": {
"mcp-xhs": {
"url": "http://127.0.0.1:9527/mcp"
},
"mcp-xhh": {
"url": "http://127.0.0.1:9528/mcp"
}
}
}
Docker
Single Dockerfile supports dual app targets via build arg:
APP_NAME=xhs-mcpAPP_NAME=xhh-mcp
Compose files already define both services:
docker-compose.ymldeploy/docker-compose.yml
Migration Notes
- Old root runtime entry (
src/index.ts) is removed. - Service code now lives inside
apps/*. - Shared runtime logic now lives inside
packages/core. - Lockfile strategy is pnpm-only (
pnpm-lock.yaml).
Description
Languages
TypeScript
99.2%
Dockerfile
0.6%