LinkedIn Competitor Analysis MCP Server
Enables users to monitor and analyze competitor LinkedIn posts, extract insights, generate original post concepts, and create graphics-ready content with metadata.
README
LinkedIn Competitor Analysis MCP Server
Overview
A Model Context Protocol (MCP) server that helps you:
- 📊 Monitor and analyze competitor LinkedIn posts
- 💡 Extract insights and trending ideas
- ✍️ Generate original post concepts for your company
- 🎨 Create graphics-ready content with metadata
Features
- Competitor Post Tracking: Fetch and store LinkedIn posts from competitor accounts
- AI-Powered Analysis: Analyze engagement, themes, and content strategies
- Content Generation: Create original post ideas inspired by competitor insights
- Graphics Integration: Export post concepts with metadata for design tools
- Trend Detection: Identify trending topics and content patterns
Tech Stack
- Language: Python 3.10+
- Framework: FastAPI
- LLM Integration: Anthropic Claude API
- LinkedIn API: Official LinkedIn REST APIs
- Database: PostgreSQL (optional, with SQLAlchemy)
- Task Queue: Celery (for async processing)
Project Structure
linkedin-mcp-server/
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI application
│ ├── config.py # Configuration & environment
│ ├── auth/
│ │ ├── __init__.py
│ │ └── linkedin_auth.py # LinkedIn OAuth2 flow
│ ├── services/
│ │ ├── __init__.py
│ │ ├── linkedin_service.py # LinkedIn API interactions
│ │ ├── analysis_service.py # AI analysis of posts
│ │ └── content_service.py # Post generation & formatting
│ ├── models/
│ │ ├── __init__.py
│ │ └── schemas.py # Pydantic models
│ ├── routes/
│ │ ├── __init__.py
│ │ ├── competitors.py # Competitor tracking
│ │ ├── posts.py # Post analysis
│ │ └── generation.py # Content generation
│ └── utils/
│ ├── __init__.py
│ └── logger.py
├── tests/
│ ├── __init__.py
│ ├── test_linkedin.py
│ └── test_analysis.py
├── .env.example
├── requirements.txt
├── docker-compose.yml
├── Dockerfile
└── README.md
Setup Instructions
Prerequisites
- Python 3.10+
- LinkedIn Developer Account (https://www.linkedin.com/developers/)
- Anthropic API Key (https://console.anthropic.com/)
- PostgreSQL (optional)
1. Clone & Install
git clone https://github.com/satvikjain012-cmyk/linkedin-mcp-server.git
cd linkedin-mcp-server
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
2. Environment Setup
cp .env.example .env
Edit .env with your credentials:
# LinkedIn OAuth
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
LINKEDIN_REDIRECT_URI=http://localhost:8000/auth/callback
# Anthropic
ANTHROPIC_API_KEY=your_api_key
# Database (optional)
DATABASE_URL=postgresql://user:password@localhost/linkedin_mcp
# Server
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
3. Run the Server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Server will be available at http://localhost:8000
API Endpoints
Authentication
GET /auth/linkedin- Initiate LinkedIn OAuth flowGET /auth/callback- OAuth callback handlerPOST /auth/logout- Logout and revoke token
Competitors
POST /competitors- Add competitor to trackGET /competitors- List tracked competitorsDELETE /competitors/{id}- Remove competitor
Posts
GET /posts/competitor/{competitor_id}- Fetch competitor's recent postsPOST /posts/analyze- Analyze a post or set of postsGET /posts/trending- Get trending topics from competitor posts
Content Generation
POST /generate/post-idea- Generate original post based on competitorsPOST /generate/with-graphics-brief- Generate post with graphics specificationsGET /generate/history- View generation history
Usage Example
1. Add Competitors to Track
curl -X POST http://localhost:8000/competitors \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"name": "Competitor Name",
"linkedin_url": "https://www.linkedin.com/company/competitor",
"industry": "Tech"
}'
2. Fetch & Analyze Their Posts
curl -X GET http://localhost:8000/posts/competitor/1 \
-H "Authorization: Bearer {token}"
3. Generate Original Content
curl -X POST http://localhost:8000/generate/post-idea \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"competitor_ids": [1, 2, 3],
"topics": ["AI", "automation"],
"tone": "professional",
"company_context": "Our company specializes in..."
}'
4. Generate Post with Graphics Metadata
curl -X POST http://localhost:8000/generate/with-graphics-brief \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"post_idea": "generated_post_id",
"design_preferences": {
"colors": ["#FF6B6B", "#4ECDC4"],
"style": "modern",
"include_stats": true
}
}'
Workflow
1. Authenticate with LinkedIn OAuth
↓
2. Add competitors you want to track
↓
3. Fetch their recent posts (manual or auto-sync)
↓
4. AI analyzes posts for:
- Engagement patterns
- Content themes
- Trending topics
- Audience sentiment
↓
5. Generate original post ideas inspired by insights
↓
6. Export with graphics specifications (colors, layout, stats)
↓
7. Share with design team or graphics tool
Configuration
See config.py for all available settings:
- API rate limiting
- Cache expiration
- LLM model selection
- Post analysis depth
Contributing
Pull requests welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a PR with tests
License
MIT
Support
For issues or questions, open a GitHub issue or contact the maintainer.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。