Getting started
@hoyasumii/linkedin lets you, or an AI agent working for you, create, edit and delete your own LinkedIn
posts: text, images, a video, a document or an article link.
- MCP server (
@hoyasumii/linkedin/mcp, binlinkedin-mcp): six tools over stdio, for Claude Code, Codex, OpenCode or any MCP client. Start at MCP server. - SDK:
createLinkedInClient, typed methods over LinkedIn's Posts, Images, Videos and Documents APIs. It is generated by orval from an OpenAPI spec written for this package. Start at SDK. - CLI (
linkedin): it posts nothing itself.linkedin mcp config --websigns you in to LinkedIn, andlinkedin mcp installregisters the server in your AI clients. Start at CLI.
This is an independent, unofficial client, MIT licensed. It is not affiliated with or endorsed by LinkedIn.
What LinkedIn allows
LinkedIn's API is open to any member's app for writing posts, but not for reading them:
| You want to | Permission | Available to your own app? |
|---|---|---|
| Create, edit (the text) and delete your posts | w_member_social | Yes, from the "Share on LinkedIn" product, granted at once |
| Know who signed in | openid profile | Yes, from "Sign In with LinkedIn using OpenID Connect" |
| Read your posts back | r_member_social | No: LinkedIn has closed it to new apps |
So this package keeps a local list of the posts it created or edited, and that is what its "read" tools show. Posts you make on linkedin.com are not listed. You can still edit or delete them by their URN or URL. See Reading your posts.
Installation
Requires Node.js 20 or later, and a LinkedIn app of your own, which takes five minutes to create: Creating the LinkedIn app.
npm i -g @hoyasumii/linkedin # or: pnpm add -g @hoyasumii/linkedin
linkedin mcp config --web # paste the app's Client ID and Secret, then sign in to LinkedIn
linkedin mcp install # registers linkedin-mcp (stdio) in Claude Code / Codex / OpenCode
Then ask your agent: "Post on LinkedIn that I just released v1.0 of my project, with screenshot.png."
As a library, npm install @hoyasumii/linkedin:
import { createLinkedInClient } from "@hoyasumii/linkedin";
const linkedin = createLinkedInClient({ accessToken: process.env.LINKEDIN_ACCESS_TOKEN! });
const { urn, url } = await linkedin.createPost({ text: "Hello from the API (yes, with parentheses)!" });
await linkedin.editPost(urn, { text: "Hello from the API, edited." });
await linkedin.deletePost(urn);
linkedin docs opens this site.