
Developer guide
LinkedIn API and MCP: how to connect an AI agent to LinkedIn
In a LinkedIn API MCP setup, the MCP server turns API endpoints into tools an AI client can call. Unipile runs two: one for the coding agent that builds LinkedIn into your SaaS, one for the assistant where people use their own account.
Add a LinkedIn inbox to the contact page.
unipileread endpointGET /v2/{account_id}/chatsschema loaded
Added the inbox sync and the reply box.3 files changed · tested on the Development app
Unipile
LinkedIn account of the authenticated user
Which LinkedIn messages still wait for my reply?
LinkedInlist chats12 chats
Two people wait for you: Claire asked for the pricing deck, Marc proposed Thursday 3 pm.
Table of Contents
The basics
Unipile MCP
Short answer
LinkedIn has an API, open only to approved partner programs, and no official MCP server. An MCP server is only the layer that lets an AI agent call an API: the API does the work on LinkedIn, on behalf of the authenticated user.
Unipile gives you both layers: a REST API, a developer MCP for coding agents such as Claude Code, Cursor and Codex, and a user MCP for ChatGPT, Claude and Grok.
The basics
What is MCP, and how does it relate to the LinkedIn API?
MCP (Model Context Protocol) is an open standard that lets an AI client discover and call external tools. On LinkedIn, an MCP server does not replace an API: it sits on top of one, and turns its endpoints into tools the model can pick.
1 · MCP client
AI client



