Prerequisites
- A LinkedIn Developer application with approved products (e.g. Share on LinkedIn, Sign In with LinkedIn, Community Management as required for your use case)
- OAuth client ID, client secret, and a refresh token (recommended) or short-lived access token for testing
- Admin access to any company pages you post to
- project_contributor access
Connect in AgentRuntime
Configure the LinkedIn app
In the LinkedIn Developer Portal, note your Client ID and Client Secret. Complete OAuth for the member who will post content and store the refresh token securely.
Create a connection
Go to Connections and click New custom connection to create a connection with
ClientID, ClientSecret, and RefreshToken (or AccessToken for local testing only).Add linkedin MCP instance
Go to MCP, click Add instance for linkedin, wire your connection on Instance config, set the profile active, and save.
What you can build
- Approved social posts — LLM drafts copy from a blog RSS item → human_task →
linkedin_create_share_updateorlinkedin_create_company_update. - Campaign recap — Postgres metrics query → LLM summary →
linkedin_upload_imagefor chart → company post with link to report. - Content calendar sync — Google Sheets row with status “Ready” → post → update sheet status via
google-sheetsadapter. - Post audit —
linkedin_list_postsby author URN → archive underperformers withlinkedin_delete_postafter review.
Tools
| Tool | Description |
|---|---|
linkedin_get_userinfo | Authenticated member profile (OpenID userinfo) |
linkedin_list_organizations | Organizations the member can administer |
linkedin_create_share_update | Personal feed post |
linkedin_create_company_update | Company page post |
linkedin_upload_image | Upload image; returns asset URN for posts |
linkedin_list_posts | List posts by author URN |
linkedin_get_post | Get post by URN |
linkedin_delete_post | Delete post by URN |
linkedin_custom_api_call | Raw LinkedIn API request |
Example
Publish a company update after approval:Configuration
| Key | Required | Description |
|---|---|---|
ClientID | For OAuth refresh | LinkedIn OAuth client ID |
ClientSecret | For OAuth refresh | LinkedIn OAuth client secret |
RefreshToken | Recommended | Long-lived refresh token |
AccessToken | Testing only | Direct access token (expires quickly) |
LinkedInVersion | No | LinkedIn-Version header (YYYYMM) |
APIBase | No | API base URL |
TokenURL | No | OAuth token endpoint |
Troubleshooting
| Issue | Fix |
|---|---|
401 / token expired | Use refresh token flow; avoid long-running workflows with a one-time access token |
| Cannot post to company page | Caller must admin the organization; confirm with linkedin_list_organizations |
| Image upload fails | Call linkedin_upload_image first; pass returned URN as image_asset_id |
Related
- Integrations quickstart
- Human tasks — approval before publishing
- Connector catalog
- Troubleshooting