boss-client
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.
本项目与 BOSS直聘官方无关。仅使用本人/授权账号做低频只读查询,不提供沟通、投递、简历修改等写操作;请遵守平台服务条款与当地法律。
为什么是 boss-client?
🔐 会话留在本地 | 🧠 为 Agent 设计 | 🧱 一个进程做 owner |
cloakbrowser + 独立 profile,登录态、二维码、Cookie 都不出本机;REST 只监听 | 16 个稳定操作,统一 envelope、分页、错误码;同时提供 CLI、OpenAPI、MCP tools 和 SKILL。 | systemd 服务是唯一持有浏览器/profile 的 owner;CLI/MCP 都只是客户端,不会互相抢 profile。 |
Related MCP server: ops-mcp-kit
30 秒开始
git clone https://github.com/CindyRIng/boss-client.git
cd boss-client
npm install && cp .env.example .env
# 编辑 .env:至少设置 BOSS_API_TOKEN
npm run build
ln -sf "$PWD/bin/boss-run" ~/.local/bin/boss
boss login --qr # 首次登录:终端渲染二维码,用 BOSS App 扫码
boss status # 登录态 / 会话剩余 / 风控 / 缓存
boss search jobs --keyword 外贸 --city 101090100 --page-size 15 --pages 1首次/掉线登录需要人工扫码或短信验证码;之后复用
~/.boss-client/profile,实测会话约 10 天。
它能做什么
能力 | CLI | REST | MCP |
健康检查 |
|
|
|
登录态 / 会话 / 风控 |
|
|
|
登录中继(二维码 / 短信 / 极验) |
|
|
|
岗位搜索 |
|
|
|
岗位翻页 |
|
|
|
岗位详情 |
|
|
|
去重公司列表 |
|
|
|
公司详情(含工商信息) |
|
|
|
公司全部职位 |
|
|
|
城市注册表 |
|
|
|
缓存统计 / 清理 |
|
|
|
一张图看懂架构
flowchart LR
AG["Claude / Codex / DSH<br/>业务系统"] --> CLI["CLI"]
AG --> REST["REST :8790"]
AG --> MCP["MCP stdio"]
AG --> SK["SKILL"]
CLI --> SVC["boss-client.service<br/>唯一 owner"]
REST --> SVC
MCP --> SVC
SK --> SVC
SVC --> BR["cloak browser<br/>~/.boss-client/profile"]
SVC --> DB[("SQLite cache<br/>queries / jobs / companies")]
BR <-->|"页面操作 + 页面内 fetch"| BOSS["BOSS直聘"]关键约束: 浏览器/profile 只能有一个 owner。常驻服务运行时,CLI 通过 BOSS_CLIENT_URL 走 REST,MCP 默认代理到 REST;只有显式 boss mcp --local 才会本地启动浏览器。
模式 | 适用场景 | 行为 |
常驻服务 + 客户端(推荐) | Agent、长期使用 | systemd 持有浏览器/profile;CLI/MCP 通过 REST 调用 |
单机 CLI | 临时查询、开发 | 没有服务时 CLI 自己启动本地 App |
MCP | 无服务的独立调试 | MCP 自己持有 profile;不要和常驻服务同时使用 |
~/.boss-client/run/boss.lock 是单实例锁;它能防止两个 Chromium 同时写同一个 userDataDir,所以不要删除锁或绕开它。
快速使用
CLI
boss status
boss search jobs --keyword 外贸 --city 101090100
boss jobs list --query-id q_20261111_ab12cd --page 2
boss jobs detail --job-id 9b480e5d72caccd303Zz3du6FFFS
boss companies list --query-id q_20261111_ab12cd --fetch-pages 1
boss companies detail --id 'd6c15290231e61e21Hd70965EFY~'
boss companies jobs --id 'd6c15290231e61e21Hd70965EFY~'默认输出统一 envelope JSON;boss --format table ... 输出简表。需要管道时:
BOSS_LOG_STDOUT=false boss status | jq .REST
boss serve --port 8790
# 交互文档 / OpenAPI
# 浏览器打开 http://127.0.0.1:8790/docs
curl http://127.0.0.1:8790/openapi.json
# 除 /v1/health 外需要 Bearer
curl -H "Authorization: Bearer $BOSS_API_TOKEN" \
http://127.0.0.1:8790/v1/status
curl -X POST http://127.0.0.1:8790/v1/search/jobs \
-H "Authorization: Bearer $BOSS_API_TOKEN" \
-H 'content-type: application/json' \
-d '{"keyword":"外贸","cityCode":"101090100","page":1,"pageSize":15,"pages":1}'MCP
MCP 进程不持有浏览器,默认代理到常驻 REST 服务:
{
"mcpServers": {
"boss-client": {
"command": "/path/to/boss-client/bin/boss-run",
"args": ["mcp"],
"env": {
"BOSS_CLIENT_URL": "http://127.0.0.1:8790",
"BOSS_API_TOKEN": "change-me"
}
}
}
}boss mcp # 默认代理;服务未启动时返回 SERVICE_UNAVAILABLE
boss mcp --proxy # 显式代理
boss mcp --local # 无服务时本地运行;不要与常驻服务同时用工具清单见 spec/mcp-tools.json,SKILL 见 skills/boss/SKILL.md。
安装与登录
前置
Linux(已在 NixOS 26.11 验证);Node.js ≥ 22.5;FHS 内 Node 22.23.2
~/cloak-env:共享 cloakbrowser FHS 环境,见 docs/04-环境配套.md一个可登录 BOSS直聘的求职者账号
登录/短信极验需要 headful(桌面或 Xvfb);二维码模式可 headless
~/cloak-env/bin/cloak-env-info安装
git clone https://github.com/CindyRIng/boss-client.git
cd boss-client
npm install
cp .env.example .env
# 至少设置 BOSS_API_TOKEN;短信登录再设置 BOSS_PHONE
npm run build && npm test && npm run gen
ln -sf "$PWD/bin/boss-run" ~/.local/bin/boss
boss health登录(首次/掉线人工一次)
# 推荐:headless 下直接输出二维码
boss login --qr
boss login --relay # 只输出 LoginSession(含 qr.pngBase64),适合远程 Agent
# 短信:需要 headful
BOSS_HEADLESS=false boss login --sms短信/极验无法可靠自动破解;二维码模式不需要可视浏览器。登录成功后 profile 持久化,boss status 应显示 loggedIn=true。
配置
完整变量见 .env.example 与 docs/03-部署与使用.md。
变量 | 默认 | 说明 |
|
| REST/MCP Bearer,部署必须修改 |
| 空 | 短信登录手机号 |
|
| 独立浏览器 profile |
|
| SQLite 结构化缓存 |
|
| 默认无头;二维码扫码可用;短信/极验需临时 false |
|
| REST 端口(本机 tanji 占用 8787–8789) |
| 空 | CLI/MCP 代理的 REST 地址;缺省按 host/port 推导 |
|
| 默认城市码,逗号分隔多城市 |
|
| 上游请求/分钟 |
|
| 单任务最多页数 |
部署
mkdir -p ~/.config/systemd/user
cp systemd/boss-client.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now boss-client
systemctl --user status boss-client服务默认读取 %h/boss-client/.env,执行 bin/boss-run serve --port 8790。日志:journalctl --user -u boss-client -f。
项目结构
src/
api/ 操作注册表 + dispatch(单一事实源)
adapters/boss/ 端点、页面内 API、DOM 提取、映射、限频
browser/ cloak 浏览器宿主
cache/ SQLite / 内存缓存
config/ 配置
domain/ zod 领域模型
generators/ OpenAPI / MCP / CLI / schema 生成
session/ 会话 / 登录中继 / 心跳
transports/ REST / CLI / MCP
service.ts 服务层
tests/ 单元测试(无浏览器)
spec/ 生成物(openapi.json / mcp-tools.json / schemas / operations)
docs/ PRD、接口草案、部署、环境配套
skills/boss/ SKILL
systemd/ systemd user unit
exploration/ 2026-11-11 实测记录(artifacts 不入库)安全与合规
REST 仅
127.0.0.1+ Bearer;profile/cache/log 权限 600/700。二维码、验证码、短信码、Cookie、token 不落长期日志;登录中继仅本机。
只读;低频;单账号;不做账号共享、批量导流或自动化投递。
请遵守 BOSS直聘用户协议与当地法律;因使用产生的账号/合规风险由使用者承担。
文档
文档 | 内容 |
全部文档的入口与推荐阅读顺序 | |
目标/非目标、架构、功能需求、缓存、验收 | |
envelope、错误码、数据模型、操作契约、SQLite | |
安装、配置、登录、CLI/REST/MCP、systemd、排障 | |
cloak-env/FHS、版本、profile、DISPLAY/Xvfb、权限 | |
真实登录/搜索/详情/公司页实测与证据索引 |
License
MIT © 2026 CindyRIng
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Chinese company registry, litigation, IP and credit data for AI agents. Read-only remote MCP server.
Remote MCP server for China brand visibility, destination demand, and KOL discovery workflows.
Hosted read-only Xiaohongshu (RedNote) data MCP. No XHS account or cookies required.
811Douyin short video, Xiaohongshu (RedNote) notes, comments & creator profile scraper remote MCP API.
Related MCP Servers
- AlicenseBqualityAmaintenanceLocal MCP server for BOSS Zhipin workflows. Exposes 49 tools for job search, welfare filtering, recruiter messaging, pipeline tracking, and resume optimization for AI agents.9023,138 PyPI2,312MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to query company logs, databases, caches, and config centers (e.g., Aliyun SLS, MySQL, Redis, Nacos) through local MCP servers, with read-only enforcement and SSH tunneling for production access.-
- AlicenseNot gradedqualityDmaintenanceMCP server for searching BOSS直聘 (Boss Zhipin) job listings. It provides a boss_search tool that supports multi-city queries, keyword filtering, and JSON output for AI agents.18MIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to perform low-frequency, read-only Zhaopin job and company searches through a local browser session, exposing job listings, job details, company profiles with business registration, company jobs, cities, health, verification, and cache operations via MCP.MIT