Reads the request and picks a tool.
2 · MCP server
Tools
list chatsview profilesend message
Describes what the agent can do.
3 · API
REST endpoints
GET/v2/{account_id}/chats
Runs the call with the right auth.
4 · Account
LinkedIn
Acts on behalf of the authenticated user.
The official LinkedIn API
LinkedIn opens messaging, search and Recruiter features only to partner programs most SaaS products cannot join. The LinkedIn API guide covers what each program gives access to.
No official LinkedIn MCP server
LinkedIn does not publish an MCP server. A hosted third-party server, such as the Unipile LinkedIn MCP server, gives AI clients tools backed by the Unipile LinkedIn API.
Unipile MCP
Two Unipile MCP servers: one to build, one to use
Unipile runs a developer MCP for coding agents that build LinkedIn features into your product, and a user MCP that brings your own LinkedIn account into an AI assistant. Both reach the same Unipile platform and the same linked accounts.
Developer MCPFor developers building a SaaS
Coding agentClaude Code, Cursor, Codex
API keyScoped, Development app first
Your users' accountsLinked through Hosted Auth
Your productCode that calls the REST API
User MCPFor people using an assistant
AI assistantChatGPT, Claude, Grok
OAuth sign-inNo API key in the client
ScopeSet by an Owner or Admin
Your own accountUsed in your chats
Unipile platform
One API, the same linked accounts
Classic, Sales Navigator, Recruiter
Build LinkedIn into your product
Developer MCP
Your coding agent reads the Unipile API reference, writes the integration and tests it with a scoped API key on your Development application. In production, your code calls the REST API for the accounts your users linked.
Use your own LinkedIn in an assistant
User MCP
An Owner or Admin grants MCP Access and picks the Scope. Each person adds Unipile to ChatGPT, Claude, Grok or another remote MCP client and signs in with OAuth, with no API key in the assistant.
Compare
LinkedIn API or MCP: which one does your AI agent need?
Call the REST API from your backend for production workflows, use the developer MCP while you build, and use the user MCP when a person wants their own LinkedIn in an assistant.
| REST APIRun in production | Developer MCPBuild with a coding agent | User MCPUse in an assistant | |
|---|---|---|---|
| Who it's for | REST APIYour backend and your product | Developer MCPDevelopers building an integration | User MCPEach person on your team |
| Where it runs | REST APIYour servers, with the SDKs if you like | Developer MCPClaude Code, Cursor, Codex, Gemini CLI | User MCPChatGPT, Claude, Grok and other remote MCP clients |
| Authentication | REST APIAPI key in the X-API-KEY header, server side | Developer MCPScoped Account API key; none to read the docs only | User MCPOAuth per person and per client, valid up to 30 days |
| Whose LinkedIn account | REST APIThe accounts your users linked through Hosted Auth | Developer MCPTest accounts in your Development application | User MCPThe accounts in the person's Scope |
| When to use it | REST APIInbox sync, CRM logging, a reply box in your app | Developer MCPDesigning, writing and testing a LinkedIn feature | User MCPReading, sorting and answering your own LinkedIn in chat |
Building a SaaS? Use the developer MCP while you write the feature, then the REST API once it ships. The user MCP serves people, not code.
Setup
How to connect LinkedIn to an AI agent, step by step
Three steps on each path: one ends with code in your product, the other with your own LinkedIn in your assistant.
Building a productDeveloper MCP, then the REST API
Get a scoped API key
In your Development application, create an Account API key scoped to your test accounts.
Development appAccount API key
Add the developer MCP to your coding agent
Paste the configuration from the documentation into Claude Code, Cursor, Codex or Gemini CLI. Command on the Claude Code setup page.
Let your users link LinkedIn
Through Hosted Auth, each user links their own LinkedIn account and your app stores the account ID.
Account linked
account_id
Using your own accountUser MCP in ChatGPT, Claude or Grok
An admin grants MCP Access
In the Dashboard, an Owner or Admin picks the person and the Scope of accounts they can use.
MCP AccessScope: Sales team
Sign in and approve
Authorize the client with OAuth. Consent lasts up to 30 days, revocable in My MCP accounts.
Authorize this clientup to 30 daysAuthorize
Capabilities
What an AI agent can do on LinkedIn through Unipile
Both MCP servers sit on the same Unipile LinkedIn API, which covers LinkedIn Classic, Sales Navigator and Recruiter accounts. Each action runs on behalf of the authenticated user, with what their own seat allows.
| Feature family | What the agent can do | LinkedIn account |
|---|---|---|
| Messaging | List chats and messages, send and reply, InMail, attachments | ClassicSales NavigatorRecruiter |
| Profiles and invitations | View profiles and company pages, send and manage invitations | Classic |
| Posts | Read posts, comments and reactions; publish, comment and react | Classic |
| Search | People and company search with LinkedIn filters, lead search with a Sales Navigator seat | ClassicSales Navigator |
| Recruiter | Hiring projects, job postings and applicants | Recruiter |
| Webhooks | New messages, reactions, read receipts and account status | All accounts |
Seat-specific routes are detailed on the Sales Navigator MCP and LinkedIn Recruiter MCP pages. The full list lives on the Unipile LinkedIn API page.
Developer MCP
In a coding agent: a LinkedIn feature, written and tested
Describe the feature. The agent reads the exact schema, tests on your Development application and writes the code your product runs against the REST API.
Add a LinkedIn inbox to the contact page of our CRM.
unipilesearch endpoints"chats messages"3 matches
unipileread endpointGET /v2/{account_id}/chatsschema loaded
unipilerun requestGET /v2/{account_id}/chats/{chat_id}/messages200 OK
// src/linkedin/inbox.ts export async function listChats(accountId, apiKey) { const res = await fetch( `https://api.unipile.com/v2/${accountId}/chats`, { headers: { 'X-API-KEY': apiKey } } ); return res.json(); }
Added the inbox sync and a reply box on the contact page.3 files changed · tested on the Development app
User MCP
What you can ask your assistant about LinkedIn
Pick a chat to see the request, the Unipile calls the assistant makes on your own LinkedIn account, and the answer. Anything it writes stays a draft until you confirm.
New chat
Recent
Sort my unread LinkedIn messages by priority.
Unipile2 calls
LinkedInlist chats18 unread
LinkedInread messages18 threads
By priority:
- High: Claire Lambert wants the pricing deck before Friday.
- Medium: Marc Keller proposes a call on Thursday.
- Low: 16 event invites and newsletters.
Draft a reply to ClaireAnswer Marc
Prepare my call with Marc Keller tomorrow.
Unipile2 calls
LinkedInview profileMarc Keller
LinkedInread messages7 messages
Your brief for the call:
- Role: Head of Sales at Northwind since March.
- Need: pricing for a team of 20.
- Last message: Monday, he proposed Thursday at 3 pm.
Add talking pointsSuggest an opener
Claire never replied to my last message. Draft a follow-up.
Unipile2 calls
LinkedInread chatClaire Lambert
LinkedInprepare messageDraft ready
You sent the deck on Tuesday and Claire has not answered. A short follow-up:
Draft to Claire Lambert
Hi Claire, did the deck answer your questions? Happy to go through it in 15 minutes this week.
ReviewNot nowNothing is sent until you confirm.
Sort my pending LinkedIn invitations.
Unipile2 calls
LinkedInlist invitations received12 pending
LinkedInview profiles12 profiles
Four look relevant: two work at clients, two in your market. Five are agencies, three have empty profiles. Your call:
Accept 4 invitations
Julia Martin, Hugo Silva, Emma Novak and Ravi Shah. The other eight stay pending.
ReviewNot nowNothing changes until you confirm.
Which candidates replied to me this week?
Unipile2 calls
LinkedInlist chatsThis week
LinkedInread messages6 replies
Four candidates replied:
- Ines Dubois is free for a call on Tuesday.
- Tom Becker asks for the salary range.
- Two others declined politely.
Draft a reply to TomBook a call with Ines
Draft a short comment on Julia Martin's latest post.
Unipile2 calls
LinkedInlist postsJulia Martin
LinkedInread comments14 comments
Julia announced her team's new onboarding flow yesterday. A comment for you to check:
Comment on Julia's post
Congrats on the launch, Julia. The new onboarding looks much simpler for first-time users.
ReviewNot nowNothing is sent until you confirm.
Reply to Claude
Unipile
Use it in your assistant
- 1An Owner or Admin gives you MCP Access and picks the accounts in your Scope.
- 2Link your LinkedIn account once in Unipile.
- 3Add Unipile as a custom connector in ChatGPT or Claude and approve with OAuth.
Set it up in ChatGPTSet it up in ClaudeHow the User MCP works
Good practice
How Unipile handles LinkedIn data and limits
An AI agent on LinkedIn sees and does what the linked account can do on linkedin.com, nothing more, whichever MCP server it goes through.
Data handling
Every call runs on behalf of the authenticated user, with the conversations, profiles and posts that user can already see. Unipile keeps no independent database of LinkedIn members.
How Unipile operates
Unipile is an independent technical intermediary. It is not affiliated with, endorsed by, or sponsored by LinkedIn. An assistant stays inside the Scope an admin sets.
Platform limits
LinkedIn's own limits on invitations, messages and searches still apply to every account. What to send, to whom and how often is a customer-side decision. See the limits on the LinkedIn MCP server page.
Build LinkedIn into your product with an AI agent
Start with the developer MCP and a Development application, then ship on the REST API. Your users link their own LinkedIn accounts, and the same API covers WhatsApp, Instagram, Telegram, email and calendars.
LinkedIn API and MCP: FAQ
Quick answers on the LinkedIn API, the two Unipile MCP servers and how to connect an AI agent.
LinkedIn has an API, but its messaging, search and Recruiter features sit behind partner programs, and it publishes no MCP server. The Unipile MCP servers fill the gap and act on behalf of each authenticated user. The LinkedIn MCP server page goes into the details.
Both, at different moments. Production code calls the REST API. A coding agent uses the developer MCP while it builds. A person who wants their own LinkedIn in ChatGPT, Claude or Grok uses the user MCP.
For a coding agent: create a scoped Account API key, add the developer MCP to Claude Code, Cursor, Codex or Gemini CLI, and let your users link LinkedIn through Hosted Auth. For an assistant: an admin grants MCP Access, you add Unipile as a custom connector and approve with OAuth.
The developer MCP serves developers: it gives a coding agent the Unipile API reference and test requests with an API key, to build LinkedIn features into a product. The user MCP serves people: it lets ChatGPT, Claude or Grok use the accounts in their Scope, with OAuth and no API key in the client.
The customer. Unipile is an independent technical intermediary: each action runs on behalf of the authenticated user and within LinkedIn's own limits. What is sent, to whom and how often is a customer-side decision.
No. Unipile is not affiliated with, endorsed by, or sponsored by LinkedIn. It is an independent technical intermediary: every call runs on behalf of the authenticated user who linked their own LinkedIn account.
Still have questions? Our team is here to help.
Talk to an expert
