@clickonsearch/linkedin-mcp-server 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +63 -53
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,78 +1,88 @@
1
1
  # @clickonsearch/linkedin-mcp-server
2
2
 
3
- MCP server for a **personal** LinkedIn account via LinkedIn's OAuth 2.0 API.
4
- Exposes exactly two tools: `get_profile` and `create_post`.
3
+ Connects a personal LinkedIn account to this repo's agents: read your
4
+ profile, publish posts. Usually you won't run this directly —
5
+ [`linkedin-agent`](../../agents/linkedin-agent)'s README tells you when to.
5
6
 
6
- ## Why only two tools
7
-
8
- LinkedIn's public API is far more restricted than GitHub's or Gmail's. A
9
- standard, self-serve developer app can only:
10
-
11
- - Read the authenticated member's own basic profile (OpenID Connect).
12
- - Publish a post to their own feed (`w_member_social`).
13
-
14
- **Sending LinkedIn messages is not available via any public API** — it only
15
- exists under partner programs (Talent Solutions, Sales Navigator) that
16
- require a formal application and LinkedIn's manual approval; there is no
17
- self-serve path to it at all.
18
-
19
- **Replying/commenting on posts** has a documented endpoint
20
- (`/v2/socialActions/{urn}/comments`), but creating comments requires a
21
- separate LinkedIn Developer Program product ("Community Management API" or
22
- similar) that also needs LinkedIn's case-by-case approval — it is not
23
- included in standard "Sign In with LinkedIn" / "Share on LinkedIn" access.
24
- This server doesn't implement it; if you get that access approved, adding
25
- a `create_comment` tool following the same pattern as `create_post` would
26
- be straightforward.
7
+ ```
8
+ linkedin-agent (or any MCP client)
9
+ │
10
+ ▼
11
+ ┌─────────────────────────────┐
12
+ │ linkedin-mcp-server │ Streamable HTTP MCP
13
+ └──────────────┬──────────────┘
14
+ │
15
+ ▼
16
+ ┌─────────────────────────────┐
17
+ │ LinkedIn OAuth API │ get_profile / create_post
18
+ └──────────────┬──────────────┘
19
+ │
20
+ ▼
21
+ your LinkedIn account
22
+ ```
27
23
 
28
24
  ## Setup
29
25
 
30
- 1. Create an app at [linkedin.com/developers/apps](https://www.linkedin.com/developers/apps).
31
- 2. Under **Products**, add **"Sign In with LinkedIn using OpenID Connect"**
32
- and **"Share on LinkedIn"** — both are self-serve, no approval wait.
33
- 3. Under **Auth**, add an **Authorized redirect URL** matching
34
- `LINKEDIN_REDIRECT_URI` below exactly (default `http://localhost:3300/callback`).
35
- 4. Copy the app's **Client ID** and **Client Secret**.
26
+ **1. Create a LinkedIn app** (free, a few minutes):
36
27
 
37
- ```bash
38
- cd mcp-servers/linkedin-mcp-server
39
- npm install
40
- cp .env.example .env
41
- # fill in LINKEDIN_CLIENT_ID / LINKEDIN_CLIENT_SECRET
42
- ```
28
+ 1. Go to [linkedin.com/developers/apps](https://www.linkedin.com/developers/apps) → Create app.
29
+ 2. Under **Products**, add **"Sign In with LinkedIn using OpenID Connect"** and **"Share on LinkedIn"**.
30
+ 3. Under **Auth**, add an **Authorized redirect URL**: `http://localhost:3300/callback`.
31
+ 4. Copy the app's **Client ID** and **Client Secret**.
43
32
 
44
- ## Authorize (one-time)
33
+ **2. Authorize it** (one time — run from a folder you'll reuse in step 3):
45
34
 
46
35
  ```bash
47
- npm run dev:authorize
36
+ LINKEDIN_CLIENT_ID=<id> LINKEDIN_CLIENT_SECRET=<secret> \
37
+ npx -p @clickonsearch/linkedin-mcp-server linkedin-authorize
48
38
  ```
49
39
 
50
- This prints a URL — open it, sign in, approve — and it saves a token to
51
- `LINKEDIN_TOKEN_PATH` (default `./linkedin-token.json`, gitignored).
40
+ This opens a link — sign in, approve, done. It saves a token to
41
+ `linkedin-token.json` in the current folder, so step 3 needs to run from
42
+ this same folder.
52
43
 
53
- **Important:** LinkedIn only issues a refresh token to apps it has approved
54
- for offline access. For a standard app, the access token this saves is
55
- valid for **~60 days** and there is no automatic renewal — re-run this
56
- command once it expires (tools will fail with a clear "access token has
57
- expired" error when that happens).
44
+ > LinkedIn's access tokens last ~60 days and (for a standard app) don't
45
+ > auto-renew. When yours expires, just re-run the authorize command above —
46
+ > you'll get a clear error telling you to when that happens.
58
47
 
59
48
  ## Run
60
49
 
61
50
  ```bash
62
- npm run dev
51
+ LINKEDIN_CLIENT_ID=<id> LINKEDIN_CLIENT_SECRET=<secret> \
52
+ npx @clickonsearch/linkedin-mcp-server
63
53
  ```
64
54
 
65
- - `POST http://localhost:4300/mcp` — the MCP endpoint (Streamable HTTP, stateless).
66
- - `GET http://localhost:4300/health` — liveness check.
55
+ It's now listening on `http://localhost:4300` for whatever agent you point
56
+ at it.
57
+
58
+ ## What it exposes
59
+
60
+ | Tool | What it does |
61
+ | -------------- | -------------------------------------------------------- |
62
+ | `get_profile` | Your name, email, and picture |
63
+ | `create_post` | Publishes a text post to your own feed |
64
+
65
+ ## Good to know
66
+
67
+ LinkedIn's public API only allows reading your own profile and posting to
68
+ your own feed — that's genuinely everything a standard app can do. It
69
+ **can't** send messages (no public API for that at all) or comment on
70
+ other people's posts (needs special LinkedIn approval). This server
71
+ doesn't pretend otherwise.
72
+
73
+ ---
67
74
 
68
- ## Tools
75
+ ## For developers
69
76
 
70
- | Tool | Args | Notes |
71
- | -------------- | ------ | ----------------------------------------------------- |
72
- | `get_profile` | — | Name, email, picture — from the OpenID Connect userinfo endpoint |
73
- | `create_post` | `text` | Publishes to the authenticated member's own feed, `visibility: PUBLIC` |
77
+ **Running from source:**
74
78
 
75
- ## Using it as a library
79
+ ```bash
80
+ cd mcp-servers/linkedin-mcp-server
81
+ npm install
82
+ cp .env.example .env # fill in LINKEDIN_CLIENT_ID / LINKEDIN_CLIENT_SECRET
83
+ npm run dev:authorize # opens a consent link in your browser, one time
84
+ npm run dev
85
+ ```
76
86
 
77
87
  ```ts
78
88
  import { TokenManager, LinkedInClient, createServer } from "./src/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickonsearch/linkedin-mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for a personal LinkedIn account via LinkedIn's OAuth 2.0 API: read your own profile and publish posts to your feed.",
5
5
  "type": "module",
6
6
  "license": "MIT",