Maheidem/linkedin-optimizer-mcp
If you are the rightful owner of linkedin-optimizer-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The LinkedIn MCP server is a comprehensive tool that integrates LinkedIn functionality with Claude Desktop/Code, providing seamless access to LinkedIn's features through a natural language interface.
@maheidem/linkedin-mcp
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.
š Quick Start
Install and configure with a single command:
npx @maheidem/linkedin-mcp install
That's it! The installer will:
- ā Install the MCP server
- ā Automatically configure Claude Desktop/Code
- ā Set up token storage
- ā Provide setup instructions
š Features
⨠Core Functionality
- š 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
š Developer Features
- š± 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
š¦ Installation Methods
Method 1: NPX Install (Recommended)
npx @maheidem/linkedin-mcp install
Method 2: Global Install + Setup
npm install -g @maheidem/linkedin-mcp
linkedin-mcp install
Method 3: Local Install
npm install @maheidem/linkedin-mcp
npx linkedin-mcp install
š§ CLI Commands
Installation & Setup
# 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
Usage Examples
# Check if everything is working
linkedin-mcp status
# Set up authentication
linkedin-mcp auth
š Authentication Setup
After 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/callback
to 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
šÆ Usage with Claude
Once installed, you can use LinkedIn functionality directly in Claude:
Creating Posts
Create a LinkedIn post about the latest developments in AI, targeting ML engineers and including relevant hashtags.
Profile Optimization
Analyze my LinkedIn profile and provide optimization recommendations for better visibility in the tech industry.
Content Strategy
Generate 5 LinkedIn post ideas about machine learning trends, each with different engagement strategies.
Analytics & Insights
Show me the performance metrics for my last 10 LinkedIn posts and identify the most engaging content types.
š Available Tools
The MCP server provides these tools to Claude:
š Posting & Content
linkedin_create_post
- Create and publish postslinkedin_create_optimized_post
- AI-generated optimized postslinkedin_post_profile_update
- Announce profile changes
š Analytics & Data
linkedin_get_user_posts
- Retrieve your posts with paginationlinkedin_get_post_details
- Detailed post analyticslinkedin_get_user_activity
- Activity timeline and engagement
š¤ Profile Management
linkedin_get_user_info
- User profile informationlinkedin_analyze_profile_from_data
- Profile optimization analysislinkedin_generate_optimized_content
- Content generation for profiles
š Authentication
linkedin_get_auth_url
- Generate OAuth URLslinkedin_exchange_code
- Handle OAuth token exchange
š§ Configuration
Claude Configuration Location
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
Token Storage
Tokens are securely stored at:
- All Platforms:
~/.linkedin-mcp/tokens/
Example Configuration
{
"mcpServers": {
"linkedin-complete": {
"command": "node",
"args": ["/path/to/server/linkedin-complete-mcp.js"],
"env": {
"LINKEDIN_TOKEN_STORAGE_PATH": "/home/user/.linkedin-mcp/tokens"
}
}
}
}
š Troubleshooting
Installation Issues
# Check status
linkedin-mcp status
# Reinstall if needed
linkedin-mcp uninstall
linkedin-mcp install
Authentication Problems
# Reset credentials
linkedin-mcp auth
# Check token storage
ls ~/.linkedin-mcp/tokens/
Claude Integration Issues
- Restart Claude Desktop/Code after installation
- Check configuration file location matches your system
- Verify MCP server permissions
Common Solutions
- "Server not found": Run
linkedin-mcp install
again - "Token expired": The server automatically refreshes tokens
- "Permission denied": Check file permissions on token directory
š API Reference
Core Methods
Creating Posts
// 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"
})
Profile Analysis
linkedin_analyze_profile_from_data({
name: "Your Name",
currentHeadline: "Current headline",
industry: "Technology"
})
See for complete documentation.
š Security & Privacy
- š 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
š¤ Contributing
Contributions welcome! Please see our contributing guidelines.
Development Setup
git clone https://github.com/maheidem/linkedin-mcp
cd linkedin-mcp
npm install
npm run build
Testing & Examples
# 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
Project Structure
āāā 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
š License
MIT License - see file for details.
š Acknowledgments
Built with:
š Support
- š Issues: GitHub Issues
- š Documentation:
- š¬ Discussions: GitHub Discussions
Made with ā¤ļø for the Claude community