This is a TypeScript Cloudflare Worker MCP server equivalent of the Python linkedin-mcp server, with OAuth-based auth and matching LinkedIn posting tools.
linkedin_get_profilelinkedin_create_post(single unified post tool: text, mentions, image upload, or video upload)
linkedin_create_post media inputs:
- text-only post: omit
media - media post(s):
media: [{ "type": "IMAGE|VIDEO", "url": "...", "title": "...", "description": "..." }] - mixed image+video in one request is allowed (creates one image post and one video post)
Additional linkedin_create_post parameters:
author_urn(optional): post asurn:li:person:<id>orurn:li:organization:<id>lifecycle_state(optional):PUBLISHEDorDRAFT(defaultPUBLISHED)
Rules:
- If
mediacontains both IMAGE and VIDEO items, the tool creates multiple posts and returns all post IDs.
Mention object shape:
{
"entity_urn": "urn:li:person:...",
"start": 0,
"length": 8,
"entity_type": "member"
}entity_type can be member or company (urn:li:organization:...).
See POSTING_GUIDE.md for mention index math (start/length), payload examples, and troubleshooting.
- MCP API:
/mcp - OAuth authorize:
/authorize - OAuth token:
/token - OAuth client registration:
/register - LinkedIn callback:
/callback
- Install dependencies:
cd linkedin-mcp-cloudflare
npm install- Create KV namespace for OAuth state:
npx wrangler kv namespace create OAUTH_KVCopy the returned ID into wrangler.jsonc under kv_namespaces[0].id.
- Set Worker secrets:
npx wrangler secret put LINKEDIN_CLIENT_ID
npx wrangler secret put LINKEDIN_CLIENT_SECRET
npx wrangler secret put COOKIE_ENCRYPTION_KEYOptional allowlist for MCP OAuth clients:
npx wrangler secret put ALLOWED_MCP_CLIENT_IDS- Configure your LinkedIn app redirect URI:
- Local:
http://localhost:8788/callback - Prod:
https://<worker-name>.<subdomain>.workers.dev/callback
- Run locally:
npm run dev- Deploy:
npm run deployLINKEDIN_VERSION(default202506)RESTLI_PROTOCOL_VERSION(default2.0.0)ENABLE_DEBUG_TOOLS(trueenableslinkedin_get_auth_diagnostics)
- LinkedIn may not always return a refresh token for all app configurations/scopes.
- When no refresh token is available and access token expires, users must re-authenticate.