Skip to main content
Glama
@maheidem/linkedin-mcp

@maheidem/linkedin-mcp

by Maheidem

@maheidem/linkedin-mcp

npm version License: 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:

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

Related MCP server: LinkedIn Intelligence MCP Server

πŸ“‹ 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

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:

  1. Create LinkedIn App:

  2. Configure Redirect URI:

    • Add http://localhost:3000/callback to your app's redirect URIs

  3. Set Up Credentials:

    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

{
  "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

  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

// 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 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

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 LICENSE file for details.

πŸ™ Acknowledgments

Built with:

πŸ“ž Support


Made with ❀️ for the Claude community

Available Tools

13 tools
linkedin_analyze_profile_from_dataC

Analyze LinkedIn profile data and provide optimization recommendations

Inputs: name (required), currentHeadline, currentSummary, skills, +2 more.

linkedin_create_optimized_postC

✨ Generate and create an optimized LinkedIn post

Inputs: accessToken (required), topic (required), role (required), industry, +3 more.

linkedin_create_postC

πŸš€ Create a LinkedIn post (WORKING!)

Inputs: accessToken (required), text (required), visibility.

linkedin_exchange_codeB

Exchange authorization code for access token

Inputs: code (required).

linkedin_generate_optimized_contentC

Generate optimized LinkedIn content (headlines, summaries, posts)

Inputs: contentType (required), currentRole (required), skills, achievements, +2 more.

linkedin_get_auth_urlA

Generate LinkedIn OAuth authorization URL

Inputs: state.

linkedin_get_feedC

πŸ“° Get LinkedIn feed/timeline posts

Inputs: accessToken (required), count, start.

linkedin_get_post_commentsC

πŸ’¬ Get comments on a specific post

Inputs: accessToken (required), postId (required), count, start.

linkedin_get_post_detailsC

πŸ” Get detailed information about a specific post

Inputs: accessToken (required), postId (required), includeStats.

linkedin_get_user_activityB

πŸ“Š Get user's recent activity (likes, comments, shares)

Inputs: accessToken (required), activityTypes, count, start.

linkedin_get_user_infoC

Get user information via OpenID Connect

Inputs: accessToken (required).

linkedin_get_user_postsA

πŸ“– Get user's own posts with pagination

Inputs: accessToken (required), count, start.

linkedin_post_profile_updateC

πŸ“’ Create a post announcing your profile updates

Inputs: accessToken (required), updateType (required), details (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 13 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A powerful LinkedIn Profile Analyzer that seamlessly integrates with Claude AI to fetch and analyze public LinkedIn profiles, enabling users to extract, search, and analyze posts data through RapidAPI's LinkedIn Data API.
      35
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Connects Claude Desktop to LinkedIn's data layer for AI-powered networking, enabling profile research, content creation and scheduling, engagement automation, analytics tracking, and messaging through natural language.
      85
      46
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables Claude Desktop to manage your LinkedIn profile and company pages, including posting, reading posts, and fetching profile information.
      7
      156 npm
      4
      MIT