MCP server for reading information from LinkedIn page as admin or LinkedIn profile as user
linkedin-mcp
MCP server for LinkedIn Pages Data Portability API. This server provides tools to interact with LinkedIn organizational pages, including profiles, feed content, follows, notifications, and analytics.
Overview
This MCP (Model Context Protocol) server implements the LinkedIn Pages Data Portability API, which requires admin-level access for a LinkedIn page. It provides comprehensive tools for managing and analyzing organizational page content.
For detailed project specifications and implementation details, see PROJECT.md.
Important: LinkedIn API Access Requirements
LinkedIn has strict policies regarding automated access to their platform. You must create an official LinkedIn app through their developer portal and submit an application for the specific feature you need to access. The application approval process may take several days, and LinkedIn reviews each request carefully.
This server is specifically designed to work with company/organizational page accounts rather than personal profiles, as this is the least problematic use case that LinkedIn typically approves. The Pages Data Portability API requires admin-level access to a LinkedIn organizational page, making it suitable for businesses and organizations to monitor and analyze their own page content, followers, and analytics.
Features
Pages Profiles
- Organizational Page Profiles: Retrieve organizational page profile information
Feed
- Activities: Get feed activities for organizational pages
- Posts: Retrieve and manage posts
- Instant Repost: Create instant reposts of existing content
- Comments: Get comments for posts
- Reactions: Retrieve reactions on posts
- Social Metadata: Get social metadata for content
- Feed Content Finder: Search and find feed content
Pages Follows
- Organizational Page Follow: Get followers for organizational pages
Notifications
- Organizational Page Notifications: Retrieve notifications for organizational pages
Analytics
- Creator Analytics: Get creator analytics data
- Organization Search Appearance: Retrieve search appearance analytics
- Organizational Page Edge Analytics: Get edge analytics for pages
- Organizational Page Content Analytics: Retrieve content analytics
Setup
Prerequisites
- Python 3.11 or higher
- A LinkedIn Developer account
- An approved LinkedIn application with access to Pages Data Portability API
- LinkedIn API credentials (Client ID, Client Secret, and OAuth Access Token)
- Admin access to a LinkedIn organizational page
Getting LinkedIn API Access
-
Create a LinkedIn Developer Account: Visit LinkedIn Developers and create an account if you don't have one.
-
Create a LinkedIn App: Create a new app in the LinkedIn Developer portal. You'll receive a Client ID and Client Secret.
-
Submit Feature Application: Submit an application for the Pages Data Portability API feature. This is required to access organizational page data. The approval process may take several days.
-
Obtain OAuth Access Token: Once your application is approved, you'll need to complete the OAuth flow to obtain an access token. Note that OAuth access tokens expire after 2 months and will need to be refreshed.
For more information, see the LinkedIn Pages Data Portability API documentation.
Installation
- Clone the repository:
git clone <repository-url>
cd linkedin-mcp
- Install dependencies using
uv:
uv sync
- Create a
.envfile in the project root with your LinkedIn API credentials:
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
LINKEDIN_ACCESS_TOKEN=your_access_token
Important Notes:
- OAuth access tokens expire after 2 months and will need to be refreshed
- The
.envfile is already in.gitignoreand will not be committed to version control - If you don't have an access token yet, leave
LINKEDIN_ACCESS_TOKENblank in the.envfile
Running the Server
Start the MCP server:
python -m src.main
The server will start on port 8080 by default.
Available Tools
This server provides 15 tools organized into the following categories:
Pages Profiles
get_organizational_page_profile- Retrieve organizational page profile information
Feed Management
get_feed_activities- Get feed activities for organizational pagesget_posts- Retrieve posts for an organizational pageget_post- Get a specific post by IDcreate_instant_repost- Create an instant repost of existing contentget_comments- Get comments for a postget_reactions- Retrieve reactions on postsget_social_metadata- Get social metadata for contentfind_feed_content- Search and find feed content using criteria
Pages Follows
get_page_followers- Get followers for an organizational page
Notifications
get_page_notifications- Retrieve notifications for an organizational page
Analytics
get_creator_analytics- Get creator analytics dataget_organization_search_appearance- Retrieve search appearance analyticsget_page_edge_analytics- Get edge analytics for pagesget_page_content_analytics- Retrieve content analytics
API Reference
This server uses the LinkedIn API Python Client library and implements the LinkedIn Pages Data Portability API.
For detailed API documentation and subpages for each feature, refer to the Microsoft Learn documentation.
Project Structure
project-root/
├── src/
│ ├── main.py # Entry point and server setup
│ └── tools.py # Tool definitions for LinkedIn API
├── .env # Environment variables (not in git)
├── .gitignore # Git ignore rules
├── pyproject.toml # Project configuration and dependencies
├── uv.lock # Dependency lock file
├── PROJECT.md # Detailed project specifications (not in git)
└── README.md # This file
Development
The tools in this server are currently scaffolded with placeholder implementations. Once you have an approved LinkedIn API access token, you'll need to implement the actual API calls in src/tools.py using the LinkedIn API client library.
Each tool function includes # TODO comments indicating where the actual API implementation should be added.
License
See LICENSE for details.