这是一个强大的 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
中的路径以匹配你本地文件的位置。
fetch_and_save_linkedin_posts
获取指定用户名的 LinkedIn 帖子并将其保存到本地。
fetch_and_save_linkedin_posts(username: str) -> str
get_saved_posts
检索已保存的帖子,并支持分页。
get_saved_posts(start: int = 0, limit: int = 10) -> dict
search_posts
搜索包含特定关键词的帖子。
search_posts(keyword: str) -> dict
get_top_posts
根据参与度指标返回表现最佳的帖子。
get_top_posts(metric: str = "Like Count", top_n: int = 5) -> dict
get_posts_by_date
过滤指定日期范围内的帖子。
get_posts_by_date(start_date: str, end_date: str) -> dict
本项目使用了 LinkedIn 数据 API 的以下端点:
GET /get-profile-posts
:从 LinkedIn 个人资料中获取帖子。
https://linkedin-data-api.p.rapidapi.com
x-rapidapi-key
:你的 RapidAPI 密钥x-rapidapi-host
:linkedin-data-api.p.rapidapi.com
git checkout -b feature/amazing-feature
)。git commit -m 'Add amazing feature'
)。git push origin feature/amazing-feature
)。本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。