Skip to main content
Glama
Sudharsan2618

LinkedIn MCP Server

README.md
# LinkedIn MCP Server (AI version)

A powerful [Model Context Protocol](https://modelcontextprotocol.io) server that
exposes verified LinkedIn capabilities as MCP **tools**, plus an account-research
**prompt** — runnable over **stdio** (local) and **Streamable HTTP** (remote).

> Built as the reference implementation for the course in `../Documentation/`.
> Scope: LinkedIn-only (Tier A verified core + Tier D extended). See `PLAN.md`.

## Tools

| Tool | What it does |
|---|---|
| `linkedin_get_company_profile` | Company name, industry, size, HQ, specialities |
| `linkedin_get_company_posts` | Recent company posts with engagement |
| `linkedin_get_company_insights` | Headcount growth, hiring signals, people highlights |
| `linkedin_search_company_leaders` | Leadership-level people at a company |
| `linkedin_get_person_profile` | A person's profile |
| `linkedin_get_person_posts` | A person's recent posts |
| _Tier D (extended)_ | company/people/job search, contact info — added in Phase 4 |

Prompt: `account_intel` — scripts the tools into a full company brief.

## Setup

```bash
uv sync --extra dev
cp .env.example .env        # then fill in LI_AT + LI_JSESSIONID
```

## Run

```bash
# stdio (default) — for local hosts / the Inspector
uv run linkedin-mcp

# Streamable HTTP — secured (Origin allowlist + bearer token), localhost-bound
uv run linkedin-mcp --transport http
```

## Verify in the MCP Inspector

```bash
npx @modelcontextprotocol/inspector uv run linkedin-mcp
```

List tools, then call `linkedin_get_company_profile` with
`{"linkedin_url_or_slug": "microsoft"}`.

## Plug into Claude Desktop (stdio)

```json
{
  "mcpServers": {
    "linkedin": {
      "command": "uv",
      "args": ["run", "--directory", "C:/Users/WELCOME/Desktop/Linked-MCP/ai-version", "linkedin-mcp"]
    }
  }
}
```

## Notes & safety

- Unofficial `linkedin-api`: cookie auth (`LI_AT` + `LI_JSESSIONID`) is the
  supported path; password login often hits a challenge. Cookies expire → tools
  return a clear auth error.
- Rate limits are real; post counts are clamped. Heavy use can flag the account.
- stdio writes JSON-RPC on stdout — all logs go to **stderr** only.
- HTTP proxies your LinkedIn identity: set `MCP_AUTH_TOKEN` and keep the bind on
  localhost before sharing.