Sign inSign up

hashan0314/linkedin-mcp-server

By hashan0314

•Updated 7 months ago

Minimal Model Context Protocol (MCP) server that speaks JSON-over-stdio for use with Codex CLI.

Image
Machine learning & AI
Developer tools
0

1.4K

hashan0314/linkedin-mcp-server repository overview

⁠LinkedIn MCP Server (Python, stdio)

Minimal Model Context Protocol (MCP) server that speaks JSON-over-stdio for use with Codex CLI. It wraps LinkedIn REST endpoints so an agent can fetch your profile.

You will need a valid LinkedIn OAuth access token with the appropriate scopes. Tokens are not handled here; provide them via env vars.

⁠Features

  • Get profile
  • Get verification report
  • Get userinfo
  • Create text-only post
  • Create reshare post
  • Create image post (register upload, upload binary, publish)
  • Create multi-image post
  • Create article post

⁠Docker

Build and run:

docker build -t linkedin-mcp-server .
docker run --rm -e LINKEDIN_ACCESS_TOKEN="$LINKEDIN_ACCESS_TOKEN" linkedin-mcp-server

Run with an alternate base URL (e.g., sandbox or proxy):

docker run --rm -e LINKEDIN_ACCESS_TOKEN=... -e LINKEDIN_BASE_URL=https://api.linkedin.com linkedin-mcp-server

Public image guidance: Do not bake secrets into the image. Pass creds at runtime via -e or a bind-mounted .env:

docker run --rm --env-file .env linkedin-mcp-server

An example env file is provided in .env.example. Never commit your filled-in .env.

OAuth in Docker (fetch token on start):

docker run --rm \
  -p 8765:8765 \  # expose redirect port
  -e LINKEDIN_CLIENT_ID=... \
  -e LINKEDIN_CLIENT_SECRET=... \
  -e LINKEDIN_REDIRECT_URI=http://127.0.0.1:8765/callback \
  linkedin-mcp-server python -m src.mcp_server --auth

Open the printed URL, approve, and the container will start the MCP server with the token.

⁠Exposed tools

  • get_profile – fetch current profile (identityMe)
  • get_verification_report – fetch verification report
  • get_userinfo – fetch OpenID Connect userinfo profile
  • create_text_post – create a text-only LinkedIn post
  • create_reshare – reshare an existing LinkedIn post
  • initialize_image_upload – register an image upload (returns image URN + upload URL)
  • upload_image_binary – upload a local image file to the upload URL
  • create_image_post – create a post with a single uploaded image
  • create_multi_image_post – create a post with multiple uploaded images
  • create_article_post – create a LinkedIn article post with a link

Tag summary

Content type

Image

Digest

sha256:8bb7fc1c0…

Size

52.1 MB

Last updated

7 months ago

docker pull hashan0314/linkedin-mcp-server