LinkedIn Lead Sync MCP Server
Official-API LinkedIn tools (no scraping) for the Lead Sync product: the authenticated member's profile, the ad accounts and organizations they administer, Lead Gen Forms, lead submissions, and lead webhook subscriptions.
Standalone bundle. It shares no code with keos-linkedin-memberdata-mcp and runs on its own.
Why this is a separate bundle
LinkedIn does not allow Lead Sync and Member Data Portability to be requested on the same developer app, so the two products need two apps with two client ids. One app, one client id, one token, one MCP server.
This app also has Sign In with LinkedIn using OpenID Connect granted, so its token carries
the profile scopes and this bundle includes linkedin_get_profile. The Member Data app was
denied OIDC, so keos-linkedin-memberdata-mcp has no profile tool at all and reads the
profile record from the PROFILE snapshot domain instead. The two bundles are not symmetric,
and that asymmetry is driven by what LinkedIn approved per app.
This server does not log in. The calling application owns the LinkedIn OAuth flow, user consent, token storage and re-authentication, and passes one access token with every request. The server writes nothing to disk and needs no client id or secret.
Run
uvx keos-linkedin-leadsync-mcp # stdio, from PyPI
uvx --from . keos-linkedin-leadsync-mcp # stdio, from this folder
python -m linkedin_leadsync_mcp # stdio, from source
python -m linkedin_leadsync_mcp --http --port 8765 # streamable HTTP at /mcp
keos-linkedin-leadsync-mcp --http --remote --host 0.0.0.0 --port 8765 # hosted / multi-user
Tools (9)
| Tool | What it does |
|---|---|
linkedin_auth_status() |
Whether a token reached the server, where it came from, and the scopes your app must request. Never returns token values. |
linkedin_get_profile() |
The member's own profile via OpenID Connect — name, email, picture, locale, plus a derived person_urn. |
leadsync_list_ad_accounts() |
Sponsored ad accounts the member can access; supplies owner ids for SPONSORED leads. |
leadsync_list_organizations() |
Company pages the member holds a role on; supplies owner ids for organic leads. |
leadsync_list_lead_forms(owner_urn, count=10, start=0) |
Paged list of Lead Gen Forms for an ad account or organization. |
leadsync_get_lead_form(form_id) |
One form by numeric id. |
leadsync_list_lead_responses(owner_urn, lead_type, test_leads_only, submitted_after_ms, include_form_content) |
Lead submissions with answers, filtered by lead type, test-only flag and submission time. |
leadsync_get_lead_response(response_id) |
A single submission by response id. |
leadsync_list_notifications(owner_urn, lead_type) |
Webhook subscriptions that fire on new leads. |
Token
One token covers every tool here.
| Source | Value |
|---|---|
| HTTP header | Authorization: Bearer <token> |
| Local fallback | LINKEDIN_ACCESS_TOKEN env / .env |
Scopes your application must request on it:
openid profile email
r_marketing_leadgen_automation r_ads r_ads_leadgen_automation r_events r_organization_admin
Your LinkedIn app needs the Lead Sync product approved, and the member needs a role on the ad account or company page whose leads you read.
What the calling application must implement
- Send the user to
https://www.linkedin.com/oauth/v2/authorizationwithresponse_type=code, yourclient_id, aredirect_uriregistered on your LinkedIn app (HTTPS, not localhost, for a hosted app), astatevalue, and the scopes above. - Exchange the returned code at
https://www.linkedin.com/oauth/v2/accessToken. - Store the token per user and send it on every MCP request.
There is no token refresh in this server. LinkedIn access tokens last about 60 days and
refresh tokens are only issued to approved apps, so your application has to track expiry
and re-run consent. A lapsed token surfaces here as HTTP 401.
Configuration
| Key | Purpose |
|---|---|
LINKEDIN_ACCESS_TOKEN |
Local-only token fallback. Ignored with --remote. |
LINKEDIN_ENV_FILE |
Path to the .env file. Defaults to ./.env. |
LINKEDIN_REMOTE_MODE |
1 is equivalent to --remote. |
LEADSYNC_OWNER_TYPE |
Default owner type: sponsoredAccount or organization. |
LEADSYNC_OWNER_ID |
Default numeric owner id, used when owner_urn is omitted. |
LEADSYNC_LEAD_TYPE |
Default lead type. Defaults to SPONSORED. |
LEADSYNC_API_VERSION |
Linkedin-Version header. Defaults to 202610. |
.env is read, never written. Process env overrides .env.
Responses
{ "ok": true, "data": ... } or { "ok": false, "error": "linkedin_error", "message": "..." }.
Remote / hosted mode
keos-linkedin-leadsync-mcp --http --remote --host 0.0.0.0 --port 8765 # or LINKEDIN_REMOTE_MODE=1
Use this whenever more than one user's tokens pass through the server.
- The token comes only from the request header. The env/
.envfallback is refused, so a request without a header errors instead of borrowing another caller's stored credential. --remoterequires--http.- Serve it behind HTTPS and restrict who can reach it (API key or network rules at the proxy). The server has no TLS or authentication of its own.
- If your gateway uses
Authorizationfor its own API key, it will collide with the LinkedIn token. Use a different header for gateway auth, or have the proxy rewrite it.
Without --remote, an --http server falls back to the environment or .env. That is for
local development only; do not expose it to a network.
Scope of the data
Every tool is limited to what the authenticated member can see. Lead submissions are personal data belonging to the people who filled in your forms: store and use them according to your consent and privacy terms.
Metadata
Release files for keos-linkedin-leadsync-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| keos_linkedin_leadsync_mcp-0.1.0.tar.gz | 10.0 kB | Without provenance | Details for keos_linkedin_leadsync_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| keos_linkedin_leadsync_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for keos_linkedin_leadsync_mcp-0.1.0-py3-none-any.whl |
Total release size: 21.3 kB
Release files / keos_linkedin_leadsync_mcp-0.1.0.tar.gz
| Download URL | keos_linkedin_leadsync_mcp-0.1.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f585d5583b8cbbdad920c6034aec3cf8bfd1c162fbbd20960e10d539674279a0
|
|
BLAKE2b-256 checksum How to use checksums |
b7df534127c32c5dba4d76fa085b4bc4eeb30d168e0e2ed5eaee85a077cd4270
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / keos_linkedin_leadsync_mcp-0.1.0-py3-none-any.whl
| Download URL | keos_linkedin_leadsync_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dcf2d48005b3eda0fd8493fe08aa4157cc1377866ec1ef208f674c64e4b217db
|
|
BLAKE2b-256 checksum How to use checksums |
eb27a9333b1277b49d56f54ee0b3e6e0491e1cc424f2d9f2c85cdd83af8aa6c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for keos-linkedin-leadsync-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.