LinkedIn MCP Server
LinkedIn MCP Server
一个轻量级的 Model Context Protocol (MCP) 服务器,允许兼容 MCP 的 AI 助手向已认证的 LinkedIn 个人资料发布公开文本帖子。
架构
AI Assistant
|
| MCP / stdio
v
LinkedIn MCP Server
|
| HTTPS REST API
v
LinkedInRelated MCP server: LinkedIn MCP Server
MCP 工具
linkedin_create_post
向已认证的 LinkedIn 个人资料发布公开文本帖子。
输入:
{
"text": "Hello from my MCP server 🚀"
}工具在成功时返回 LinkedIn 帖子 ID。
要求
Python 3.11+
一个具有所需 API 权限的 LinkedIn 开发者应用
一个有效的 LinkedIn 访问令牌
已认证作者的 LinkedIn 人员 URN
安装依赖:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt凭据
凭据有意保留在 Git 之外。
在项目根目录创建这些文件:
access_token.txt
person_urn.txtaccess_token.txt 应仅包含 LinkedIn 访问令牌。
person_urn.txt 应包含类似以下的值:
urn:li:person:YOUR_SUBJECT_ID设置严格的权限:
chmod 600 access_token.txt person_urn.txt切勿提交令牌、OAuth 凭据或个人凭据文件。
运行 MCP 服务器
python -m src.linkedin_mcp.server服务器使用 STDIO,因此它会一直保持运行并等待 MCP JSON-RPC 消息。不要将应用程序日志打印到 stdout,因为 stdout 保留给 MCP 协议使用。
MCP Inspector
用于本地开发:
npx @modelcontextprotocol/inspector \
python -m src.linkedin_mcp.server然后连接到 STDIO 服务器,并从 Inspector 调用 linkedin_create_post。
测试
运行:
pytest -q安全说明
机密存储在 Git 忽略的本地文件中。
.env.example仅包含占位符。GitHub 推送保护应保持启用。
如果 LinkedIn 令牌曾经暴露,请立即撤销/轮换它。
作品集描述
一个面向生产的 MCP 服务器,将 LinkedIn 发布功能作为结构化 AI 工具暴露出来,结合了 Model Context Protocol、基于 OAuth 的 LinkedIn 认证、安全的本地凭据处理以及 REST API 集成。
This server cannot be deployed
Maintenance
Related MCP Connectors
Schedule and publish LinkedIn posts to profiles and company pages from AI agents.
Draft LinkedIn posts in your voice, then schedule or publish them through LinkedIn's official API.
- mcpOAuthcom.curviate
LinkedIn actions for AI agents: search, messaging, posts and invites, as hosted MCP tools.
PerfectPost is a LinkedIn content management platform. This MCP server gives AI assistants read and write access to a user's PerfectPost account: published posts with their engagement analytics, drafts lifecycle (create / edit / schedule), and LinkedIn profile data.
Related MCP Servers
- AlicenseBqualityCmaintenanceAllows AI agents to authenticate with LinkedIn and share posts or links via the Model Context Protocol.2115 npmMIT
- AlicenseBqualityDmaintenanceEnables drafting, formatting, analyzing, and publishing LinkedIn posts directly from MCP-compatible clients like Claude.5115 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to publish posts, images, videos, and articles to LinkedIn.10MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to audit professional profiles, check policy compliance, preview posts, and publish explicitly confirmed text posts through LinkedIn's official API.MIT