使用说明
凯恩
凯恩是一个MCP服务器,可以将任何公司的职业页面转换为AI代理的结构化、可查询的工作数据。将其指向Greenhouse板、Lever列表、Workday门户或纯HTML职业页面——凯恩在不丢失数据的情况下抓取所有帖子,将其标准化为一致的模式,并将其作为MCP工具公开,克劳德(或任何与MCP兼容的代理)可以直接调用。无需手动复制粘贴,无需脆弱的电子表格:只需按需提供干净的工作情报。
安装
1.克隆并进入仓库
git clone https://github.com/chalshik/cairn.git
cd cairn
2.创建虚拟环境
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
3.安装Python依赖项
pip install mcp httpx beautifulsoup4 playwright
4.安装Playwright浏览器
playwright install chromium
使用克劳德代码注册
claude mcp add cairn -- python main.py
验证它是否出现:
claude mcp list
MCP工具
| 工具 | 说明 |
|---|---|
scrape_jobs(url) |
从职业页面上删除所有招聘信息。返回一个JSON数组。 |
filter_jobs(jobs, keyword) |
按关键字(标题/部门/位置/描述)过滤数组。 |
get_job_detail(job_url) |
通过URL获取单个帖子的完整描述 |
输出模式(每个作业)
{
"title": "Senior Backend Engineer",
"department": "Engineering",
"location": "Remote – US",
"url": "https://boards.greenhouse.io/stripe/jobs/12345",
"description": "Full plain-text description...",
"posted_date": "2024-03-01T00:00:00Z"
}
支持的平台
| 平台 | 方法 |
|---|---|
| 温室 | 公共API(boards-api.greenhouse.io)--快速无损 |
| 杠杆 | 公共API(api.lever.co) |
| 工作日/定制JS板 | 剧作家(无头Chromium),带滚动+分页功能 |
| 静态HTML页面 | httpx+BeautifulSoup启发式提取 |
克劳德提示示例
Show me all open engineering roles at Stripe.
→ Use scrape_jobs("https://boards.greenhouse.io/stripe")
Find remote senior product manager roles at Notion.
→ Use scrape_jobs on Notion's careers page, then filter_jobs with "senior product manager remote"
What does Figma's Staff Designer role require?
→ Use get_job_detail("<job-url from scrape_jobs output>")
Compare backend engineering openings across Vercel and Linear.
→ scrape_jobs for each, then filter_jobs with "backend engineer" on both results
List all jobs in Berlin at Contentful.
→ scrape_jobs("https://www.contentful.com/careers/") then filter_jobs with "berlin"
码头工人
在集装箱内,凯恩作为一个 HTTP+SSE服务器 在端口8000上, 因此,它保持活力,并像真正的服务一样接受连接。
从Docker Compose开始(推荐)
docker compose up --build
服务器将在以下时间可用 http://localhost:8000/sse.
或者手动构建和运行
docker build -t cairn .
docker run -p 8000:8000 cairn
使用克劳德代码注册(SSE运输)
claude mcp add --transport sse cairn http://localhost:8000/sse
改用stdio传输(无HTTP)
如果您更喜欢原始的stdio模式(由Claude Code管理的进程):
claude mcp add cairn -- docker run -i --rm -e CAIRN_TRANSPORT=stdio cairn
项目结构
cairn/
├── main.py # MCP server — tool registration and entry point
├── scraper.py # Careers page scraper (Greenhouse API, Lever API, httpx, Playwright)
├── parser.py # Normalisation, deduplication, grouping, and filtering
├── Dockerfile
├── requirements.txt
├── .dockerignore
└── README.md
需求
- Python 3.11+
mcp--MCP Python SDKhttpx--支持异步的HTTP客户端beautifulsoup4--HTML解析playwright--JS渲染页面的无头浏览器
