linkedin-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LinkedIn Automation via Rube MCP

通过Rube MCP实现LinkedIn自动化

Automate LinkedIn operations through Composio's LinkedIn toolkit via Rube MCP.
通过Composio的LinkedIn工具包,借助Rube MCP自动化LinkedIn操作。

Prerequisites

前提条件

  • Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
  • Active LinkedIn connection via
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    linkedin
  • Always call
    RUBE_SEARCH_TOOLS
    first to get current tool schemas
  • 必须已连接Rube MCP(需提供RUBE_SEARCH_TOOLS)
  • 通过
    RUBE_MANAGE_CONNECTIONS
    完成LinkedIn的活跃连接,工具包为
    linkedin
  • 请始终先调用
    RUBE_SEARCH_TOOLS
    以获取最新的工具架构

Setup

设置步骤

Get Rube MCP: Add
https://rube.app/mcp
as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
  1. Verify Rube MCP is available by confirming
    RUBE_SEARCH_TOOLS
    responds
  2. Call
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    linkedin
  3. If connection is not ACTIVE, follow the returned auth link to complete LinkedIn OAuth
  4. Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加
https://rube.app/mcp
作为MCP服务器。无需API密钥——只需添加端点即可使用。
  1. 通过确认
    RUBE_SEARCH_TOOLS
    能正常响应,验证Rube MCP是否可用
  2. 调用
    RUBE_MANAGE_CONNECTIONS
    并指定工具包为
    linkedin
  3. 如果连接状态未显示为ACTIVE,请按照返回的授权链接完成LinkedIn OAuth认证
  4. 在运行任何工作流之前,确认连接状态为ACTIVE

Core Workflows

核心工作流

1. Create a LinkedIn Post

1. 创建LinkedIn帖子

When to use: User wants to publish a text post on LinkedIn
Tool sequence:
  1. LINKEDIN_GET_MY_INFO
    - Get authenticated user's profile info [Prerequisite]
  2. LINKEDIN_REGISTER_IMAGE_UPLOAD
    - Register image upload if post includes an image [Optional]
  3. LINKEDIN_CREATE_LINKED_IN_POST
    - Publish the post [Required]
Key parameters:
  • text
    : Post content text
  • visibility
    : 'PUBLIC' or 'CONNECTIONS'
  • media_title
    : Title for attached media
  • media_description
    : Description for attached media
Pitfalls:
  • Must retrieve user profile URN via GET_MY_INFO before creating a post
  • Image uploads require a two-step process: register upload first, then include the asset in the post
  • Post text has character limits enforced by LinkedIn API
  • Visibility defaults may vary; always specify explicitly
适用场景:用户需要在LinkedIn上发布文字帖子
工具执行顺序
  1. LINKEDIN_GET_MY_INFO
    - 获取已认证用户的个人资料信息 [必备步骤]
  2. LINKEDIN_REGISTER_IMAGE_UPLOAD
    - 如果帖子包含图片,注册图片上传 [可选步骤]
  3. LINKEDIN_CREATE_LINKED_IN_POST
    - 发布帖子 [必备步骤]
关键参数
  • text
    :帖子内容文本
  • visibility
    :'PUBLIC'(公开)或'CONNECTIONS'(仅好友可见)
  • media_title
    :附加媒体的标题
  • media_description
    :附加媒体的描述
注意事项
  • 创建帖子前必须通过GET_MY_INFO获取用户个人资料URN
  • 图片上传需要分两步:先注册上传,再在帖子中引用资源
  • 帖子文本受LinkedIn API的字符数限制
  • 可见性默认值可能有所不同,请始终明确指定

2. Get Profile Information

2. 获取个人资料信息

When to use: User wants to retrieve their LinkedIn profile or company details
Tool sequence:
  1. LINKEDIN_GET_MY_INFO
    - Get authenticated user's profile [Required]
  2. LINKEDIN_GET_COMPANY_INFO
    - Get company page details [Optional]
Key parameters:
  • No parameters needed for GET_MY_INFO (uses authenticated user)
  • organization_id
    : Company/organization ID for GET_COMPANY_INFO
Pitfalls:
  • GET_MY_INFO returns the authenticated user only; cannot look up other users
  • Company info requires the numeric organization ID, not the company name or vanity URL
  • Some profile fields may be restricted based on OAuth scopes granted
