@himanshu31shr/linkedin-mcp-server 1.0.0 → 1.0.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 +160 -29
- package/dist/index.js +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# LinkedIn MCP Server
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@himanshu31shr/linkedin-mcp-server)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
3
6
|
A Model Context Protocol (MCP) server that provides AI agents with read/write access to the LinkedIn API.
|
|
4
7
|
|
|
5
8
|
## Features
|
|
9
|
+
|
|
6
10
|
- **Profile Tools**: Fetch user profile and email.
|
|
7
11
|
- **Post Tools**: Create text, link, image, and document posts. Delete posts.
|
|
8
12
|
- **Media Tools**: Upload images and documents to LinkedIn.
|
|
@@ -10,35 +14,74 @@ A Model Context Protocol (MCP) server that provides AI agents with read/write ac
|
|
|
10
14
|
- **Social Action Tools**: Fetch, create, and delete comments on posts. Add or remove reactions (like, celebrate, etc.).
|
|
11
15
|
- **Organization Analytics Tools**: Get organization page, follower, and share statistics.
|
|
12
16
|
|
|
13
|
-
##
|
|
17
|
+
## Prerequisites
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install
|
|
18
|
-
```
|
|
19
|
+
You need a LinkedIn Access Token. Create an app on the [LinkedIn Developer Portal](https://developer.linkedin.com/), then either:
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
- Use the built-in OAuth flow (see [Development Setup](#development-setup)), **or**
|
|
22
|
+
- Generate a token manually from the developer portal.
|
|
23
|
+
|
|
24
|
+
## Quick Start (npm — recommended)
|
|
25
|
+
|
|
26
|
+
The easiest way to use this server is via the published npm package. No cloning required.
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
- Create an app on the [LinkedIn Developer Portal](https://developer.linkedin.com/).
|
|
27
|
-
- Go to the **Auth** tab and add `http://localhost:3000/callback` to the **Authorized redirect URLs**.
|
|
28
|
-
- Run the automated OAuth flow:
|
|
29
|
-
```bash
|
|
30
|
-
npm run auth
|
|
31
|
-
```
|
|
32
|
-
- Follow the prompts in the terminal. This will automatically open a browser window for you to log in and authorize the app, then it will save your new `LINKEDIN_ACCESS_TOKEN` directly into the `.env` file!
|
|
28
|
+
### Install globally
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g @himanshu31shr/linkedin-mcp-server
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Then run it:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
LINKEDIN_ACCESS_TOKEN=your-token linkedin-mcp-server
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Or run directly with `npx`
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
```bash
|
|
43
|
+
LINKEDIN_ACCESS_TOKEN=your-token npx -y @himanshu31shr/linkedin-mcp-server
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## MCP Client Configuration
|
|
37
47
|
|
|
38
|
-
### Claude Desktop
|
|
48
|
+
### Claude Desktop
|
|
39
49
|
|
|
40
50
|
Add the following to your `claude_desktop_config.json`:
|
|
41
51
|
|
|
52
|
+
**Using npx (no install needed):**
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"linkedin": {
|
|
58
|
+
"command": "npx",
|
|
59
|
+
"args": ["-y", "@himanshu31shr/linkedin-mcp-server"],
|
|
60
|
+
"env": {
|
|
61
|
+
"LINKEDIN_ACCESS_TOKEN": "your-linkedin-access-token"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Using a global install:**
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"linkedin": {
|
|
74
|
+
"command": "linkedin-mcp-server",
|
|
75
|
+
"env": {
|
|
76
|
+
"LINKEDIN_ACCESS_TOKEN": "your-linkedin-access-token"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Using a local clone:**
|
|
84
|
+
|
|
42
85
|
```json
|
|
43
86
|
{
|
|
44
87
|
"mcpServers": {
|
|
@@ -53,19 +96,107 @@ Add the following to your `claude_desktop_config.json`:
|
|
|
53
96
|
}
|
|
54
97
|
```
|
|
55
98
|
|
|
56
|
-
### Cursor
|
|
99
|
+
### Cursor
|
|
57
100
|
|
|
58
101
|
In Cursor's Settings > AI > MCP Servers, add a new server:
|
|
102
|
+
|
|
59
103
|
- **Type**: `command`
|
|
60
104
|
- **Name**: `linkedin`
|
|
61
|
-
- **Command**: `
|
|
105
|
+
- **Command**: `npx -y @himanshu31shr/linkedin-mcp-server`
|
|
62
106
|
- **Environment Variables**: Add `LINKEDIN_ACCESS_TOKEN` with your token.
|
|
63
107
|
|
|
64
|
-
|
|
108
|
+
### Antigravity / Windsurf / Other MCP Clients
|
|
109
|
+
|
|
110
|
+
Use the same pattern — point the MCP client to:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
npx -y @himanshu31shr/linkedin-mcp-server
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
And set the `LINKEDIN_ACCESS_TOKEN` environment variable.
|
|
117
|
+
|
|
118
|
+
## Available Tools
|
|
119
|
+
|
|
120
|
+
| Tool | Description |
|
|
121
|
+
|------|-------------|
|
|
122
|
+
| `get_profile` | Fetch the authenticated user's LinkedIn profile |
|
|
123
|
+
| `get_email` | Fetch the authenticated user's email address |
|
|
124
|
+
| `create_text_post` | Create a text-only post |
|
|
125
|
+
| `create_link_post` | Create a post with a link attachment |
|
|
126
|
+
| `create_image_post` | Create a post with an image |
|
|
127
|
+
| `create_document_post` | Create a post with a document (PDF, etc.) |
|
|
128
|
+
| `delete_post` | Delete a post by URN |
|
|
129
|
+
| `upload_image` | Upload an image to LinkedIn |
|
|
130
|
+
| `get_organization` | Fetch organization details |
|
|
131
|
+
| `create_org_post` | Create a post on behalf of an organization |
|
|
132
|
+
| `get_org_posts` | Fetch recent posts for an organization |
|
|
133
|
+
| `delete_org_post` | Delete an organization post |
|
|
134
|
+
| `get_post_comments` | Fetch comments on a post |
|
|
135
|
+
| `create_comment` | Add a comment to a post |
|
|
136
|
+
| `delete_comment` | Delete a comment |
|
|
137
|
+
| `add_reaction` | Add a reaction to a post |
|
|
138
|
+
| `remove_reaction` | Remove a reaction from a post |
|
|
139
|
+
| `get_org_page_statistics` | Get organization page statistics |
|
|
140
|
+
| `get_org_follower_statistics` | Get organization follower statistics |
|
|
141
|
+
| `get_org_share_statistics` | Get organization share statistics |
|
|
142
|
+
|
|
143
|
+
## Development Setup
|
|
144
|
+
|
|
145
|
+
If you want to contribute or run from source:
|
|
146
|
+
|
|
147
|
+
1. **Clone and install**:
|
|
148
|
+
```bash
|
|
149
|
+
git clone https://github.com/himanshu31shr/linkedin-mcp-server.git
|
|
150
|
+
cd linkedin-mcp-server
|
|
151
|
+
npm install
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
2. **Build**:
|
|
155
|
+
```bash
|
|
156
|
+
npm run build
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
3. **Get a LinkedIn Access Token** (automated OAuth flow):
|
|
160
|
+
```bash
|
|
161
|
+
npm run auth
|
|
162
|
+
```
|
|
163
|
+
Follow the prompts — this will save your `LINKEDIN_ACCESS_TOKEN` to the `.env` file automatically.
|
|
164
|
+
|
|
165
|
+
4. **Run locally**:
|
|
166
|
+
```bash
|
|
167
|
+
npm run dev
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Scripts
|
|
171
|
+
|
|
172
|
+
| Script | Description |
|
|
173
|
+
|--------|-------------|
|
|
174
|
+
| `npm run build` | Compile TypeScript to JavaScript |
|
|
175
|
+
| `npm run dev` | Run in development mode with `tsx` |
|
|
176
|
+
| `npm run auth` | Run the OAuth token flow |
|
|
177
|
+
| `npm test` | Run tests with Vitest |
|
|
178
|
+
| `npm run test:coverage` | Run tests with coverage report |
|
|
179
|
+
| `npm run lint` | Type-check with TypeScript |
|
|
180
|
+
| `npm run inspect` | Launch MCP Inspector for debugging |
|
|
181
|
+
|
|
182
|
+
## Releasing a New Version
|
|
183
|
+
|
|
184
|
+
The CD pipeline automatically publishes to npm when a version tag is pushed.
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Bump version (creates commit + tag automatically)
|
|
188
|
+
npm version patch # or: npm version minor / npm version major
|
|
189
|
+
|
|
190
|
+
# Push commit and tag to trigger publish
|
|
191
|
+
git push origin main --tags
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
The pipeline will:
|
|
195
|
+
1. Validate the tag matches `package.json` version
|
|
196
|
+
2. Run lint, tests, and build
|
|
197
|
+
3. Publish to npm with [provenance](https://docs.npmjs.com/generating-provenance-statements)
|
|
198
|
+
4. Create a GitHub Release with auto-generated notes
|
|
199
|
+
|
|
200
|
+
## License
|
|
65
201
|
|
|
66
|
-
|
|
67
|
-
- `npm run watch`: Compile in watch mode.
|
|
68
|
-
- `npm test`: Run tests with Vitest.
|
|
69
|
-
- `npm run test:ui`: Run tests with UI.
|
|
70
|
-
- `npm run lint`: Run ESLint.
|
|
71
|
-
- `npm run format`: Run Prettier.
|
|
202
|
+
MIT
|
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@himanshu31shr/linkedin-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "MCP server for LinkedIn API integration — compatible with all major AI IDEs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"linkedin-mcp-server": "
|
|
9
|
+
"linkedin-mcp-server": "dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist"
|