linkedin-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLinkedIn Automation via Rube MCP
通过Rube MCP实现LinkedIn自动化
Automate LinkedIn operations through Composio's LinkedIn toolkit via Rube MCP.
Toolkit docs: composio.dev/toolkits/linkedin
借助Rube MCP,通过Composio的LinkedIn工具包自动化LinkedIn操作。
Prerequisites
前提条件
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active LinkedIn connection via with toolkit
RUBE_MANAGE_CONNECTIONSlinkedin - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
- 必须已连接Rube MCP(需具备RUBE_SEARCH_TOOLS功能)
- 通过并使用
RUBE_MANAGE_CONNECTIONS工具包完成LinkedIn的激活连接linkedin - 请始终先调用以获取最新的工具模式
RUBE_SEARCH_TOOLS
Setup
设置步骤
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSlinkedin - If connection is not ACTIVE, follow the returned auth link to complete LinkedIn OAuth
- Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加作为MCP服务器。无需API密钥 —— 只需添加该端点即可使用。
https://rube.app/mcp- 通过确认能正常响应,验证Rube MCP是否可用
RUBE_SEARCH_TOOLS - 调用并指定工具包为
RUBE_MANAGE_CONNECTIONSlinkedin - 如果连接状态未显示为ACTIVE,请按照返回的授权链接完成LinkedIn OAuth认证
- 在运行任何工作流之前,确认连接状态为ACTIVE
Core Workflows
核心工作流
1. Create a LinkedIn Post
1. 创建LinkedIn帖子
When to use: User wants to publish a text post on LinkedIn
Tool sequence:
- - Get authenticated user's profile info [Prerequisite]
LINKEDIN_GET_MY_INFO - - Register image upload if post includes an image [Optional]
LINKEDIN_REGISTER_IMAGE_UPLOAD - - Publish the post [Required]
LINKEDIN_CREATE_LINKED_IN_POST
Key parameters:
- : Post content text
text - : 'PUBLIC' or 'CONNECTIONS'
visibility - : Title for attached media
media_title - : Description for attached media
media_description
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上发布文字帖子
工具流程:
- - 获取已认证用户的个人资料信息 [前提步骤]
LINKEDIN_GET_MY_INFO - - 如果帖子包含图片,注册图片上传 [可选]
LINKEDIN_REGISTER_IMAGE_UPLOAD - - 发布帖子 [必填]
LINKEDIN_CREATE_LINKED_IN_POST
关键参数:
- : 帖子内容文本
text - : 'PUBLIC'(公开)或 'CONNECTIONS'(仅联系人可见)
visibility - : 附加媒体的标题
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:
- - Get authenticated user's profile [Required]
LINKEDIN_GET_MY_INFO - - Get company page details [Optional]
LINKEDIN_GET_COMPANY_INFO
Key parameters:
- No parameters needed for GET_MY_INFO (uses authenticated user)
- : Company/organization ID for GET_COMPANY_INFO
organization_id
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个人资料或企业详情
工具流程:
- - 获取已认证用户的个人资料 [必填]
LINKEDIN_GET_MY_INFO - - 获取企业页面详情 [可选]
LINKEDIN_GET_COMPANY_INFO
关键参数:
- GET_MY_INFO无需参数(使用已认证用户信息)
- : GET_COMPANY_INFO所需的企业/组织ID
organization_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:
- - Register an image upload with LinkedIn [Required]
LINKEDIN_REGISTER_IMAGE_UPLOAD - Upload the image binary to the returned upload URL [Required]
- - Verify uploaded image status [Optional]
LINKEDIN_GET_IMAGES - - Create post with the image asset [Required]
LINKEDIN_CREATE_LINKED_IN_POST
Key parameters:
- : URN of the image owner (user or organization)
owner - : ID of the uploaded image for GET_IMAGES
image_id
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帖子
工具流程:
- - 在LinkedIn注册图片上传 [必填]
LINKEDIN_REGISTER_IMAGE_UPLOAD - 将图片二进制文件上传至返回的上传URL [必填]
- - 验证上传图片的状态 [可选]
LINKEDIN_GET_IMAGES - - 创建包含图片资源的帖子 [必填]
LINKEDIN_CREATE_LINKED_IN_POST
关键参数:
- : 图片所有者的URN(用户或组织)
owner - : GET_IMAGES所需的上传图片ID
image_id
注意事项:
- 上传分为两个阶段:先注册,再上传二进制文件
- 创建帖子时必须使用注册返回的资源URN
- 支持的格式通常包括JPG、PNG和GIF
- 大尺寸图片可能需要一定处理时间才能可用
4. Comment on Posts
4. 评论帖子
When to use: User wants to comment on an existing LinkedIn post
Tool sequence:
- - Add a comment to a post [Required]
LINKEDIN_CREATE_COMMENT_ON_POST
Key parameters:
- : The URN or ID of the post to comment on
post_id - : Comment content
text - : URN of the commenter (user or organization)
actor
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帖子进行评论
工具流程:
- - 为帖子添加评论 [必填]
LINKEDIN_CREATE_COMMENT_ON_POST
关键参数:
- : 要评论的帖子的URN或ID
post_id - : 评论内容
text - : 评论者的URN(用户或组织)
actor
注意事项:
- 帖子ID必须是有效的LinkedIn URN格式
- 评论者的URN必须与已认证用户或管理的组织匹配
- 评论创建存在频率限制,避免快速连续评论
5. Delete a Post
5. 删除帖子
When to use: User wants to remove a previously published LinkedIn post
Tool sequence:
- - Delete the specified post [Required]
LINKEDIN_DELETE_LINKED_IN_POST
Key parameters:
- : The URN or ID of the post to delete
post_id
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帖子
工具流程:
- - 删除指定帖子 [必填]
LINKEDIN_DELETE_LINKED_IN_POST
关键参数:
- : 要删除的帖子的URN或ID
post_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 callsOrganization 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. 在后续调用中用作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
快速参考
| Task | Tool Slug | Key Params |
|---|---|---|
| Get my profile | LINKEDIN_GET_MY_INFO | (none) |
| Create post | LINKEDIN_CREATE_LINKED_IN_POST | text, visibility |
| Get company info | LINKEDIN_GET_COMPANY_INFO | organization_id |
| Register image upload | LINKEDIN_REGISTER_IMAGE_UPLOAD | owner |
| Get uploaded images | LINKEDIN_GET_IMAGES | image_id |
| Delete post | LINKEDIN_DELETE_LINKED_IN_POST | post_id |
| Comment on post | LINKEDIN_CREATE_COMMENT_ON_POST | post_id, text, actor |
Powered by Composio
| 任务 | 工具标识 | 关键参数 |
|---|---|---|
| 获取我的个人资料 | LINKEDIN_GET_MY_INFO | 无 |
| 创建帖子 | LINKEDIN_CREATE_LINKED_IN_POST | text, visibility |
| 获取企业信息 | LINKEDIN_GET_COMPANY_INFO | organization_id |
| 注册图片上传 | LINKEDIN_REGISTER_IMAGE_UPLOAD | owner |
| 获取已上传图片 | LINKEDIN_GET_IMAGES | image_id |
| 删除帖子 | LINKEDIN_DELETE_LINKED_IN_POST | post_id |
| 评论帖子 | LINKEDIN_CREATE_COMMENT_ON_POST | post_id, text, actor |
由 Composio 提供支持