Skip to main content
Glama
Mohamed-Godaa

LinkedIn MCP for OpenWorker

LinkedIn MCP for OpenWorker

一个面向 OpenWorker 的本地优先 LinkedIn MCP 服务器。它通过 stdio 运行,将令牌保存在环境变量或显式工具输入中,并提供小型、便于审批的工具,用于 LinkedIn 个人资料读取和帖子操作。

工具

  • linkedin_start_oauth_flow 启动浏览器 OAuth 流程,捕获 localhost 回调,交换授权码,并将令牌存储在本地。

  • linkedin_auth_status 报告是否存在已存储的令牌以及该令牌何时过期。

  • linkedin_logout 删除已存储的令牌。

  • linkedin_exchange_authorization_code 交换 OAuth 授权码并存储令牌,用于手动回退流程。

  • linkedin_get_my_profile/v2/userinfo 读取已认证成员的个人资料。

  • linkedin_create_text_post 通过 /rest/posts 发布或草拟纯文本帖子。

  • linkedin_get_post 按 URN 检索帖子。

  • linkedin_find_posts_by_author 列出成员或组织 URN 的帖子。

Related MCP server: linkedin-mcp-server

设置

npm i linkedin-mcp-openworker

创建 LinkedIn 开发者应用并请求你需要的产品/作用域:

  • openid profile email 用于通过 OpenID Connect 使用 LinkedIn 登录。

  • w_member_social 用于以已认证成员身份发布内容。

  • 组织发帖需要 LinkedIn 批准的组织作用域,例如 w_organization_social

OpenWorker 通过 Manage -> Integrations 支持 MCP 服务器,使用与 Claude Desktop 和 Cursor 相同的 mcpServers JSON 格式。构建后,添加一个如下所示的服务器:

{
  "mcpServers": {
    "linkedin": {
      "command": "npm",
      "args": ["linkedin-mcp-openworker"],
      "env": {
        "LINKEDIN_CLIENT_ID": "paste-your-linkedin-client-id-here",
        "LINKEDIN_CLIENT_SECRET": "paste-your-linkedin-client-secret-here",
        "LINKEDIN_REDIRECT_URI": "http://127.0.0.1:33333/linkedin/oauth/callback",
        "LINKEDIN_VERSION": "202607"
      }
    }
  }
}

LINKEDIN_VERSION 默认为 202607,与创建此项目时当前的 LinkedIn Marketing API 版本控制指南一致。

OAuth 流程

  1. 在你的 LinkedIn 开发者应用中,添加此授权重定向 URL:

http://127.0.0.1:33333/linkedin/oauth/callback
  1. 使用 LINKEDIN_CLIENT_IDLINKEDIN_CLIENT_SECRETLINKEDIN_REDIRECT_URI 将 MCP 服务器添加到 OpenWorker。

  2. 让 OpenWorker 运行 linkedin_start_oauth_flow

  3. MCP 启动一个 localhost 回调服务器,打开你的浏览器访问 LinkedIn,验证返回的 state,交换授权码,并将令牌存储在:

~/.linkedin-mcp-openworker/token.json
  1. 之后,LinkedIn 工具会自动使用已存储的令牌。使用 linkedin_auth_status 检查令牌状态,使用 linkedin_logout 删除令牌。

默认托管流程使用 LinkedIn 常规的三方 OAuth 授权端点:

https://www.linkedin.com/oauth/v2/authorization

这是 LinkedIn 为 OpenID Connect 记录的端点。它默认请求 openid profile email w_member_social,使用你的 client_secret 交换授权码,并将返回的访问令牌和 ID 令牌元数据存储在本地。不要将 auth_method: "pkce" 与 OpenID 作用域一起使用;LinkedIn 会拒绝该组合,并提示 Open ID permission is not supported for PKCE flows.

LinkedIn 的常规三方 OAuth 文档说明重定向 URL 应为 HTTPS。如果 LinkedIn 拒绝你的应用的 localhost 回调 URL,请使用转发到此机器的 HTTPS 回调/隧道 URL,并将 LINKEDIN_REDIRECT_URI 设置为 LinkedIn 开发者门户中注册的准确 URL。

默认情况下,OAuth 工具会在工具结果中对令牌进行脱敏处理。仅当你明确希望结果包含令牌值时,才传递 return_access_token: true

备注

LinkedIn API 访问权限取决于你的开发者应用已获批准的产品。没有 w_member_social 的令牌无法发布成员帖子,而组织帖子需要组织权限以及具有正确页面角色的已认证成员。

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    -
    quality
    D
    maintenance
    MCP server for LinkedIn, enabling posting, liking, commenting, and profile retrieval via official OAuth 2.0. Features CLI, HTTP admin, and optional Telegram bot.
    10
    MIT
  • F
    license
    -
    quality
    C
    maintenance
    MCP server for LinkedIn API integration. Enables authentication, profile access, connections, search, messaging, and feed management via OAuth2.
  • A
    license
    -
    quality
    B
    maintenance
    MCP server for AI-native LinkedIn prospecting. It enables lead research, audience building, conversation management, and controlled outreach actions such as messaging and publishing through an OAuth-protected remote endpoint.
    2
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/Mohamed-Godaa/linkedin-mcp-openworker'

If you have feedback or need assistance with the MCP directory API, please join our Discord server