适用场景:用户需要检索自己的LinkedIn个人资料或公司详情
工具执行顺序
  1. LINKEDIN_GET_MY_INFO
    - 获取已认证用户的个人资料 [必备步骤]
  2. LINKEDIN_GET_COMPANY_INFO
    - 获取公司页面详情 [可选步骤]
关键参数
  • GET_MY_INFO无需参数(使用已认证用户)
  • organization_id
    :GET_COMPANY_INFO所需的公司/组织ID
注意事项
  • GET_MY_INFO仅返回已认证用户的信息;无法查询其他用户
  • 公司信息需要数字格式的组织ID,而非公司名称或自定义URL
  • 根据OAuth授权的权限范围,部分个人资料字段可能受限

3. Manage Post Images

3. 管理帖子图片

When to use: User wants to upload and attach images to LinkedIn posts
Tool sequence:
  1. LINKEDIN_REGISTER_IMAGE_UPLOAD
    - Register an image upload with LinkedIn [Required]
  2. Upload the image binary to the returned upload URL [Required]
  3. LINKEDIN_GET_IMAGES
    - Verify uploaded image status [Optional]
  4. LINKEDIN_CREATE_LINKED_IN_POST
    - Create post with the image asset [Required]
Key parameters:
  • owner
    : URN of the image owner (user or organization)
  • image_id
    : ID of the uploaded image for GET_IMAGES
Pitfalls:
  • The upload is a two-phase process: register then upload binary
  • Image asset URN from registration must be used when creating the post
  • Supported formats typically include JPG, PNG, and GIF
  • Large images may take time to process before they are available
适用场景:用户需要上传并在LinkedIn帖子中附加图片
工具执行顺序
  1. LINKEDIN_REGISTER_IMAGE_UPLOAD
    - 在LinkedIn注册图片上传 [必备步骤]
  2. 将图片二进制文件上传至返回的上传URL [必备步骤]
  3. LINKEDIN_GET_IMAGES
    - 验证上传图片的状态 [可选步骤]
  4. LINKEDIN_CREATE_LINKED_IN_POST
    - 创建包含图片资源的帖子 [必备步骤]
关键参数
  • owner
    :图片所有者的URN(用户或组织)
  • image_id
    :GET_IMAGES所需的已上传图片ID
注意事项
  • 上传分为两个阶段:先注册,再上传二进制文件
  • 创建帖子时必须使用注册返回的图片资源URN
  • 支持的格式通常包括JPG、PNG和GIF
  • 大尺寸图片可能需要一定处理时间才能可用

4. Comment on Posts

4. 评论帖子

When to use: User wants to comment on an existing LinkedIn post
Tool sequence:
  1. LINKEDIN_CREATE_COMMENT_ON_POST
    - Add a comment to a post [Required]
Key parameters:
  • post_id
    : The URN or ID of the post to comment on
  • text
    : Comment content
  • actor
    : URN of the commenter (user or organization)
Pitfalls:
  • Post ID must be a valid LinkedIn URN format
  • The actor URN must match the authenticated user or a managed organization
  • Rate limits apply to comment creation; avoid rapid-fire comments
适用场景:用户需要对已有的LinkedIn帖子进行评论
工具执行顺序
  1. LINKEDIN_CREATE_COMMENT_ON_POST
    - 为帖子添加评论 [必备步骤]
关键参数
  • post_id
    :要评论的帖子的URN或ID
  • text
    :评论内容
  • actor
    :评论者的URN(用户或组织)
注意事项
  • 帖子ID必须是有效的LinkedIn URN格式
  • 评论者URN必须与已认证用户或管理的组织匹配
  • 评论创建存在速率限制;避免快速连续发布评论

5. Delete a Post

5. 删除帖子

When to use: User wants to remove a previously published LinkedIn post
Tool sequence:
  1. LINKEDIN_DELETE_LINKED_IN_POST
    - Delete the specified post [Required]
Key parameters:
  • post_id
    : The URN or ID of the post to delete
Pitfalls:
  • Deletion is permanent and cannot be undone
  • Only the post author or organization admin can delete a post
  • The post_id must be the exact URN returned when the post was created
适用场景:用户需要删除之前发布的LinkedIn帖子
工具执行顺序
  1. LINKEDIN_DELETE_LINKED_IN_POST
    - 删除指定帖子 [必备步骤]
