使用说明
LinkedIn MCP 服务器
一个用于获取LinkedIn个人资料的模型上下文协议(MCP)服务器。以YAML格式返回个人资料数据。
先决条件
- .NET 9.0 或更高版本
- 一个Apify API令牌(在这里获取一个)
安装
使用 dotnet 全局安装该工具:
dotnet tool install --global Linkedin.Mcp
配置
1. 设置您的Apify API令牌
该工具需要 APIFY_TOKEN 需要设置的环境变量。
Windows(PowerShell):
$env:APIFY_TOKEN = "your-apify-token-here"
# To persist across sessions:
[System.Environment]::SetEnvironmentVariable('APIFY_TOKEN', 'your-apify-token-here', 'User')
Linux/macOS:
export APIFY_TOKEN=your-apify-token-here
# To persist, add to ~/.bashrc or ~/.zshrc:
echo 'export APIFY_TOKEN=your-apify-token-here' >> ~/.bashrc
2. 配置Claude代码
将MCP服务器添加到您的Claude代码配置文件中。
地点:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
配置:
{
"mcpServers": {
"linkedin": {
"command": "linkedin-mcp",
"env": {
"APIFY_TOKEN": "your-apify-token-here"
}
}
}
}
或者,如果你已经全局设置了环境变量,那么可以省略 env 部分/章节:
{
"mcpServers": {
"linkedin": {
"command": "linkedin-mcp"
}
}
}
在Claude代码中的使用
配置完成后,重启Claude Code。您将可以使用以下工具访问LinkedIn MCP服务器:
fetch-profile
获取LinkedIn个人资料并以YAML格式返回。
参数:
profile_url(必填):LinkedIn个人资料URLinclude(可选):输出中包含的可选部分的数组。如果未指定,则包含所有部分。
可选部分:
experiences- 工作经历历史updates- 最近的活动和帖子profilePicAllDimensions- 所有头像尺寸skills- 技能和推荐信educations- 教育背景licenseAndCertificates- 专业认证honorsAndAwards- 荣誉和奖项languages- 语言能力volunteerAndAwards- 志愿工作verifications- 身份验证(或个人资料验证)promos- 宣传内容highlights- 个人资料亮点projects- 项目publications- 出版物patents- 专利courses- 课程testScores- 测试成绩organizations- 组织volunteerCauses- 志愿服务事业interests- 兴趣recommendations- 建议
注: 基本资料字段(姓名、职位、所在地、简介等)总是会被包含,无论 include 参数。
示例提示:
- “获取 https://www.linkedin.com/in/username 的 LinkedIn 个人资料”
- “获取这个LinkedIn网址的个人资料信息:https://www.linkedin.com/in/用户名”
- “请展示我来自 https://www.linkedin.com/in/username 的工作经验。”
- “获取个人资料,但仅包含经历和技能部分”
- “获取仅包含教育背景和证书的个人资料”
支持的URL格式:
https://www.linkedin.com/in/usernamehttps://linkedin.com/in/usernamehttp://www.linkedin.com/in/usernamelinkedin.com/in/username