Connecting AI agents to LinkedIn via MCP
Connect an MCP server to Claude or ChatGPT, give it LinkedIn tools, and run lead searches and message drafts from the chat client without copy-pasting profiles.
Get startedShort answer
You connect an MCP server to an MCP client like Claude Desktop, Cursor, or ChatGPT, then give it LinkedIn tools. The server handles searches and profile reads, and the client calls those tools when you ask for leads or drafts.
What an MCP server actually does for LinkedIn
An MCP server gives your AI client a set of tools. The client is the chat app you type into. The server is a small program that knows how to search LinkedIn, read a profile, or pull the comments from a post. Without the server, the model answers from training data and guesses. With the server, it calls a tool and gets a current result.
Think of the server as the hands and the client as the mouth. You ask for leads in plain language. The client decides which tool to call, sends the request, and shows you the result. The model still writes the message, but it writes from a real profile instead of a stereotype.
A useful test: ask the client to find a person you already know. If it returns the right profile and the right current company, the server is reading live data. If it returns a person with the same name but an old role, the server is not connected or the token is wrong.
A chat client with no tools
- Answers from training data
- Asks you to paste profiles
- Cannot check a current role
A chat client with an MCP server
- Calls a search tool
- Reads a profile you name
- Returns the post URL and comment text
Pick an MCP client you will actually use
Your client is the app where you type the prompt. Claude Desktop, Cursor, and other MCP clients can run tools. Pick one you will open every day. A client that sits in a tab you forget is worse than a simple saved search.
Check three things before you install anything. The client must support MCP servers, it must let you edit a JSON config, and it must show tool calls in the chat. If you cannot see the tool call, you cannot tell whether the answer came from LinkedIn or from the model's memory.
If you use more than one client, keep one config file per client. Do not copy a config from a tutorial without checking the command path. A path that works on someone else's laptop will fail on yours.
- 1
Install the client
Use the normal installer for your operating system. Open it once and sign in so the settings folder exists.
- 2
Find the MCP settings
Look for a developer, extensions, or MCP section. Some clients use a JSON file, others have a form that writes the file for you.
- 3
Run a test tool
Ask the client to list its tools. If it shows a LinkedIn search tool, the connection works. If it shows nothing, the server is not starting.
Configure the server without exposing your account
The config file tells the client how to start the server. You need the command, the arguments, and the environment variables. The command is usually a runtime like npx or python. The arguments point to the server package. The environment variables hold the token the server uses to reach LinkedIn.
Use a token from the provider, not your LinkedIn password. A password in a config file is a password in every backup and screen share. A token can be revoked without changing your login.
The exact keys depend on the server. Read the server's README and copy the key names exactly. A typo in an environment variable name looks like an authentication failure.
Keep the config file out of shared drives and public repos. If you paste a token into a chat, rotate it after the test.
Paste this job
{
"mcpServers": {
"linkedin-agent": {
"command": "npx",
"args": ["-y", "your-linkedin-mcp-server"],
"env": {
"LINKEDIN_ACCESS_TOKEN": "paste_token_here",
"MCP_LOG_LEVEL": "info"
}
}
}
}Run a lead search that returns useful profiles
Natural language works, but vague requests get vague lists. Give the agent a job title, a company size, a location, and a signal. A signal is something you can see on the profile or in a post, such as a recent funding round, a hiring post, or a comment on a competitor's page.
Ask for fewer results than you think you need. Ten profiles you can read are better than fifty you skim. Then ask the agent to explain why each profile matched. That explanation is your quality check.
If the agent returns a profile with no recent activity, ask it to show the last post date. A profile with no signal is just a name. Wait for a signal before you spend a message.
Job title
- Search field
- founders
- Weak request
- founder or co-founder
Company
- Search field
- fintech
- Weak request
- B2B fintech with 20 to 100 employees
Signal
- Search field
- active on LinkedIn
- Weak request
- posted about hiring or AI in the last 30 days
Location
- Search field
- London
- Weak request
- London, United Kingdom
Example
- You
Find 15 heads of sales at B2B SaaS companies in Chicago that raised a round in the last six months and posted on LinkedIn this month.
- Suggested reply
I can run that search. I need one decision: do you want companies with 20 to 100 employees or any size? The search tool will return more relevant profiles if I filter by headcount.
- You
20 to 100. Then read the last post from each profile and draft a first line that mentions the post topic.
- Suggested reply
I found 12 profiles that match. I skipped 3 because their last post was a job ad. Here are the first five with a draft line for each.
Turn replies into drafts you can send
Search is only half the job. The other half is the reply. When a lead answers, ask the agent to read the thread and classify the reply. A simple set works: interested, not now, wrong person, or question. The class decides the next draft.
Give the agent your own examples. Paste two messages you sent that got a real answer and two that did not. Ask it to copy the structure of the good ones and avoid the structure of the bad ones. This is faster than writing a long style guide.
If the reply is a question about price, answer the question before you ask for a call. A draft that dodges the question reads like a template.
- 1
Read the reply
Ask the agent to quote the lead's last message and the message before it so you have the context.
- 2
Name the intent
Say whether the reply is interested, a question, a delay, or a referral. The agent should not guess.
- 3
Draft one answer
Ask for one short reply that answers the question and ends with a clear next step.
- 4
Send or edit
Read the draft. If it sounds like a brochure, cut the adjectives and ask again.
Keep the agent inside safe limits
LinkedIn does not publish exact limits for invites, messages, or profile views. Any number you see online is a guess or a snapshot from one account. The safe approach is to set a cap you can track, watch the result, and lower it when the account shows friction.
An MCP server can send actions faster than a person can. That is the risk. Put a daily cap in the server or in the client, use a send window, and stop the agent when LinkedIn shows a warning. A warning is not a challenge to push through.
Keep a simple log. Note the date, the number of invites sent, and any warning. After two weeks you will see the pattern for your account. That pattern is more useful than a generic number from a blog post.
Invites
- Area
- Set a daily cap you can change
- What to do
- LinkedIn does not publish a fixed limit, so you need a number you can adjust
Messages
- Area
- Keep the first message short and ask one question
- What to do
- Long messages get skimmed and look automated
Send window
- Area
- Send during the lead's business hours
- What to do
- Replies are more likely when the message arrives during the workday
Warnings
- Area
- Stop the agent and check the account
- What to do
- Pushing through a warning puts the account at risk
Doing this with Kinlead
Kinlead has a REST Agent API and an MCP server, so Claude, ChatGPT, Cursor, Claude Code, Codex and other MCP clients can find leads, check replies and draft answers. Chat apps connect with OAuth. Scripts use API keys. Lead search uses LinkedIn's standard search, so a Sales Navigator seat is not required.
Outreach runs from your own LinkedIn account through Unipile, a third-party provider. Kinlead never stores your LinkedIn password. You can read and edit queued campaign messages on the Actions page before they send, and pause any campaign. Replies from every campaign land in one inbox, classified by intent, with interested replies first. You get an email when someone replies.
Start with the MCP server and API page if you want to connect a client. The same API can check replies and draft answers from a script.
Frequently asked questions
Related
Get started with Kinlead
Prefer markdown? Connecting AI agents to LinkedIn via MCP.md