A comprehensive LinkedIn API MCP (Model Context Protocol) server that integrates seamlessly with Claude Desktop/Code. This package provides full LinkedIn functionality including post creation, profile optimization, content generation, and analytics - all accessible through Claude's natural language interface.
Install and configure with a single command:
npx @maheidem/linkedin-mcp installThat's it! The installer will:
- β Install the MCP server
- β Automatically configure Claude Desktop/Code
- β Set up token storage
- β Provide setup instructions
- π LinkedIn Posting: Create and publish posts with full formatting
- π Profile Analytics: Get detailed insights and optimization recommendations
- π Content Analytics: Track post performance and engagement metrics
- π― Content Generation: AI-powered post creation with industry best practices
- π€ Profile Management: Update and optimize LinkedIn profiles
- π Secure OAuth: Robust token management with automatic refresh
- π± Cross-Platform: Works on Windows, macOS, and Linux
- π§ CLI Management: Easy installation, configuration, and maintenance
- π Comprehensive API: All LinkedIn REST API endpoints available
- π Security First: Secure token storage and handling
- π Full Documentation: Complete API reference and examples
npx @maheidem/linkedin-mcp installnpm install -g @maheidem/linkedin-mcp
linkedin-mcp installnpm install @maheidem/linkedin-mcp
npx linkedin-mcp install# 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 authAfter installation, you need to set up LinkedIn OAuth:
-
Create LinkedIn App:
- Go to LinkedIn Developers
- Create a new app
- Note your Client ID and Client Secret
-
Configure Redirect URI:
- Add
http://localhost:3000/callbackto your app's redirect URIs
- Add
-
Set Up Credentials:
linkedin-mcp auth
-
Complete OAuth Flow:
- Use the LinkedIn OAuth flow to get an access token
- The token will be automatically managed by the MCP server
Once installed, you can use LinkedIn functionality directly in Claude:
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.
The MCP server provides these tools to Claude:
linkedin_create_post- Create and publish postslinkedin_create_optimized_post- AI-generated optimized postslinkedin_post_profile_update- Announce profile changes
linkedin_get_user_posts- Retrieve your posts with paginationlinkedin_get_post_details- Detailed post analyticslinkedin_get_user_activity- Activity timeline and engagement
linkedin_get_user_info- User profile informationlinkedin_analyze_profile_from_data- Profile optimization analysislinkedin_generate_optimized_content- Content generation for profiles
linkedin_get_auth_url- Generate OAuth URLslinkedin_exchange_code- Handle OAuth token exchange
The installer automatically detects and configures:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
Tokens are securely stored at:
- All Platforms:
~/.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/- Restart Claude Desktop/Code after installation
- Check configuration file location matches your system
- Verify MCP server permissions
- "Server not found": Run
linkedin-mcp installagain - "Token expired": The server automatically refreshes tokens
- "Permission denied": Check file permissions on token directory
// 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"
})See API_REFERENCE.md for complete documentation.
- π Secure Storage: Tokens encrypted and stored locally
- π Auto-Refresh: Automatic token renewal
- π« No Data Collection: No analytics or tracking
- π Local First: All processing happens on your machine
Contributions welcome! Please see our contributing guidelines.
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 License - see LICENSE file for details.
Built with:
- π Issues: GitHub Issues
- π Documentation: Full Docs
- π¬ Discussions: GitHub Discussions
Made with β€οΈ for the Claude community