Content
# LinkedIn MCP Server (LinkedIN_bot)
An MCP (Model Context Protocol) server that connects Claude to LinkedIn, letting you create posts, search jobs, view your profile, and more — all from chat.
## Features
| Tool | Description |
|------|-------------|
| `linkedin_auth_status` | Check if you're authenticated |
| `linkedin_auth_help` | Step-by-step setup guide |
| `linkedin_get_profile` | Get your LinkedIn profile info |
| `linkedin_get_member_id` | Quick lookup of your member ID/URN |
| `linkedin_create_post` | Publish a post to your feed |
| `linkedin_delete_post` | Remove a post |
| `linkedin_get_posts` | View your recent posts |
| `linkedin_search_jobs` | Search jobs by keywords & location |
| `linkedin_get_job_details` | Get full details for a job listing |
| `linkedin_draft_post` | Preview a post for review before publishing |
| `linkedin_schedule_post` | Schedule a post for a future date/time |
| `linkedin_list_scheduled` | View all scheduled posts and their status |
| `linkedin_edit_scheduled` | Edit a pending scheduled post |
| `linkedin_cancel_scheduled` | Cancel a scheduled post before it publishes |
## Quick Start
### 1. Install Dependencies
```bash
cd linkedin-mcp-server
npm install
```
### 2. Create a LinkedIn Developer App
1. Go to [developer.linkedin.com](https://developer.linkedin.com/)
2. Create an App
3. Under **Products**, request:
- "Sign In with LinkedIn using OpenID Connect"
- "Share on LinkedIn"
4. Under **Auth**, add redirect URL: `http://localhost:3456/callback`
5. Copy your **Client ID** and **Client Secret**
### 3. Authenticate
```bash
export LINKEDIN_CLIENT_ID="your_client_id"
export LINKEDIN_CLIENT_SECRET="your_client_secret"
npm run auth
```
This opens your browser for LinkedIn consent. Tokens are saved to `linkedin_tokens.json`.
### 4. Build & Run
```bash
npm run build
npm start
```
### 5. Connect to Claude Desktop
Add to your `claude_desktop_config.json`:
```json
{
"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"
}
}
}
}
```
## Alternative: Direct Access Token
If you have a token from LinkedIn's developer portal:
```bash
export LINKEDIN_ACCESS_TOKEN="your_token"
npm start
```
## Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `LINKEDIN_CLIENT_ID` | For OAuth | Your LinkedIn App's Client ID |
| `LINKEDIN_CLIENT_SECRET` | For OAuth | Your LinkedIn App's Client Secret |
| `LINKEDIN_ACCESS_TOKEN` | Alternative | Direct access token (skips OAuth) |
| `LINKEDIN_TOKEN_PATH` | Optional | Custom path for token storage file |
## Post Scheduling
LinkedIn's API doesn't support native scheduled posts, so this server includes a **local scheduler**:
- Posts are saved to a local file (`linkedin_scheduled_posts.json`) with a target publish time
- A background process checks every 30 seconds for posts that are due
- When the time arrives, it auto-publishes via the LinkedIn Posts API
- The MCP server must be running at the scheduled time for posts to publish
- If the server was offline when a post was due, it publishes on next startup
**Example workflow:**
1. Ask Claude to draft a post → review it
2. Say "schedule it for tomorrow at 9am" → post is queued
3. The server auto-publishes at the scheduled time
## Notes
- **Job Search** works without authentication (uses public LinkedIn listings)
- **Posting & Profile** require a valid access token
- **Scheduling** runs locally — your posts are stored on your machine, not on any remote server
- LinkedIn rate limits: ~100 API calls/day per member
- Access tokens expire in 60 days (auto-refreshed if refresh token available)
## License
MIT