LinkedIn Custom MCP Server

LinkedIn Custom MCP Server

Enables AI agents to manage professional networking on LinkedIn by providing tools for posting updates, searching for jobs, and analyzing profiles. It facilitates secure interaction with the LinkedIn platform through OAuth 2.0 authentication and the Model Context Protocol.

Category
Visit Server

README

LinkedIn Custom MCP Server

Empower your AI agents with professional networking capabilities.

This project implements a Model Context Protocol (MCP) server that acts as a bridge between Large Language Models (LLMs) like Claude or Gemini and the LinkedIn platform. It allows your AI assistants to autonomously manage your professional presence, interact with your feed, search for opportunities, and analyze profilesβ€”all through a secure and authenticated interface.

Built with performance and modularity in mind using FastMCP and Python.


🌟 Key Features

  • πŸ“ˆ Feed Management: Create text posts, upload images, and manage comments seamlessly.
  • πŸ‘€ Profile Intelligence: Retrieve and analyze your own profile or public member profiles.
  • 🀝 Network Interaction: Engage with content by commenting on posts and shares.
  • 🏒 Company Insights: Search for companies and retrieve detailed organizational data.
  • πŸ’Ό Job Search: Find relevant job postings based on keywords and location.
  • πŸ” Secure Auth: Robust OAuth 2.0 implementation with token persistence.

πŸ“‚ Project Structure

LinkedIn_mcp_custom_server/
β”œβ”€β”€ main.py              # Server entry point & tool registration
β”œβ”€β”€ config.py            # Environment & settings management
β”œβ”€β”€ utils.py             # Shared API & error handling helpers
β”œβ”€β”€ requirements.txt     # Python dependencies
β”œβ”€β”€ .env                 # Local secrets (not committed)
β”œβ”€β”€ .gitignore           # Git exclusion rules
β”œβ”€β”€ LICENSE              # MIT License details
└── tools/               # Modular tool implementations
    β”œβ”€β”€ auth.py          # OAuth 2.0 flow logic
    β”œβ”€β”€ profile.py       # Profile data extraction
    β”œβ”€β”€ post.py          # Posts, Comments, and Image uploads
    β”œβ”€β”€ company.py       # Company search and profiles
    β”œβ”€β”€ job.py           # Job search and details
    └── search.py        # People search and member profiles

πŸš€ Installation & Setup

Prerequisites

  • Python 3.12+ installed on your system.
  • A LinkedIn Developer App (See configuration below).

Step 1: Clone the Repository

git clone https://github.com/SARAMALI15792/LinkedIn_mcp_custom_server.git
cd LinkedIn_mcp_custom_server

Step 2: Install Dependencies

We recommend using a virtual environment.

# Create and activate virtual environment (Windows)
python -m venv .venv
.venv\Scripts\activate

# Install requirements
pip install -r requirements.txt

Step 3: Configure Environment

  1. Go to the LinkedIn Developer Portal.
  2. Create a new app and request access to the "Sign In with LinkedIn using OpenID Connect" and "Share on LinkedIn" products.
  3. In the Auth tab, add http://localhost:8000 to the Authorized redirect URLs.
  4. Create a .env file in the project root:
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
LINKEDIN_REDIRECT_URI=http://localhost:8000
# Access token will be added automatically after login

πŸƒβ€β™‚οΈ Usage

Starting the Server

Run the server locally using Python:

python main.py

The server will start listening on http://127.0.0.1:8000 using the SSE (Server-Sent Events) transport.

Connecting to an MCP Client

To use this with Claude Desktop, add the following to your config file (%APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "linkedin": {
      "command": "C:/path/to/project/.venv/Scripts/python.exe",
      "args": ["C:/path/to/project/main.py"]
    }
  }
}

First-Time Authentication

  1. Ask your Agent: "Generate a LinkedIn login URL."
  2. Open the provided link and authorize the app.
  3. You will be redirected to a page. Copy the code parameter from the URL bar.
  4. Ask your Agent: "Exchange this code for a token: [PASTE_CODE]"
  5. You are now connected!

πŸ’‘ Usage Examples

Once connected, you can ask your AI agent to perform various tasks:

πŸ“ Posting Content

"Create a LinkedIn post with the text 'Excited to launch my new MCP server!' and set visibility to CONNECTIONS." "Post this image 'C:/photos/launch.jpg' with the caption 'Project Launch Day!'"

πŸ”Ž Job Hunting

"Search for 'Senior Python Developer' jobs in 'San Francisco' and show me the top 3 details."

πŸ“Š Profile & Network

"Get my profile summary." "Who is the user with the username 'stickerdaniel'?"

πŸ’¬ Engagement

"Show me the comments on my latest post." "Reply to the first comment saying 'Thanks for the support!'"


πŸ› οΈ Available Tools

Category Tool Name Description
Auth linkedin_get_oauth_url Generate the OAuth 2.0 authorization URL for LinkedIn login.
linkedin_exchange_code Exchange an authorization code for a persistent access token.
Profile linkedin_get_my_profile Retrieve your own profile information (Name, Email, Picture).
linkedin_get_member_profile Fetch public profile details for a specific member using their URN.
Search linkedin_search_people Search for LinkedIn members based on keywords and filters.
Post linkedin_create_post Publish a text-only update to your professional LinkedIn feed.
linkedin_create_image_post Upload an image and publish a media post to your feed.
linkedin_update_post Update a post's content (via the Delete & Re-create method).
linkedin_delete_post Permanently remove a post from your feed using its URN.
linkedin_get_recent_posts Retrieve a list of your most recent activity and publications.
Comment linkedin_create_comment Post a new comment on a share, article, or video.
linkedin_get_post_comments List all comments and reactions for a specific post.
linkedin_delete_comment Remove a comment you previously published.
Company linkedin_search_companies Find organizational profiles using keywords or industries.
linkedin_get_company_profile Retrieve detailed information about a specific company.
Job linkedin_search_jobs Find open career opportunities by keywords and location.
linkedin_get_job_details Get the full description and application details for a job.

🀝 Contribution Guidelines

We welcome contributions to make this server even better!

  1. Fork the Repository: Click the "Fork" button on GitHub.
  2. Create a Branch: git checkout -b feature/amazing-feature.
  3. Commit Changes: git commit -m 'Add amazing feature'.
  4. Push to Branch: git push origin feature/amazing-feature.
  5. Open a Pull Request: Submit your changes for review.

Please ensure your code follows the existing modular structure in the tools/ directory.


πŸ“„ License

This project is open-source and available under the MIT License. See the LICENSE file for full details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured