Skip to content

Give your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.

fix(linkedin): refresh uvx stdio contract

Pnant3df0639dc39d
diff --git a/agent_reach/channels/linkedin.py b/agent_reach/channels/linkedin.py
index 88184286..b3a535e2 100644
--- a/agent_reach/channels/linkedin.py
+++ b/agent_reach/channels/linkedin.py
@@ -1,18 +1,29 @@
# -*- coding: utf-8 -*-
-"""LinkedIn — check if linkedin-scraper-mcp is available."""
+"""LinkedIn — check if mcp-server-linkedin is configured."""
import shutil
from .base import Channel
from .mcporter import McporterConfigError, inspect_mcporter_config
-_LINKEDIN_SERVER_NAMES = {"linkedin", "linkedin-scraper", "linkedin-scraper-mcp"}
+_LINKEDIN_SERVER_NAMES = {
+ "linkedin",
+ "linkedin-scraper",
+ "linkedin-scraper-mcp",
+ "mcp-server-linkedin",
+}
+_LOGIN_COMMAND = "uvx mcp-server-linkedin@latest --login"
+_UV_INSTALL_URL = "https://docs.astral.sh/uv/getting-started/installation/"
+_CONFIG_COMMAND = (
+ "mcporter config add linkedin --command uvx "
+ "--arg mcp-server-linkedin@latest --env UV_HTTP_TIMEOUT=300 --scope home"
+)
class LinkedInChannel(Channel):
name = "linkedin"
description = "LinkedIn 职业社交"
- backends = ["linkedin-scraper-mcp", "Jina Reader"]
+ backends = ["mcp-server-linkedin", "Jina Reader"]
tier = 2
def can_handle(self, url: str) -> bool:
@@ -25,9 +36,9 @@ class LinkedInChannel(Channel):
if not shutil.which("mcporter"):
return "off", (
"基本内容可通过 Jina Reader 读取。完整功能需要:\n"
- " pip install linkedin-scraper-mcp\n"
- " mcporter config add linkedin http://localhost:3000/mcp "
- "--scope home\n"
+ f" 先安装 uv/uvx:{_UV_INSTALL_URL}\n"
+ f" {_LOGIN_COMMAND}\n"
+ f" {_CONFIG_COMMAND}\n"
" 详见 https://github.com/stickerdaniel/linkedin-mcp-server"
)
try:
@@ -35,6 +46,12 @@ class LinkedInChannel(Channel):
except McporterConfigError as exc:
return "error", f"mcporter 配置检查失败:{exc}"
if inspection.server_names & _LINKEDIN_SERVER_NAMES:
+ if not shutil.which("uvx"):
+ return "warn", (
+ "LinkedIn MCP 已写入 mcporter 配置,但 uvx 未安装,"
+ "当前无法启动服务。安装:\n"
+ f" {_UV_INSTALL_URL}"
+ )
return "warn", (
"LinkedIn MCP 已写入 mcporter 配置,但 Doctor 未启动本地"
"服务做连通验证,不能仅凭配置宣称完整可用。"
@@ -46,7 +63,7 @@ class LinkedInChannel(Channel):
)
return "off", (
"mcporter 已装但 LinkedIn MCP 未配置。运行:\n"
- " pip install linkedin-scraper-mcp\n"
- " mcporter config add linkedin http://localhost:3000/mcp "
- "--scope home"
+ f" 先安装 uv/uvx:{_UV_INSTALL_URL}\n"
+ f" {_LOGIN_COMMAND}\n"
+ f" {_CONFIG_COMMAND}"
)
diff --git a/agent_reach/skill/references/career.md b/agent_reach/skill/references/career.md
index f1b46fe7..d67887bc 100644
--- a/agent_reach/skill/references/career.md
+++ b/agent_reach/skill/references/career.md
@@ -6,19 +6,19 @@ LinkedIn。
```bash
# 获取个人资料
-mcporter call 'linkedin-scraper.get_person_profile(linkedin_url: "https://linkedin.com/in/username")'
+mcporter call 'linkedin.get_person_profile(linkedin_username: "username", sections: "experience,education")'
# 搜索人才
-mcporter call 'linkedin-scraper.search_people(keyword: "AI engineer", limit: 10)'
+mcporter call 'linkedin.search_people(keywords: "AI engineer", location: "Shanghai")'
# 获取公司资料
-mcporter call 'linkedin-scraper.get_company_profile(linkedin_url: "https://linkedin.com/company/xxx")'
+mcporter call 'linkedin.get_company_profile(company_name: "openai", sections: "posts,jobs")'
# 搜索职位
-mcporter call 'linkedin-scraper.search_jobs(keyword: "software engineer", limit: 10)'
+mcporter call 'linkedin.search_jobs(keywords: "software engineer", location: "Remote", max_pages: 2)'
```
-> **需要登录**: LinkedIn scraper 需要有效的登录态。
+> **需要登录**: 首次使用前运行 `uvx mcp-server-linkedin@latest --login`,保存有效登录态。
### Fallback 方案
diff --git a/tests/test_skill_command.py b/tests/test_skill_command.py
index 9f1451c4..1bbffcb5 100644
--- a/tests/test_skill_command.py
+++ b/tests/test_skill_command.py
@@ -5,6 +5,7 @@ import importlib.resources
import os
import tempfile
import unittest
+from pathlib import Path
from unittest.mock import patch
from agent_reach.cli import _install_skill, _uninstall_skill
@@ -35,6 +36,61 @@ class TestSkillCommand(unittest.TestCase):
self.assertNotIn("exa.get_code_context_exa", search_reference)
self.assertNotIn("get_code_context_exa(", search_reference)
+ def test_linkedin_reference_uses_current_tool_contract(self):
+ """LinkedIn examples should use the current server and parameters."""
+ career_reference = (
+ importlib.resources.files("agent_reach")
+ .joinpath("skill", "references", "career.md")
+ .read_text(encoding="utf-8")
+ )
+
+ self.assertIn(
+ "linkedin.get_person_profile("
+ 'linkedin_username: "username", '
+ 'sections: "experience,education")',
+ career_reference,
+ )
+ self.assertIn(
+ 'linkedin.search_people(keywords: "AI engineer", '
+ 'location: "Shanghai")',
+ career_reference,
+ )
+ self.assertIn(
+ 'linkedin.get_company_profile(company_name: "openai", '
+ 'sections: "posts,jobs")',
+ career_reference,
+ )
+ self.assertIn(
+ 'linkedin.search_jobs(keywords: "software engineer", '
+ 'location: "Remote", max_pages: 2)',
+ career_reference,
+ )
+ self.assertNotIn("linkedin-scraper.", career_reference)
+
+ def test_linkedin_install_docs_use_current_stdio_contract(self):
+ """LinkedIn install guidance should use uvx over stdio."""
+ install_doc = (
+ Path(__file__).resolve().parents[1] / "docs" / "install.md"
+ ).read_text(encoding="utf-8")
+ linkedin_section = install_doc.split(
+ "**LinkedIn (", maxsplit=1
+ )[1].split("### Step 4:", maxsplit=1)[0]
+
+ self.assertIn(
+ "uvx mcp-server-linkedin@latest --login",
+ linkedin_section,
+ )
+ self.assertIn(
+ "mcporter config add linkedin --command uvx "
+ "--arg mcp-server-linkedin@latest --env UV_HTTP_TIMEOUT=300 "
+ "--scope home",
+ linkedin_section,
+ )
+ self.assertNotIn("linkedin-scraper-mcp", linkedin_section)
+ self.assertNotIn("localhost:3000/mcp", linkedin_section)
+ self.assertNotIn("linkedin-scraper.", linkedin_section)
+ self.assertNotIn("--transport streamable-http", linkedin_section)
+
def test_install_skill_creates_skill_md(self):
"""_install_skill should create SKILL.md in the first available skill dir."""
with tempfile.TemporaryDirectory() as tmpdir: