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.
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
- Go to the LinkedIn Developer Portal.
- Create a new app and request access to the "Sign In with LinkedIn using OpenID Connect" and "Share on LinkedIn" products.
- In the Auth tab, add
http://localhost:8000to the Authorized redirect URLs. - Create a
.envfile 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
- Ask your Agent: "Generate a LinkedIn login URL."
- Open the provided link and authorize the app.
- You will be redirected to a page. Copy the
codeparameter from the URL bar. - Ask your Agent: "Exchange this code for a token: [PASTE_CODE]"
- 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!
- Fork the Repository: Click the "Fork" button on GitHub.
- Create a Branch:
git checkout -b feature/amazing-feature. - Commit Changes:
git commit -m 'Add amazing feature'. - Push to Branch:
git push origin feature/amazing-feature. - 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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.