@马海迪姆/领英mcp
](https://badge.fury.io/js/@maheidem%2Flinkedin-mcp) 
全面的LinkedIn API MCP(模型上下文协议)服务器,与Claude Desktop/Code无缝集成。该软件包提供完整的LinkedIn功能,包括帖子创建、个人资料优化、内容生成和分析,所有这些都可以通过Claude的自然语言界面访问。
🚀 快速开始
使用单个命令安装和配置:
npx @maheidem/linkedin-mcp install就是这样!安装程序将:
- ✅ 安装MCP服务器
- ✅ 自动配置克劳德桌面/代码
- ✅ 设置令牌存储
- ✅ 提供设置说明
📋 特性
✨ 核心功能
- 🚀 LinkedIn发布:创建和发布具有完整格式的帖子
- 🔍 个人资料分析:获取详细的见解和优化建议
- 📊 内容分析:跟踪岗位绩效和参与度指标
- 🎯 内容生成:人工智能驱动的岗位创建,采用行业最佳实践
- 👤 配置文件管理:更新和优化LinkedIn个人资料
- 🔐 安全OAuth:具有自动刷新功能的强大令牌管理
🛠 开发人员功能
- 📱 交叉平台的:适用于Windows、macOS和Linux
- 🔧 CLI管理:易于安装、配置和维护
- 📖 综合API:所有LinkedIn REST API端点可用
- 🔒 安全第一:安全的令牌存储和处理
- 📚 全部文件:完整的API参考和示例
📦 安装方法
方法1:NPX安装(推荐)
npx @maheidem/linkedin-mcp install方法2:全局安装+设置
npm install -g @maheidem/linkedin-mcp
linkedin-mcp install方法3:本地安装
npm install @maheidem/linkedin-mcp
npx linkedin-mcp install🔧 CLI命令
安装和设置
# Install and configure for Claude
linkedin-mcp install
# Check installation status
linkedin-mcp status
# Set up LinkedIn OAuth credentials
linkedin-mcp auth
# Remove configuration
linkedin-mcp uninstall使用示例
# Check if everything is working
linkedin-mcp status
# Set up authentication
linkedin-mcp auth🔐 身份验证设置
安装后,您需要设置LinkedIn OAuth:
- 创建LinkedIn应用程序:
- 首选 LinkedIn开发者 - 创建新应用程序 - 记下您的客户端ID和客户端密码
- 配置重定向URI:
- 添加 http://localhost:3000/callback 到应用程序的重定向URI
- 设置凭据:
linkedin-mcp auth- 完整的OAuth流程:
- 使用LinkedIn OAuth流获取访问令牌 - 令牌将由MCP服务器自动管理
🎯 与Claude一起使用
安装后,您可以直接在Claude中使用LinkedIn功能:
创建帖子
Create a LinkedIn post about the latest developments in AI, targeting ML engineers and including relevant hashtags.配置文件优化
Analyze my LinkedIn profile and provide optimization recommendations for better visibility in the tech industry.内容策略
Generate 5 LinkedIn post ideas about machine learning trends, each with different engagement strategies.分析与洞察
Show me the performance metrics for my last 10 LinkedIn posts and identify the most engaging content types.📊 可用工具
MCP服务器为Claude提供以下工具:
🚀 发布和内容
linkedin_create_post-创建和发布帖子linkedin_create_optimized_post-人工智能生成的优化帖子linkedin_post_profile_update-宣布个人资料更改
📊 分析和数据
linkedin_get_user_posts-使用分页检索您的帖子linkedin_get_post_details-详细的岗位分析linkedin_get_user_activity-活动时间表和参与度
👤 配置文件管理
linkedin_get_user_info-用户资料信息linkedin_analyze_profile_from_data-轮廓优化分析linkedin_generate_optimized_content-配置文件的内容生成
🔐 认证
linkedin_get_auth_url-生成OAuth URLlinkedin_exchange_code-处理OAuth令牌交换
🔧 配置
Claude配置位置
安装程序会自动检测并配置:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 视窗:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
令牌存储
代币安全地存储在:
- 所有平台:
~/.linkedin-mcp/tokens/
配置示例
{
"mcpServers": {
"linkedin-complete": {
"command": "node",
"args": ["/path/to/server/linkedin-complete-mcp.js"],
"env": {
"LINKEDIN_TOKEN_STORAGE_PATH": "/home/user/.linkedin-mcp/tokens"
}
}
}
}🐛 故障排除
安装问题
# Check status
linkedin-mcp status
# Reinstall if needed
linkedin-mcp uninstall
linkedin-mcp install身份验证问题
# Reset credentials
linkedin-mcp auth
# Check token storage
ls ~/.linkedin-mcp/tokens/Claude集成问题
- 安装后重新启动Claude Desktop/代码
- 检查配置文件位置是否与您的系统匹配
- 验证MCP服务器权限
常见解决方案
- “找不到服务器”:运行
linkedin-mcp install再次 - “令牌已过期”:服务器自动刷新令牌
- “权限被拒绝”:检查令牌目录上的文件权限
📚 api参考
核心方法
创建帖子
// Through Claude's natural language interface:
"Create a post about AI trends with these key points: [points]"
// Direct API usage:
linkedin_create_post({
text: "Your post content here",
visibility: "PUBLIC"
})配置文件分析
linkedin_analyze_profile_from_data({
name: "Your Name",
currentHeadline: "Current headline",
industry: "Technology"
})看 API_REFERENCE.md 以获取完整的文档。
🔒 安全与隐私
- 🔐 安全存储:加密并存储在本地的令牌
- 🔄 自动刷新:自动令牌续订
- 🚫 无数据收集:无分析或跟踪
- 🏠 本地优先:所有处理都在您的机器上进行
🤝 贡献
欢迎投稿!请参阅我们的投稿指南。
开发设置
git clone https://github.com/maheidem/linkedin-mcp
cd linkedin-mcp
npm install
npm run build测试与示例
# Run unit tests
npm test
# Run example scripts
npm run test:examples
npm run test:oauth
# Try the demo
npm run demo
# Development mode
npm run dev项目结构
├── src/ # TypeScript source code
├── dist/ # Compiled JavaScript
├── examples/ # Usage examples and demos
├── tests/ # Test files
├── docs/ # Documentation
├── configs/ # Configuration templates
└── .github/workflows/ # CI/CD workflows📄 许可证
MIT许可证-请参阅 许可证 文件以获取详细信息。
🙏 致谢
内置:
📞 支持
- 🐛 问题:
- 📚 文档: 完整文档
- 💬 讨论:
______________________________________________________________________
由以下材料制成❤️ 为克劳德社区
