使用说明
Claude的LinkedIn求职
一个自主的MCP服务器,不断抓取LinkedIn作业,并提供即时的数据库支持查询。具有后台抓取配置文件、应用程序跟踪和可组合响应模型。
特性
MCP服务器(后端)
- 自主背景抓取 --可配置的配置文件,可连续刮擦
- SQLite数据库 使用FTS5全文搜索和WAL模式进行并发访问
- 11个MCP工具 分为4类:查询、配置文件管理、应用程序跟踪、分析
- 缓存优先服务 --来自本地数据库的即时(<100ms)查询
- 异步HTTP抓取 使用httpx(无需浏览器)
- 可组合Pydantic模型 --令牌高效响应
exclude_none=True
集成功能
- 作业查询 --可组合过滤器(公司、地点、关键字、远程、签证、发布日期)
- 现场探索 --按需抓取最近1-10个工作岗位
- 配置文件管理 --添加/更新/删除自主抓取配置文件
- 应用程序跟踪 --跟踪应用程序状态和注释
- 公司丰富 --自动查找公司元数据
- 工作变更检测 --字段随时间变化的审计日志
- 分析 --数据库统计和抓取配置文件运行状况
先决条件
安装
克隆存储库并使用Pixi安装依赖项:
git clone https://github.com/francisco-perez-sorrosal/linkedin-mcp.git
cd linkedin-mcp
pixi install
项目结构
linkedin-mcp/
├── src/linkedin_mcp_server/
│ ├── main.py # FastMCP server with 11 async tools
│ ├── db.py # SQLite database layer with FTS5 search
│ ├── background_scraper.py # Autonomous background scraping service
│ ├── scraper.py # Async HTTP scraper (httpx + BeautifulSoup)
│ ├── models.py # Pydantic response models (composable)
│ └── migrate_cache.py # JSONL → SQLite migration script
├── skills/
│ └── linkedin-job-search/ # Job search orchestration skill
│ ├── SKILL.md
│ └── references/
│ └── tool-mapping.md
├── tests/
│ ├── test_db.py # Database unit tests (37 tests)
│ ├── test_scraper.py # Scraper parsing tests (33 tests)
│ ├── test_background_scraper.py # Background scraper tests (17 tests)
│ ├── test_integration.py # End-to-end tests (6 tests)
│ ├── test_migrate_cache.py # Migration tests (7 tests)
│ ├── test_models.py # Pydantic model tests (17 tests)
│ └── fixtures/ # HTML fixtures for tests
└── pyproject.toml
运行服务器
本地开发
# stdio transport (for local Claude Desktop integration)
pixi run mcps --transport stdio
# streamable-http transport (for remote access)
pixi run mcps --transport streamable-http
# Direct execution with uv
uv run --with "mcp[cli]" mcp run src/linkedin_mcp_server/main.py --transport streamable-http
HTTP服务器运行在 http://localhost:10000/mcp 默认情况下。
MCP检查模式
DANGEROUSLY_OMIT_AUTH=true npx @modelcontextprotocol/inspector pixi run mcps --transport stdio
开发任务
pixi run test # Run tests
pixi run lint # Check linting
pixi run format # Apply formatting and fix lint issues
pixi run build # Build package (creates sdist/wheel in dist/)
MCP工具
服务器公开了11个工具,分为4类。有关详细的工具比较、默认参数和使用模式,请参阅 skills/linkedin-job-search/references/tool-mapping.md.
作业查询工具
1.explore_tlatest_jobs
实时抓取最近1-10个作业(10-30秒)。
explore_latest_jobs(
keywords="AI Engineer or ML Engineer or Principal Research Engineer",
location="San Francisco, CA",
distance=25, # miles
limit=1 # max 10
)
2.查询_ jobs
使用可组合过滤器的即时数据库查询(<100ms)。
query_jobs(
company="Anthropic",
location="San Francisco",
keywords="ML Engineer",
posted_after_hours=168, # Last week
remote_only=True,
visa_sponsorship=True,
limit=20,
sort_by="posted_date_iso",
include_description_insights=True,
include_metadata=False,
include_full_description=False
)
配置文件管理工具
3.add_scraping_profile
添加自主抓取配置文件(工人在30秒内出生)。
4.列表_抓取_文件
列出所有具有状态的刮擦配置文件。
5.update_scraping_profile
更新配置文件配置(更改将在下次重新加载时应用)。
6.delete_scraping_profile
禁用(软删除)或永久删除配置文件。
应用程序跟踪工具
7.标记_job_已应用
使用可选注释跟踪工作申请。
8.更新_应用程序_状态
更新状态(已应用→ 面试→ 提供/拒绝)。
9.列表_应用程序
按状态查询应用程序。
分析工具
10.get_cache_analytics
数据库统计、抓取配置文件运行状况、应用程序计数。
11.get_job_changes
字段随时间变化的审计日志。
Claude桌面集成
本地配置(stdio)
增添 claude_desktop_config.json:
{
"linkedin_mcp_fps": {
"command": "uv",
"args": [
"run",
"--with", "mcp[cli]",
"--with", "pymupdf4llm",
"mcp", "run",
"src/linkedin_mcp_server/main.py",
"--transport", "streamable-http"
]
}
}
远程配置(HTTP)
要连接到远程MCP服务器:
{
"linkedin_mcp_fps": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:10000/mcp"]
}
}
根据部署需要更换主机和端口。
MCP束(mcpb)
构建并安装为扩展:
pixi run mcp-bundle
pixi run pack
输出文件 linkedin-mcp-fps.mcpb 创建于 mcpb-package/。双击以在Claude Desktop中安装。
Claude代码技能
工作流编排的客户端技能(位于 skills/):
linkedin求职
交互式求职工作流程:
- 步骤1:收集搜索参数(关键字、位置、距离、限制)
- 步骤2:在实时探索或数据库查询之间进行选择
- 步骤3:在可扫描的表格中显示结果
- 步骤4:使用不同的过滤器优化搜索
- 第五步:提供下一步行动
激活:“找工作”、“搜索职位”、“求职”。
看 skills/linkedin-job-search/SKILL.md 详细文档。
建筑
1.MCP服务器(main.py)
- 采用FastMCP框架构建
- 可配置的传输模式:stdio、可流式传输http
- 11个异步工具,用于作业查询、配置文件管理、应用程序跟踪和分析
- 缓存优先服务:查询立即从SQLite数据库返回
- 自动根据环境变量检测运输模式
2.数据库层(db.py)
- SQLite具有WAL模式,用于并发读/写
- FTS5职位描述和头衔全文搜索
- 5个表:作业、报废文件、应用程序、公司丰富、作业变更
- 默认位置:
~/.linkedin-mcp/jobs.db - 具有多个过滤器的可组合查询
- 性能:典型查询小于100ms
3.后台剪贴服务(background_scraper.py)
- 在MCP服务器进程中连续运行(异步任务)
- 每个刮削配置文件一名工人(可通过MCP工具配置)
- 默认配置文件:加利福尼亚州旧金山,25英里,“AI工程师或ML工程师或首席研究工程师”,刷新2小时
- Semaphore(10)用于抓取工作,Semaphores(2)用于丰富公司资源
- 指数退避自适应速率限制
- 通过异步任务协调实现优雅的启动/关闭
4.网页剪贴器(scraper.py)
- LinkedIn Guest API的异步httpx(不需要Selenium)
- 增强提取:薪资解析、远程/签证检测、技能提取
- 模糊匹配的公司名称规范化
- 用于类型安全的冻结数据类:
JobSummary,JobDetail - 具有随机延迟(1-3s)和指数退避的速率限制
领英API端点
系统使用LinkedIn的访客API:
- 职位搜索:
https://www.linkedin.com/jobs-guest/jobs/api/seeMoreJobPostings/search-results/ - 工作详情:
https://www.linkedin.com/jobs-guest/jobs/api/jobPosting/{job_id}
参数:
location:搜索位置(URL编码)distance:半径(英里)(10、25、35、50、75、100)keywords:职位搜索查询(URL编码)start:分页偏移- 可选过滤器:
f_E(经验),f_JT(作业类型),f_WT(工作安排),f_TPR(发布时间)
依赖项
| 包 | 版本 | 角色 |
|---|---|---|
httpx |
>=0.28.1,<0.29 | LinkedIn API的异步HTTP客户端 |
mcp[cli] |
>=1.9.2,<2 | FastMCP框架 |
beautifulsoup4 |
>=4.13.4,<5 | HTML解析 |
pydantic |
>=2.10.6,<3 | 带exclude_none的可组合反应模型 |
loguru |
>=0.7.3,<0.8 | 结构化日志记录 |
远离的: selenium, requests, jsonlines, pyyaml (cache.py已删除,已移至SQLite)
所有依赖项都通过Pixi进行管理(请参阅 pyproject.toml).
从JSONL缓存迁移
如果您有v0.2.0中的现有JSONL缓存,请运行迁移脚本:
pixi run python src/linkedin_mcp_server/migrate_cache.py
这将:
- 备份现有JSONL缓存(创建
.jsonl.backup) - 将所有作业迁移到SQLite数据库
~/.linkedin-mcp/jobs.db - 转换和填充增强字段(工资、远程、签证、技能)
- 保留所有原始作业数据
迁移是幂等的,可以安全地重新运行。迁移后,不再使用JSONL缓存。
部署
远程部署(render.com)
在部署仪表板中设置环境变量:
TRANSPORT=streamable-http
PORT=10000
生成 requirements.txt 对于render.com:
uv pip compile pyproject.toml > requirements.txt
添加 runtime.txt 与:
python-3.13.0
使用示例
查询缓存作业
Find remote ML Engineer jobs at Anthropic posted in the last week
现场探索
Explore the 5 most recent AI Engineer jobs in Seattle
配置文件管理
Add a scraping profile for Research Engineer jobs in Boston, 35 mile radius, refresh every 4 hours
应用程序跟踪
Mark job 1234567890 as applied with note "Applied via company website"
Update application status for job 1234567890 to interviewing with note "Phone screen scheduled for Friday"
分析
Show me cache analytics and scraping profile status
使用技能
@linkedin-job-search Find remote Python Engineer jobs in New York
故障排除
| 问题 | 解决方案 |
|---|---|
| 导入错误 | 运行 pixi install 安装依赖项 |
| 数据库已锁定 | 另一个进程可能已打开数据库;关闭其他连接 |
| 后台刮刀未运行 | 检查日志;验证配置文件是否在中启用 list_scraping_profiles() |
| 查询结果为空 | 数据库可能为空;等待首次刮擦或使用 explore_latest_jobs() |
| 速率限制(429/503) | 自动退避;检查日志以了解错误率 |
| 权限错误 | 确保 ~/.linkedin-mcp/ 目录可写 |
| 迁移失败 | 从还原 .jsonl.backup 并重试;检查日志是否有错误 |
未来的增强功能
其他客户端技能
为未覆盖的工具类别创建工作流编排技能:
- 档案管理技能 --用于配置自主抓取配置文件的交互式工作流程
- 应用程序跟踪技能 --引导用户完成标记应用程序和跟踪状态更改
- 分析技能 --以可扫描格式显示缓存统计信息和作业趋势
目前,只有求职有专门的技能。其他工具可直接通过MCP访问。
有关其他功能(重复检测、ML评分、代理支持等),请参阅CLAUDE.md未来增强部分。
支持
有关问题和功能请求,请访问:https://github.com/francisco-perez-sorrosal/linkedin-mcp
许可证
MIT许可证。看 pyproject.toml 了解详情。