关键参数
  • post_id
    :要删除的帖子的URN或ID
注意事项
  • 删除操作是永久性的,无法撤销
  • 只有帖子作者或组织管理员才能删除帖子
  • post_id必须是创建帖子时返回的完整URN

Common Patterns

通用模式

ID Resolution

ID解析

User URN from profile:
1. Call LINKEDIN_GET_MY_INFO
2. Extract user URN (e.g., 'urn:li:person:XXXXXXXXXX')
3. Use URN as actor/owner in subsequent calls
Organization ID from company:
1. Call LINKEDIN_GET_COMPANY_INFO with organization_id
2. Extract organization URN for posting as a company page
从个人资料获取用户URN
1. 调用LINKEDIN_GET_MY_INFO
2. 提取用户URN(例如:'urn:li:person:XXXXXXXXXX')
3. 在后续调用中使用该URN作为actor/owner参数
从公司获取组织ID
1. 使用organization_id调用LINKEDIN_GET_COMPANY_INFO
2. 提取组织URN以代表公司页面发布内容

Image Upload Flow

图片上传流程

  • Call REGISTER_IMAGE_UPLOAD to get upload URL and asset URN
  • Upload the binary image to the provided URL
  • Use the asset URN when creating a post with media
  • Verify with GET_IMAGES if upload status is uncertain
  • 调用REGISTER_IMAGE_UPLOAD获取上传URL和资源URN
  • 将图片二进制文件上传至提供的URL
  • 创建带媒体的帖子时使用资源URN
  • 如果对上传状态不确定,使用GET_IMAGES验证

Known Pitfalls

已知注意事项

Authentication:
  • LinkedIn OAuth tokens have limited scopes; ensure required permissions are granted
  • Tokens expire; re-authenticate if API calls return 401 errors
URN Formats:
  • LinkedIn uses URN identifiers (e.g., 'urn:li:person:ABC123')
  • Always use the full URN format, not just the alphanumeric ID portion
  • Organization URNs differ from person URNs
Rate Limits:
  • LinkedIn API has strict daily rate limits on post creation and comments
  • Implement backoff strategies for bulk operations
  • Monitor 429 responses and respect Retry-After headers
Content Restrictions:
  • Posts have character limits enforced by the API
  • Some content types (polls, documents) may require additional API features
  • HTML markup in post text is not supported
认证
  • LinkedIn OAuth令牌的权限范围有限;确保已授予所需权限
  • 令牌会过期;如果API调用返回401错误,请重新认证
URN格式
  • LinkedIn使用URN标识符(例如:'urn:li:person:ABC123')
  • 请始终使用完整的URN格式,而非仅使用字母数字ID部分
  • 组织URN与个人URN格式不同
速率限制
  • LinkedIn API对帖子创建和评论有严格的每日速率限制
  • 批量操作时请实现退避策略
  • 监控429响应并遵守Retry-After头部信息
内容限制
  • 帖子受API的字符数限制
  • 某些内容类型(投票、文档)可能需要额外的API功能支持
  • 帖子文本不支持HTML标记

Quick Reference

快速参考

TaskTool SlugKey Params
Get my profileLINKEDIN_GET_MY_INFO(none)
Create postLINKEDIN_CREATE_LINKED_IN_POSTtext, visibility
Get company infoLINKEDIN_GET_COMPANY_INFOorganization_id
Register image uploadLINKEDIN_REGISTER_IMAGE_UPLOADowner
Get uploaded imagesLINKEDIN_GET_IMAGESimage_id
Delete postLINKEDIN_DELETE_LINKED_IN_POSTpost_id
Comment on postLINKEDIN_CREATE_COMMENT_ON_POSTpost_id, text, actor
任务工具标识关键参数
获取我的个人资料LINKEDIN_GET_MY_INFO
创建帖子LINKEDIN_CREATE_LINKED_IN_POSTtext, visibility
获取公司信息LINKEDIN_GET_COMPANY_INFOorganization_id
注册图片上传LINKEDIN_REGISTER_IMAGE_UPLOADowner
获取已上传图片LINKEDIN_GET_IMAGESimage_id
删除帖子LINKEDIN_DELETE_LINKED_IN_POSTpost_id
评论帖子LINKEDIN_CREATE_COMMENT_ON_POSTpost_id, text, actor