DEV Community

Cover image for Building an AI Agent Workflow with a LinkedIn MCP Connector
Techforce Global
Techforce Global

Posted on Originally published at linkedin.com

Building an AI Agent Workflow with a LinkedIn MCP Connector

Most tutorials on MCP cover the protocol in the abstract the spec, the message format, a toy example. This post is the opposite: a working walkthrough of wiring a real MCP connector (this actor, which finds LinkedIn decision makers) into an agent, plus the API-level details for anyone who wants to call it directly instead of through an MCP client.

If you've read the protocol docs and still aren't quite sure what an actual integration looks like end to end, this should close that gap three concrete paths (MCP client, direct API, real-time endpoint), each with working code, so you can pick whichever fits your existing stack rather than starting from the spec every time.

The two directions of MCP on Apify, and which one this uses

Apify's own MCP server exposes actors as tools TO outside AI clients Claude, Cursor, and others discover and call Apify actors as part of their toolset. MCP connectors work in the opposite direction: an actor calls OUT to a third-party service (Notion, Slack, Jira) on the user's behalf. This actor supports both it can be called as a tool by an agent, and it can push its own results out via a connector. Understanding which direction you're working with matters, since the setup differs, and mixing them up is the most common early confusion when first working with MCP-enabled actors.

Connecting via MCP client config

If you're using Claude Desktop, Cursor, or another MCP-compatible client, connecting to Apify's hosted MCP server looks like this:

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com",
"headers": {
"Authorization": "Bearer YOUR_APIFY_API_TOKEN"
}
}
}
}

Once connected, the agent can discover and call this actor (and any other Apify actor) as a tool, passing companyName as an argument the same way it would call any other function.

Calling it directly via API Python

import requests

api_token = 'YOUR_APIFY_API_TOKEN'
actor_id = 'techforce.global~linkedin-company-decision-makers'

response = requests.post(
    f'https://api.apify.com/v2/acts/{actor_id}/runs',
    headers={'Authorization': f'Bearer {api_token}'},
    json={'companyName': 'Acme Corp', 'exactMatch': True}
)
dataset_id = response.json()['data']['defaultDatasetId']`

## Using the real-time Standby endpoint Node.js
For agent workflows that need an instant answer rather than waiting on an async run, the Standby mode exposes a live HTTP endpoint:

`const response = await fetch(
  'https://techforce-global--linkedin-company-decision-makers.apify.actor/lookup',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_APIFY_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ companyName: 'Acme Corp' })
  }
);
const decisionMakers = await response.json();
console.log(decisionMakers[0]);
// { name, linkedin_url, title, location, headline }
Enter fullscreen mode Exit fullscreen mode

The Standby endpoint is capped at a small number of free profiles for testing, with a higher limit on paid plans worth checking current limits before building a high-volume real-time integration around it.

Setting up an MCP connector to push results to Notion

  • Go to Apify Account Settings → API & Integrations → MCP connectors

  • Authorise a new connector, selecting Notion Apify provides automatic OAuth setup for Notion, so this is a one-click authorisation, not a manual API key exchange

  • When configuring a run of this actor, select the authorised Notion connector from the picker the actor will push results into the connected Notion database automatically on completion

Output schema reference

Authentication and credential handling

For the MCP client and direct API paths, your Apify API token authenticates the request standard bearer token auth, available from Settings → Integrations in your Apify account. For the connector path specifically, your Notion/Slack/Jira credentials never pass through this actor's code at all Apify's platform holds the authorised connection and injects it server-side at runtime, which is worth knowing if credential handling is something your security team asks about before approving an integration.

Error handling

As with any scraping-based actor, individual lookups can return no results a company with no meaningful LinkedIn presence, or a name specific enough that exact matching finds nothing. Check for an empty result set explicitly in your integration code rather than assuming every lookup returns at least one decision maker.

For the async batch path specifically, poll the run status endpoint until it reports SUCCEEDED before fetching the dataset treating FAILED or ABORTED runs as an explicit case in your code avoids a pipeline silently proceeding with empty or partial data.

Common integration patterns

  • Agent-triggered lookup : an agent calls this as an MCP tool mid-conversation, using the Standby endpoint for a fast response

  • Scheduled enrichment : a batch run against a fixed list of target companies, on a weekly or monthly schedule, pushing results to Notion via connector

  • Event-triggered : a new row in a CRM or spreadsheet triggers a real-time lookup via a webhook-driven automation (n8n, Make, or a custom function)

The scheduled-enrichment pattern is worth a closer look for teams managing an ongoing pipeline rather than a one-time list. Wiring this actor into a weekly n8n or Make workflow trigger, run, fetch results, push to Notion via the connector turns decision-maker research from something someone remembers to do manually into something that simply happens, with the team only reviewing the output rather than generating it.

Frequently asked

Do I need to use the MCP connector, or can I just get a normal dataset?
Both are supported connector output is optional, not required. Skip it entirely and use the standard Apify dataset if you don't need direct third-party delivery.

Can I chain this with other Apify actors in one agent workflow?
Yes, since Apify's MCP server exposes all actors as tools, an agent can call this actor and any other actor (like a contact-enrichment tool) in the same session, chaining outputs together.

What's the rate limit on the Standby endpoint?
This depends on your Apify plan tier check current limits in your account before building a high-frequency real-time integration.

Can I test the connector setup without a real Notion/Slack workspace?
Not directly for the connector delivery itself, since it requires an authorised real connection but you can fully test the actor's data output via the standard dataset API first, then add the connector once you're confident in the data, decoupling the two concerns during development.

Getting started

Full documentation and the interactive input schema:
LinkedIn Decision Makers MCP Connector for Notion & Slack

Top comments (0)