# gtm-api: LinkedIn MCP Server (`gtm-api/linkedin-mcp`) Actor

Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own. Safety enforced server-side: warm-up, daily limits, preview-then-confirm. Bridges to the hosted gtm-api endpoint.

- **URL**: https://apify.com/gtm-api/linkedin-mcp.md
- **Developed by:** [Evgenii Salamatov](https://apify.com/gtm-api) (community)
- **Categories:** Agents, Lead generation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## gtm-api LinkedIn MCP Server

Managed LinkedIn MCP server for AI agents, running as an Apify Actor. It bridges MCP clients to the hosted streamable-http endpoint at `https://mcp.gtm-api.com/mcp`; no server logic runs inside the Actor. Every tool executes on the hosted server, where account safety is enforced: warm-up ramps for fresh accounts, server-side daily limits, preview-then-confirm on outward actions. gtm-api reports 20,000+ LinkedIn accounts running at under 1% monthly ban; the method is written up at [gtm-api.com/safe-linkedin-automation](https://gtm-api.com/safe-linkedin-automation/).

The server exposes three MCP tools (`list_toolsets`, `get_toolset_tools`, `call_tool`) that give an agent progressive access to 160+ typed LinkedIn actions: messaging, connection requests, content, enrichment, search, account health and infrastructure.

### Setup

1. Get an API key at [app.gtm-api.com](https://app.gtm-api.com/login) (7-day trial, no card) and connect a LinkedIn account you own.
2. Start this Actor in **Standby** mode with `gtmApiKey` set in the input, or pass the key per request instead (an `x-gtm-api-key` header, or `?gtm_api_key=...` in the URL).
3. Point your MCP client at the Actor's Standby URL, path `/mcp`, with your Apify token:

```json
{
    "mcpServers": {
        "gtm-api": {
            "url": "https://USERNAME--linkedin-mcp.apify.actor/mcp?token=YOUR_APIFY_TOKEN"
        }
    }
}
```

A normal (non-Standby) run performs a connectivity self-check against the hosted endpoint, writes the result to the dataset, and exits.

### Input

| Field | Required | Meaning |
|---|---|---|
| `gtmApiKey` | no, if passed per request | API key from [app.gtm-api.com](https://app.gtm-api.com/login), sent upstream as an Authorization bearer |
| `upstreamUrl` | no | Endpoint override, defaults to `https://mcp.gtm-api.com/mcp` |

### Prefer a direct connection?

Clients that speak streamable-http do not need this Actor: point them straight at `https://mcp.gtm-api.com/mcp` with an `Authorization: Bearer YOUR_API_KEY` header. Stdio clients can use the npm launcher [`@gtm-api/linkedin-mcp`](https://www.npmjs.com/package/@gtm-api/linkedin-mcp) or the Docker image [`gtmapi/linkedin-mcp`](https://hub.docker.com/r/gtmapi/linkedin-mcp). This Actor exists for teams that keep their agent stack on Apify.

### Links

- What the server does, tool list, safety model: [github.com/gtm-api/linkedin-mcp](https://github.com/gtm-api/linkedin-mcp)
- How a LinkedIn MCP server works: [gtm-api.com/linkedin-mcp-server](https://gtm-api.com/linkedin-mcp-server/)
- API docs: [docs.gtm-api.com](https://docs.gtm-api.com)

# Actor input Schema

## `gtmApiKey` (type: `string`):

API key from <a href='https://app.gtm-api.com/login'>app.gtm-api.com</a> (7-day trial, no card). Sent to the hosted endpoint as an Authorization bearer. Callers can also pass a key per request via the x-gtm-api-key header or the gtm\_api\_key query parameter.

## `upstreamUrl` (type: `string`):

Hosted streamable-http endpoint this Actor bridges to. Leave the default unless gtm-api support tells you otherwise.

## Actor input object example

```json
{
  "upstreamUrl": "https://mcp.gtm-api.com/mcp"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gtm-api/linkedin-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gtm-api/linkedin-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gtm-api/linkedin-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gtm-api/linkedin-mcp"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/jAigSHNZ42alrmn7h/builds/g2x5qHflhpfobDieX/openapi.json
