@maheidem/linkedin-mcp

@maheidem/linkedin-mcp

Integrates with Claude to enable LinkedIn post creation, profile optimization, content generation, and analytics through natural language.

Category
访问服务器

README

@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

📋 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:

  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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选