@maheidem/linkedin-mcp
# @maheidem/linkedin-mcp
[](https://badge.fury.io/js/@maheidem%2Flinkedin-mcp)
[](https://opensource.org/licenses/MIT)
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:
```bash
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)
```bash
npx @maheidem/linkedin-mcp install
```
### Method 2: Global Install + Setup
```bash
npm install -g @maheidem/linkedin-mcp
linkedin-mcp install
```
### Method 3: Local Install
```bash
npm install @maheidem/linkedin-mcp
npx linkedin-mcp install
```
## π§ CLI Commands
### Installation & Setup
```bash
# 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
```bash
# 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:
1. **Create LinkedIn App**:
- Go to [LinkedIn Developers](https://www.linkedin.com/developers/)
- Create a new app
- Note your Client ID and Client Secret
2. **Configure Redirect URI**:
- Add `http://localhost:3000/callback` to your app's redirect URIs
3. **Set Up Credentials**:
```bash
linkedin-mcp auth
```
4. **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 posts
- `linkedin_create_optimized_post` - AI-generated optimized posts
- `linkedin_post_profile_update` - Announce profile changes
### π Analytics & Data
- `linkedin_get_user_posts` - Retrieve your posts with pagination
- `linkedin_get_post_details` - Detailed post analytics
- `linkedin_get_user_activity` - Activity timeline and engagement
### π€ Profile Management
- `linkedin_get_user_info` - User profile information
- `linkedin_analyze_profile_from_data` - Profile optimization analysis
- `linkedin_generate_optimized_content` - Content generation for profiles
### π Authentication
- `linkedin_get_auth_url` - Generate OAuth URLs
- `linkedin_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
```json
{
"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
```bash
# Check status
linkedin-mcp status
# Reinstall if needed
linkedin-mcp uninstall
linkedin-mcp install
```
### Authentication Problems
```bash
# Reset credentials
linkedin-mcp auth
# Check token storage
ls ~/.linkedin-mcp/tokens/
```
### Claude Integration Issues
1. Restart Claude Desktop/Code after installation
2. Check configuration file location matches your system
3. 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
```javascript
// 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
```javascript
linkedin_analyze_profile_from_data({
name: "Your Name",
currentHeadline: "Current headline",
industry: "Technology"
})
```
See [API_REFERENCE.md](./docs/API_REFERENCE.md) 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
```bash
git clone https://github.com/maheidem/linkedin-mcp
cd linkedin-mcp
npm install
npm run build
```
### Testing & Examples
```bash
# 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 [LICENSE](./LICENSE) file for details.
## π Acknowledgments
Built with:
- [Model Context Protocol SDK](https://github.com/modelcontextprotocol/typescript-sdk)
- [LinkedIn REST API](https://docs.microsoft.com/en-us/linkedin/)
- [Commander.js](https://github.com/tj/commander.js/)
## π Support
- π **Issues**: [GitHub Issues](https://github.com/maheidem/linkedin-mcp/issues)
- π **Documentation**: [Full Docs](./docs/)
- π¬ **Discussions**: [GitHub Discussions](https://github.com/maheidem/linkedin-mcp/discussions)
---
**Made with β€οΈ for the Claude community**TDQS
Scored across 13 tools
Most tools are clearly distinct, but there is some overlap between linkedin_create_post, linkedin_create_optimized_post, and linkedin_post_profile_update, which all create posts. The first two are distinguished by optimization, but the third could be confused as a different action. Overall, boundaries are mostly clear.
All tools follow a consistent linkedin_verb_noun pattern using snake_case. Verbs like create, get, generate, and post are used predictably. The naming is uniform and easy to parse, with no mixing of conventions.
With 13 tools, the server covers a substantial but focused set of LinkedIn operationsβauth, profile, posts, feed, comments, and activity. This is well within the typical 3-15 range and feels complete without being bloated.
The tool surface covers the main LinkedIn use cases (auth, profile, posts, feed, comments, activity, optimization). Minor gaps exist, such as lacking update/delete operations for posts or comments, but the core workflows are supported and agents can operate without major dead ends.