linkedin-mcp
LinkedIn MCP
非官方的 Model Context Protocol 服务器,用于 LinkedIn —— 从任何 MCP 客户端(Claude 等)读取你的个人资料、人脉网络和联系人、搜索人和职位,并发送消息。
它有两种运行模式:
HTTP + OAuth 2.1(推荐)—— 服务器是 MCP 客户端的 OAuth 2.1 授权服务器,并桥接到 LinkedIn 真正的三方 OAuth 同意界面。每个用户在
linkedin.com上登录;服务器永远不会看到他们的密码。stdio —— 一个本地服务器,从环境中读取
LINKEDIN_ACCESS_TOKEN。适合单个用户或快速测试。
这镜像了 @aol/ifood-mcp 和 @aol/uber-mcp 的认证架构,将它们的逆向工程登录替换为 LinkedIn 的一流 OAuth。
工具
工具 | LinkedIn 端点 | 说明 |
|
| 使用默认的 |
|
| 需要 |
|
| 需要已批准的联系人产品。 |
|
| 需要已批准的个人资料产品。 |
|
| 需要已批准的搜索产品。 |
|
| 需要已批准的职位产品。 |
|
| 需要 |
LinkedIn API 访问权限。 开箱即用时,标准 LinkedIn 应用仅授予 OpenID Connect 作用域(
openid profile email),因此linkedin_me可以 立即工作。其他工具调用的端点受 LinkedIn 已批准产品(Sign In、Marketing、Talent Solutions 等)的门控。 在你的应用获得这些产品批准之前,这些工具将返回 403 —— 这是 LinkedIn 平台限制,而非 bug。一旦获得批准,将授予的作用域添加到LINKEDIN_SCOPES中。
Related MCP server: Linkd MCP Server
快速开始(HTTP + OAuth)
1. 创建 LinkedIn 应用
前往 https://www.linkedin.com/developers/apps → Create app。
在 Auth 下,复制 Client ID 和 Client Secret。
在 Authorized redirect URLs 下添加你的回调地址:
http://localhost:3000/login/callback(或PUBLIC_URL+/login/callback)。在 Products 下,添加 Sign In with LinkedIn using OpenID Connect(以及你需要的其他产品)。
2. 配置
cp .env.example .env
# then edit .env:
# MCP_JWT_SECRET=$(openssl rand -hex 32)
# LINKEDIN_CLIENT_ID=...
# LINKEDIN_CLIENT_SECRET=...
# PUBLIC_URL=http://localhost:30003. 运行
npm install
npm run build
npm run start:http # or: npm run dev (tsx watch)将你的 MCP 客户端指向 http://localhost:3000/mcp。首次连接时,它会运行
OAuth 2.1 流程,将你重定向到 LinkedIn 登录,然后代表你调用工具。
快速开始(stdio)
cp .env.example .env
# set LINKEDIN_ACCESS_TOKEN=... (e.g. from the LinkedIn developer console token generator)
npm install && npm run build
npm startMCP 客户端配置:
{
"mcpServers": {
"linkedin": {
"command": "node",
"args": ["/absolute/path/to/linkedin-mcpserver/build/index.js"],
"env": { "LINKEDIN_ACCESS_TOKEN": "AQV..." }
}
}
}OAuth 桥接的工作原理
MCP client ──/authorize──▶ this server ──302──▶ /login ──▶ /login/start
│
302 ▼ linkedin.com/oauth/v2/authorization
user signs in on LinkedIn
│
/login/callback ◀──302 code&state──────────────────────┘
│ exchange code → LinkedIn access + refresh token
│ fetch /v2/userinfo → stable member id (sub)
│ store tokens per‑user, mint an MCP auth code
▼
MCP client ──/token──▶ this server ──▶ HS256 JWT (audience‑bound to /mcp)
MCP client ──/mcp (Bearer JWT)──▶ tools call LinkedIn with the member's tokenMCP 访问令牌是使用
MCP_JWT_SECRET签名的短期 HS256 JWT, 受众绑定到/mcp资源(RFC 8707),并带有轮换的刷新令牌。当应用获得刷新令牌批准时,下游 LinkedIn 令牌会透明地刷新;否则用户需要重新认证。
所有状态都在内存中(单进程)。将
src/http/store.ts中的存储替换为 Redis/DB 即可水平扩展。
环境变量
变量 | 必需 | 默认值 | 用途 |
| – |
| HTTP 端口。 |
| HTTP |
| 客户端和 LinkedIn 看到的 URL。 |
| HTTP | – | HS256 密钥(≥32 字符)。 |
| HTTP | – | LinkedIn 应用客户端 ID。 |
| HTTP | – | LinkedIn 应用客户端密钥。 |
| – |
| 要请求的 OAuth 作用域。 |
| – |
| OAuth 回调覆盖。 |
| stdio | – | stdio 模式的令牌。 |
| – |
| API 主机覆盖。 |
| – | – |
|
目录结构
src/
index.ts stdio server + tool catalog + executeTool + TokenProvider
http-server.ts remote MCP server (Streamable HTTP + OAuth 2.1)
http/
provider.ts LinkedInOAuthProvider (OAuthServerProvider, HS256 JWTs)
login-router.ts /login → LinkedIn consent → /login/callback
linkedin-auth.ts LinkedIn OAuth client (authorize / token / userinfo)
session-provider.ts per-user token lookup + transparent refresh
store.ts in-memory OAuth + downstream token stores脚本
脚本 | 操作 |
| 编译到 |
| 运行 HTTP/OAuth 服务器。 |
| 运行 stdio 服务器。 |
|
|
|
|
|
|
许可证
MIT。参见 LICENSE。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables seamless interaction with LinkedIn for job applications, profile retrieval, feed browsing, and resume analysis through natural language commands.31
- AlicenseAqualityDmaintenanceAn unofficial Model Context Protocol server that enables programmatic access to LinkedIn data through tools like user search, company search, profile enrichment, and contact retrieval.87173ISC
- FlicenseNot gradedqualityDmaintenanceA comprehensive Model Context Protocol server that enables AI assistants to interact with LinkedIn APIs for profile management, content creation, networking, messaging, and analytics.2
- AlicenseAqualityFmaintenanceAn unofficial Model Context Protocol server that provides LinkedIn tools for searching users, enriching profiles, retrieving contact information, and conducting deep research through natural language interfaces.5135MIT
Related MCP Connectors
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
MCP server for LeadDelta — manage LinkedIn connections and CRM data via AI assistants.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AriOliv/linkedin-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server