Stores and manages LinkedIn lead data, API keys, usage tracking, and automated follow-up sequences using PostgreSQL (with Neon support)
LinkedIn Lead Automation MCP Server
Production-grade LinkedIn Lead Automation MCP (Model Context Protocol) Server with real-time search, analysis, scoring, messaging, and automated follow-up sequences.
Features
🔍 Lead Discovery: Search LinkedIn profiles by keywords, location, and filters
📊 Profile Analysis: Extract and analyze complete LinkedIn profile data
🎯 AI-Powered Scoring: Intelligent lead scoring (0-100) based on profile data
💬 Message Generation: Hyper-personalized message generation using AI
📨 Automated Messaging: Send connection requests and direct messages
🔄 Follow-up Sequences: Automated multi-stage follow-up campaigns
🔐 API Key Management: Secure tier-based access control
📈 Usage Tracking: Monitor API usage and enforce tier limits
🗄️ PostgreSQL Support: Built with Neon PostgreSQL for production use
Architecture
MCP Server (
src/index.js): Stdio-based MCP protocol serverHTTP API (
src/http-server.js): RESTful HTTP API wrapperBackground Worker (
src/worker.js): Automated follow-up sequence processorDatabase (
src/database-pg.js): PostgreSQL database layerLinkedIn Automation (
src/linkedin.js): Chrome DevTools Protocol integrationAI Service (
src/ai.js): Anthropic Claude integration for scoring and messaging
Prerequisites
Node.js 18+
PostgreSQL (Neon or any PostgreSQL 14+)
Chrome/Chromium browser with remote debugging enabled
Anthropic API Key (for AI features)
Installation
Configuration
Create a .env file with the following variables:
Database Setup
Create a Neon PostgreSQL database (or use any PostgreSQL 14+)
Run the schema in Neon SQL Editor:
Copy and paste the SQL from database/schema-neon.sql into Neon SQL Editor and execute it.
Usage
Start MCP Server (Stdio)
This starts the MCP server using stdio transport. Connect via MCP clients like Claude Desktop.
Start HTTP API Server
This starts the HTTP API server on port 3001 (or PORT from .env).
Start Background Worker
This starts the automated follow-up sequence processor.
API Endpoints
Health Check
Generate API Key
Connect Browser
Setup LinkedIn Session
Search Leads
Analyze Profile
Score Lead
Generate Message
Send Message
Create Follow-up Sequence
Get Leads
Get Usage Stats
MCP Tools
When using as an MCP server, the following tools are available:
connect_browser: Connect to Chrome via CDPsetup_session: Authenticate LinkedIn sessionsearch_leads: Search for LinkedIn leadsanalyze_profile: Extract profile datascore_lead: AI-powered lead scoringgenerate_message: Generate personalized messagessend_message: Send messages to profilescreate_followup_sequence: Create automated sequencesgenerate_api_key: Generate API keys
Tier Limits
Tier | Profiles | Messages | Sequences |
Starter | 500/month | 200/month | 2 active |
Professional | 2,000/month | 1,000/month | 10 active |
Agency | 10,000/month | 5,000/month | Unlimited |
Enterprise | Unlimited | Unlimited | Unlimited |
Development
Production Deployment
Set up PostgreSQL database (recommended: Neon)
Configure environment variables
Run database schema
Deploy using PM2 or similar:
Security Notes
⚠️ Never commit - they contain sensitive credentials
🔐 API keys are hashed using bcrypt
🔒 All database queries use parameterized statements
🛡️ CORS is configured for production use
License
MIT License - see LICENSE file for details
Author
Agentic AI AMRO Ltd
Support
For issues and feature requests, please open an issue on GitHub.