LinkedIn Model Context Protocol (MCP) Server
A powerful Model Context Protocol server for LinkedIn interactions that enables AI assistants to search for jobs, generate resumes and cover letters, and manage job applications programmatically.
Features
- Authentication: Secure OAuth 2.0 authentication with token refresh
- Profile Management: Access and update LinkedIn profile information
- Job Search: Advanced job search with filtering and pagination
- Resume & Cover Letters: Generate tailored resumes and cover letters
- Messaging: Send messages and connection requests
- Analytics: Track job applications and engagement metrics
- Async API: Built with asyncio for high performance
- Modular Design: Clean, maintainable code with separation of concerns
Architecture
This project implements the Model Context Protocol (MCP) specification, allowing AI assistants to interact with LinkedIn through standardized JSON-RPC style requests and responses.
Project Structure
linkedin_mcp/
├── api/
│ ├── clients/ # API client implementations
│ │ ├── __init__.py # Client factory functions
│ │ ├── linkedin.py # LinkedIn API client
│ │ └── openai.py # OpenAI integration
│ │
│ ├── models/ # Data models and schemas
│ │ ├── __init__.py # Model exports
│ │ ├── common.py # Common data models
│ │ ├── enums.py # Enumerations
│ │ ├── requests.py # Request models
│ │ └── responses.py # Response models
│ │
│ └── services/ # Business logic
│ └── ...
│
├── core/ # Core application logic
│ ├── __init__.py
│ ├── exceptions.py # Custom exceptions
│ ├── mcp_handler.py # MCP protocol handler
│ └── protocol.py # Protocol definitions
│
├── utils/ # Utility functions
│ ├── __init__.py
│ ├── auth.py # Authentication helpers
│ ├── rate_limiter.py # Rate limiting
│ └── retry.py # Retry mechanisms
│
├── examples/ # Example scripts
│ └── basic_usage.py # Basic client usage example
│
├── .env.example # Example environment variables
├── README.md # This file
└── requirements.txt # Project dependencies
Getting Started
Prerequisites
- Python 3.8+
- LinkedIn Developer Account
- OAuth 2.0 credentials from LinkedIn Developers
Installation
-
Clone the repository
git clone https://github.com/yourusername/linkedin-mcp.git cd linkedin-mcp
-
Create and activate a virtual environment
# Linux/macOS python -m venv venv source venv/bin/activate # Windows python -m venv venv .\venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env
Edit the
.envfile with your LinkedIn API credentials and other settings.
Configuration
Create a .env file in the project root with the following variables (see .env.example for details):
# LinkedIn API Credentials (required)
LINKEDIN_CLIENT_ID=your_client_id_here
LINKEDIN_CLIENT_SECRET=your_client_secret_here
LINKEDIN_REDIRECT_URI=http://localhost:8080/callback
# Optional: OpenAI API Key (for resume/cover letter generation)
# OPENAI_API_KEY=your_openai_api_key_here
# Optional: Logging
LOG_LEVEL=INFO
# API Settings
OPENAI_API_KEY=your_openai_api_key
SESSION_DIR=sessions
DATA_DIR=data
Usage
Starting the Server
python server.py
Example MCP Requests
Authentication
{
"jsonrpc": "2.0",
"id": 1,
"method": "linkedin.login",
"params": {
"username": "user@example.com",
"password": "password123"
}
}
Searching for Jobs
{
"jsonrpc": "2.0",
"id": 2,
"method": "linkedin.searchJobs",
"params": {
"filter": {
"keywords": "software engineer",
"location": "New York, NY",
"distance": 25
},
"page": 1,
"count": 20
}
}
Generating a Resume
{
"jsonrpc": "2.0",
"id": 3,
"method": "linkedin.generateResume",
"params": {
"profileId": "user123",
"template": "standard",
"format": "pdf"
}
}
Available Methods
| Method | Description |
|---|---|
linkedin.login |
Authenticate with LinkedIn |
linkedin.logout |
End the current session |
linkedin.checkSession |
Check if the current session is valid |
linkedin.getFeed |
Get LinkedIn feed posts |
linkedin.getProfile |
Get LinkedIn profile information |
linkedin.getCompany |
Get company profile information |
linkedin.searchJobs |
Search for jobs with filters |
linkedin.getJobDetails |
Get detailed information about a job |
linkedin.getRecommendedJobs |
Get job recommendations |
linkedin.generateResume |
Generate a resume from a LinkedIn profile |
linkedin.generateCoverLetter |
Generate a cover letter for a job application |
linkedin.tailorResume |
Customize a resume for a specific job |
linkedin.applyToJob |
Apply to a job |
linkedin.getApplicationStatus |
Check application status |
linkedin.getSavedJobs |
Get saved jobs |
linkedin.saveJob |
Save a job for later |
Development
Project Structure
linkedin-mcp/
├── README.md
├── requirements.txt
├── server.py
├── data/
│ ├── applications/
│ ├── companies/
│ ├── cover_letters/
│ ├── jobs/
│ ├── profiles/
│ └── resumes/
├── linkedin_mcp/
│ ├── api/
│ │ ├── auth.py
│ │ ├── cover_letter_generator.py
│ │ ├── job_application.py
│ │ ├── job_search.py
│ │ ├── profile.py
│ │ └── resume_generator.py
│ ├── core/
│ │ ├── mcp_handler.py
│ │ └── protocol.py
│ └── utils/
│ └── config.py
├── sessions/
└── templates/
├── cover_letter/
│ └── standard.html
└── resume/
└── standard.html
Running Tests
pytest
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- LinkedIn API documentation
- Model Context Protocol specification
Metadata
Release files for iflow-mcp_rayyan9477-linkedin_mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iflow_mcp_rayyan9477_linkedin_mcp-0.1.0.tar.gz | 62.3 kB | Without provenance | Details for iflow_mcp_rayyan9477_linkedin_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iflow_mcp_rayyan9477_linkedin_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for iflow_mcp_rayyan9477_linkedin_mcp-0.1.0-py3-none-any.whl |
Total release size: 137.3 kB
Release files / iflow_mcp_rayyan9477_linkedin_mcp-0.1.0.tar.gz
| Download URL | iflow_mcp_rayyan9477_linkedin_mcp-0.1.0.tar.gz |
|---|---|
| Size | 62.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e374c0a77a25bcd99a98b20c0a4fab8d5eb2028d155f7895eeb7a5226c0ddaa
|
|
BLAKE2b-256 checksum How to use checksums |
ceb6aae725d489d91bd13ade6d35805a9baac2a3cfcbec1ffd67559a6bec0248
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / iflow_mcp_rayyan9477_linkedin_mcp-0.1.0-py3-none-any.whl
| Download URL | iflow_mcp_rayyan9477_linkedin_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 75.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a016ad12925199915b732e286ee58af4c808fc0bdda43cc2125570b994b6cda3
|
|
BLAKE2b-256 checksum How to use checksums |
14a9083cf7609c6f27715bf9b5db197019e0335cd9177a9074f2c77b36dfb691
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for iflow-mcp_rayyan9477-linkedin_mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.