# Linkedincli

> CLI and MCP server for LinkedIn — 43 commands for profiles, posts, messaging, connections, search, feed, and more. Cookie session auth, AI agent native.

- **Type:** MCP server
- **Install:** `agentstack add mcp-bcharleson-linkedincli`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [bcharleson](https://agentstack.voostack.com/s/bcharleson)
- **Installs:** 0
- **Category:** [Search](https://agentstack.voostack.com/c/search)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [bcharleson](https://github.com/bcharleson)
- **Source:** https://github.com/bcharleson/linkedincli

## Install

```sh
agentstack add mcp-bcharleson-linkedincli
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# linkedincli

Full LinkedIn platform management from your terminal. 43 commands for profiles, posts, messaging, connections, search, feed, engagement, and more — powered by cookie session auth.

Works as a **CLI** and an **MCP server** (for Claude Code, Cursor, Windsurf, and other AI agents).

## Install

```bash
# Install globally
npm install -g @bcharleson/linkedincli

# This installs the `linkedin` command:
linkedin --help

# Or run without installing
npx @bcharleson/linkedincli --help
```

> **Note:** The npm package is `@bcharleson/linkedincli` but the CLI command is just **`linkedin`**.

## Quick Start

### 1. Get Your Cookies

Open LinkedIn in your browser → DevTools (`F12`) → Application → Cookies → `linkedin.com`

Copy these two values:
- **`li_at`** — your session token (long string starting with `AQED...`)
- **`JSESSIONID`** — your session ID (starts with `ajax:`)

### 2. Login

```bash
linkedin login
# Paste your li_at and JSESSIONID when prompted
```

Or non-interactively:

```bash
linkedin login --li-at "AQEDxxxxxxx" --jsessionid "ajax:1234567890"
```

### 3. Use It

```bash
# View your profile
linkedin profile me --pretty

# Create a post
linkedin posts create --text "Hello LinkedIn! Posted from my terminal."

# Search for people
linkedin search people --keywords "software engineer" --network F --pretty

# Check your messages
linkedin messaging conversations --pretty

# React to a post
linkedin engage react 7123456789 --type LIKE
```

## All Commands

### Profile (9 commands)

```bash
linkedin profile me                           # Your own profile
linkedin profile view              # View any profile
linkedin profile contact-info      # Email, phone, websites
linkedin profile skills            # List skills
linkedin profile network           # Connections, followers, distance
linkedin profile badges            # Premium, influencer, etc.
linkedin profile privacy           # Privacy settings
linkedin profile posts                # Recent posts by a user
linkedin profile disconnect        # Remove a connection
```

### Posts (3 commands)

```bash
linkedin posts create --text "My post"                     # Text post
linkedin posts create --text "With image" --image ./pic.jpg  # Image post
linkedin posts create --text "Inner circle" --visibility connections
linkedin posts edit  --text "Updated text"      # Edit a post
linkedin posts delete                           # Delete a post
```

### Feed (3 commands)

```bash
linkedin feed view                            # Your feed (chronological)
linkedin feed view --count 50                 # More items
linkedin feed user                # Someone's activity
linkedin feed company           # Company updates
```

### Engagement (5 commands)

```bash
linkedin engage react  --type LIKE          # Like
linkedin engage react  --type PRAISE        # Celebrate
linkedin engage react  --type EMPATHY       # Love
linkedin engage react  --type INTEREST      # Insightful
linkedin engage react  --type ENTERTAINMENT # Funny
linkedin engage react  --type APPRECIATION  # Support

linkedin engage comment  --text "Great post!"
linkedin engage comments-list 
linkedin engage reactions 
linkedin engage share  --text "Worth reading"
```

### Connections (7 commands)

```bash
linkedin connections send                      # Send request
linkedin connections send  -m "Let's connect!" # With message
linkedin connections received                               # Pending received
linkedin connections sent                                   # Pending sent
linkedin connections accept  --secret           # Accept
linkedin connections reject  --secret           # Reject
linkedin connections withdraw                           # Withdraw sent
linkedin connections remove                      # Unfriend
```

### Messaging (6 commands)

```bash
linkedin messaging conversations                        # All conversations
linkedin messaging conversation-with       # With specific person
linkedin messaging messages            # Read messages
linkedin messaging send  -t "Hello!"   # Reply
linkedin messaging send-new -r , -t "Hi!"   # New conversation
linkedin messaging mark-read           # Mark as read
```

### Search (4 commands)

```bash
linkedin search people --keywords "CTO" --network F         # 1st connections
linkedin search people --keywords "engineer" --company 1035 # At a company
linkedin search people --title "VP Sales" --geo 103644278   # By region
linkedin search companies --keywords "AI startups"
linkedin search jobs --keywords "engineer" --remote --experience 4
linkedin search posts --keywords "AI trends"
```

### Companies (3 commands)

```bash
linkedin companies view                   # Company info
linkedin companies follow          # Follow
linkedin companies unfollow                 # Unfollow
```

### Jobs (2 commands)

```bash
linkedin jobs view                   # Job details
linkedin jobs skills                 # Skill match insights
```

### Analytics (1 command)

```bash
linkedin analytics profile-views             # Who viewed your profile
```

## Global Options

Every command supports these flags:

| Flag | Description |
|------|-------------|
| `--li-at ` | Override li_at cookie |
| `--jsessionid ` | Override JSESSIONID cookie |
| `--output pretty` | Pretty-printed JSON |
| `--pretty` | Shorthand for `--output pretty` |
| `--quiet` | No output, exit codes only |
| `--fields ` | Comma-separated fields to include |

## Environment Variables

```bash
export LINKEDIN_LI_AT="your_li_at_cookie"
export LINKEDIN_JSESSIONID="your_jsessionid_cookie"
```

Auth resolution order: `--li-at`/`--jsessionid` flags → env vars → `~/.linkedin-cli/config.json`

## MCP Server (AI Agents)

All 43 commands are available as MCP tools for Claude Code, Cursor, Windsurf, and other AI agents.

### Claude Code / Cursor / Windsurf

Add to your MCP config:

```json
{
  "mcpServers": {
    "linkedin": {
      "command": "linkedin",
      "args": ["mcp"],
      "env": {
        "LINKEDIN_LI_AT": "your_li_at_cookie",
        "LINKEDIN_JSESSIONID": "your_jsessionid_cookie"
      }
    }
  }
}
```

Or if using `npx`:

```json
{
  "mcpServers": {
    "linkedin": {
      "command": "npx",
      "args": ["-y", "@bcharleson/linkedincli", "mcp"]
    }
  }
}
```

Then your AI agent can manage your entire LinkedIn presence — create posts, respond to messages, manage connections, search for people, and more.

## Cookie Expiration

LinkedIn `li_at` cookies expire periodically (usually every few weeks). When your session expires:

```bash
linkedin status    # Check if session is valid
linkedin login     # Re-authenticate with new cookies
```

## Disclaimer

This tool uses LinkedIn's internal Voyager API via cookie session authentication. It is not affiliated with or endorsed by LinkedIn. Use responsibly and in compliance with LinkedIn's terms of service. The authors are not responsible for any account restrictions that may result from automated usage.

## License

MIT

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [bcharleson](https://github.com/bcharleson)
- **Source:** [bcharleson/linkedincli](https://github.com/bcharleson/linkedincli)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-bcharleson-linkedincli
- Seller: https://agentstack.voostack.com/s/bcharleson
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
