一个强大的LinkedIn个人资料分析器MCP(模型上下文协议)服务器,通过与LinkedIn的API交互来获取、分析和管理LinkedIn帖子数据。此MCP特别设计用于与Claude AI配合工作。
git clone https://github.com/rugvedp/linkedin-mcp.git
cd linkedin-mcp
pip install -r requirements.txt
.env文件RAPIDAPI_KEY=your_rapidapi_key_here
linkedin-mcp/
├── main.py # 主MCP服务器实现
├── mcp.json # MCP配置文件
├── requirements.txt # Python依赖项
├── .env # 环境变量
└── README.md # 文档
mcp.json文件配置了LinkedIn MCP服务器:
{
"mcpServers": {
"LinkedIn Updated": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"path/to/your/script.py"
]
}
}
}
确保更新args中的路径以匹配您本地文件的位置。
获取给定用户名的LinkedIn帖子并将其保存在本地。
fetch_and_save_linkedin_posts(username: str) -> str
检索已保存的帖子,支持分页。
get_saved_posts(start: int = 0, limit: int = 10) -> dict
搜索特定关键词的帖子。
search_posts(keyword: str) -> dict
根据互动指标返回表现最佳的帖子。
get_top_posts(metric: str = "Like Count", top_n: int = 5) -> dict
按指定日期范围筛选帖子。
get_posts_by_date(start_date: str, end_date: str) -> dict
该项目使用了LinkedIn Data API的以下端点:
GET /get-profile-posts: 从LinkedIn个人资料获取帖子
https://linkedin-data-api.p.rapidapi.comx-rapidapi-key: 您的RapidAPI密钥x-rapidapi-host: linkedin-data-api.p.rapidapi.comgit checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)本项目采用MIT许可证 - 查看LICENSE文件了解详情。