Skip to main content
Glama
LinkedIn MCP for OpenWorker

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_ID、LINKEDIN_CLIENT_SECRET 和 LINKEDIN_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 的令牌无法发布成员帖子,而组织帖子需要组织权限以及具有正确页面角色的已认证成员。

Available Tools

8 tools
linkedin_auth_statusA
Read-only

Check whether this MCP server has a stored LinkedIn OAuth token.

Inputs: no named parameters.

linkedin_create_text_postA
Destructive

Publish or draft a text-only LinkedIn post for a member or organization author URN.

Inputs: author_urn (required), commentary (required), visibility, access_token, +2 more.

linkedin_exchange_authorization_codeA

Exchange a LinkedIn OAuth authorization code for tokens and store the token locally.

Inputs: code (required), client_id (required), redirect_uri (required), client_secret (required), +1 more.

linkedin_find_posts_by_authorB
Read-only

Find LinkedIn posts by member or organization author URN.

Inputs: author_urn (required), count, start, access_token, +1 more.

linkedin_get_my_profileA
Read-only

Read the authenticated LinkedIn member profile using the OIDC userinfo endpoint.

Inputs: access_token.

linkedin_get_postA
Read-only

Retrieve a LinkedIn post by URN.

Inputs: post_urn (required), access_token, view_context.

linkedin_logoutA
Destructive

Delete the locally stored LinkedIn OAuth token for this MCP server.

Inputs: no named parameters.

linkedin_start_oauth_flowA

Start a browser-based LinkedIn OAuth flow, capture the localhost callback, exchange the code, and store the token locally.

Inputs: scopes, client_id, auth_method, redirect_uri, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools are clearly distinct, but linkedin_start_oauth_flow and linkedin_exchange_authorization_code overlap since the start flow already includes exchanging the authorization code. An agent could be unsure which to use for a given OAuth scenario.

    Naming Consistency5/5

    All tool names follow a consistent linkedin_verb_noun snake_case pattern. Verbs are clear and predictable, making the toolset easy to navigate.

    Tool Count5/5

    Eight tools is well-scoped for a LinkedIn MCP covering authentication, profile access, and post management. Each tool earns its place without unnecessary bloat.

    Completeness4/5

    Core auth and post workflows are covered, but the post surface is read/create only—there is no update or delete post tool. This is a minor gap for typical LinkedIn content management workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      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.
      14 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for LinkedIn API integration. Enables authentication, profile access, connections, search, messaging, and feed management via OAuth2.
      MIT
    • A
      license
      Not graded
      quality
      C
      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
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that lets you publish text and image posts to LinkedIn, fetch your profile, and check auth status using natural language.
      MIT