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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。