@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.
- package/README.md +63 -53
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,78 +1,88 @@
|
|
|
1
1
|
# @clickonsearch/linkedin-mcp-server
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
33
|
+
**2. Authorize it** (one time — run from a folder you'll reuse in step 3):
|
|
45
34
|
|
|
46
35
|
```bash
|
|
47
|
-
|
|
36
|
+
LINKEDIN_CLIENT_ID=<id> LINKEDIN_CLIENT_SECRET=<secret> \
|
|
37
|
+
npx -p @clickonsearch/linkedin-mcp-server linkedin-authorize
|
|
48
38
|
```
|
|
49
39
|
|
|
50
|
-
This
|
|
51
|
-
`
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
51
|
+
LINKEDIN_CLIENT_ID=<id> LINKEDIN_CLIENT_SECRET=<secret> \
|
|
52
|
+
npx @clickonsearch/linkedin-mcp-server
|
|
63
53
|
```
|
|
64
54
|
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
##
|
|
75
|
+
## For developers
|
|
69
76
|
|
|
70
|
-
|
|
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
|
-
|
|
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.
|
|
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",
|