linkedin-mcp-server
by: Dishant27
Model Context Protocol (MCP) server for LinkedIn API integration
πOverview
Purpose: To provide a flexible and powerful framework for advanced interactions with LinkedIn's API, enhancing data integration for developers.
Overview: LinkedInMCP is a Model Context Protocol server that revolutionizes how developers retrieve and interact with LinkedIn data. It overcomes the limitations of traditional API methods by implementing an intelligent, context-aware system for managing professional network data.
Key Features:
-
Intelligent Context Management: Utilizes advanced context handling for more effective data interactions.
-
Secure, Typed Interactions: Ensures type safety in API calls to enhance reliability and security.
-
Extensible Architecture: Offers the ability to easily expand and customize functionalities based on specific user needs.
-
Standardized Protocol: Adheres to Model Context Protocol specifications, guaranteeing compatibility and interoperability.
LinkedInMCP: Revolutionizing LinkedIn API Interactions
π Comprehensive Setup Guide
Prerequisites
- Node.js 16+
- LinkedIn Developer Account
- MCP-Compatible LLM (Claude, OpenAI, etc.)
1. LinkedIn Developer Setup
- Go to LinkedIn Developer Portal: https://www.linkedin.com/developers/
- Create a new application
- Obtain Client ID and Client Secret
Important: For detailed instructions on obtaining access tokens and authentication for LinkedIn API, refer to the official documentation: Getting Access to LinkedIn API
2. Project Installation
git clone https://github.com/Dishant27/linkedin-mcp-server.git
cd linkedin-mcp-server
npm install
3. Configuration Files
.env
File
Create a .env
file in the project root:
LINKEDIN_CLIENT_ID=your_client_id_here
LINKEDIN_CLIENT_SECRET=your_client_secret_here
claude_desktop_config.json
(for Claude Desktop)
{
"mcpServers": {
"linkedin": {
"command": "node",
"args": ["/absolute/path/to/linkedin-mcp-server/dist/index.js"],
"env": {
"LINKEDIN_CLIENT_ID": "your_client_id",
"LINKEDIN_CLIENT_SECRET": "your_client_secret"
}
}
}
}
4. LLM Configuration Example
Claude.ai / Claude Desktop MCP Integration
{
"tools": [
{
"name": "search-people",
"description": "Search for LinkedIn profiles",
"parameters": {
"type": "object",
"properties": {
"keywords": {
"type": "string",
"description": "Keywords to search for in profiles"
},
"currentCompany": {
"type": "array",
"items": {"type": "string"},
"description": "Filter by current company"
},
"industries": {
"type": "array",
"items": {"type": "string"},
"description": "Filter by industries"
},
"location": {
"type": "string",
"description": "Filter by location"
}
}
}
},
{
"name": "get-profile",
"description": "Retrieve detailed LinkedIn profile information",
"parameters": {
"type": "object",
"properties": {
"publicId": {
"type": "string",
"description": "Public ID of the LinkedIn profile"
},
"urnId": {
"type": "string",
"description": "URN ID of the LinkedIn profile"
}
}
}
}
]
}
5. Typical Workflow
- Start the MCP Server:
npm run build
npm start
- Example LLM Interactions:
> Find software engineers in San Francisco working at tech companies
# The LLM will use the search-people tool to:
# 1. Search LinkedIn profiles
# 2. Filter by location (San Francisco)
# 3. Filter by industry (Technology)
# 4. Return relevant profile details
π Learn More
Check out the detailed article explaining the concept and implementation:
π Project Background
LinkedInMCP is an innovative Model Context Protocol (MCP) server designed to transform how developers interact with LinkedIn's API. Born from the need for more flexible and powerful LinkedIn data integration, this project provides a robust, extensible framework for advanced LinkedIn data retrieval and interaction.
π Project Vision
This solution creates a more intelligent, context-aware method of working with professional network data, overcoming limitations of traditional LinkedIn API approaches.
β¨ Key Innovations
- Intelligent Context Management using MCP
- Secure, Typed LinkedIn API Interactions
- Extensible Architecture for easy customization
- Standardized Model Context Protocol compliance
π οΈ Technologies
- TypeScript
- Model Context Protocol
- LinkedIn API
- OAuth 2.0
- Zod for Type Validation
- Axios for HTTP Requests
π Core Capabilities
- Advanced People Search
- Detailed Profile Retrieval
- Job Market Intelligence
- Messaging Capabilities
- Secure Authentication Workflow
πΌ Enterprise Use Cases
Talent Acquisition
- Candidate Sourcing: Find qualified candidates based on skills and experience
- Talent Pool Analysis: Map talent distribution across industries and regions
- Outreach Automation: Streamline candidate contact
- Competitive Intelligence: Analyze competitor recruitment patterns
Sales & Business Development
- Lead Generation: Identify decision-makers at target companies
- Account-Based Marketing: Build comprehensive profiles of key accounts
- Relationship Mapping: Visualize organizational connection networks
- Market Penetration Analysis: Track product/service adoption trends
Market Research
- Industry Trends: Monitor employment shifts
- Skill Demand Analysis: Track emerging technologies and skills
- Organizational Insights: Map reporting structures and teams
- Geographic Movement: Analyze talent migration between regions
Integration Capabilities
- CRM Synchronization: Update LinkedIn data in CRM systems
- ATS Enhancement: Enrich applicant tracking systems
- Business Intelligence Integration: Feed LinkedIn data to analytics platforms
- Custom Workflow Integration: Add LinkedIn features to internal tools via API
π Security Framework
Authentication Security
- OAuth 2.0 Token-Based Authentication
- Automated Token Refresh Handling
- Environment-Based Credential Isolation
- Rate Limiting to Protect API Usage
Data Security
- End-to-End Encryption of Data
- Minimal Data Storage with On-the-Fly Processing
- Selective Data Return to Limit Exposure
- Automatic Data Sanitization to Prevent Injection Attacks
Compliance Features
- GDPR Compliance Configurations
- Enforced LinkedIn API Usage Policies
- Audit Logging for Compliance Reporting
- Data Governance Tools for Regulatory Management
π¦ Generated Project Structure
linkedin-mcp-server/
β
βββ src/
β βββ index.ts # Main server entry point
β βββ auth.ts # LinkedIn authentication handler
β βββ client.ts # LinkedIn API interaction client
β
βββ dist/ # Compiled JavaScript files
β βββ index.js
β βββ auth.js
β βββ client.js
β
βββ .env # Secret environment variables
βββ .env.example # Template for environment variables
βββ package.json # Project dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ README.md # Project documentation
π€ Contributing
Contributions are welcome!
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
π License
Distributed under the MIT License.
Disclaimer: This project is an independent innovation and is not officially affiliated with LinkedIn or Microsoft.