diff --git a/agent_reach/guides/setup-exa.md b/agent_reach/guides/setup-exa.md index 0dfdc2d5..6a585325 100644 --- a/agent_reach/guides/setup-exa.md +++ b/agent_reach/guides/setup-exa.md @@ -23,7 +23,7 @@ mcporter config add exa https://mcp.exa.ai/mcp --scope home ### 3. 验证 ```bash agent-reach doctor | grep "Search" -mcporter call 'exa.web_search_exa(query: "test", numResults: 1)' +mcporter call exa.web_search_exa query="test" numResults=1 ``` ## 需要用户手动做的步骤 diff --git a/agent_reach/guides/setup-reddit.md b/agent_reach/guides/setup-reddit.md index 376350fb..2b5000c0 100644 --- a/agent_reach/guides/setup-reddit.md +++ b/agent_reach/guides/setup-reddit.md @@ -48,7 +48,7 @@ rdt read POST_ID 如果你已经配置了 Exa(通过 mcporter),也可以通过 Exa 搜索 Reddit 内容: ```bash -mcporter call 'exa.web_search_exa(query: "python best practices", numResults: 5, includeDomains: ["reddit.com"])' +mcporter call exa.web_search_exa query="site:reddit.com python best practices" numResults=5 ``` rdt-cli 是当前推荐方案,无需额外配置即可使用。 diff --git a/agent_reach/skill/SKILL.md b/agent_reach/skill/SKILL.md index e65d4601..5a519c20 100644 --- a/agent_reach/skill/SKILL.md +++ b/agent_reach/skill/SKILL.md @@ -72,7 +72,7 @@ metadata: ```bash # Exa 网页搜索 -mcporter call 'exa.web_search_exa(query: "query", numResults: 5)' +mcporter call exa.web_search_exa query="query" numResults=5 # 通用网页阅读 curl -s "https://r.jina.ai/URL" diff --git a/agent_reach/skill/SKILL_en.md b/agent_reach/skill/SKILL_en.md index e102df1c..6b8b2be7 100644 --- a/agent_reach/skill/SKILL_en.md +++ b/agent_reach/skill/SKILL_en.md @@ -60,7 +60,7 @@ these platforms — do not invent your own approach.** ```bash # Exa web search -mcporter call 'exa.web_search_exa(query: "query", numResults: 5)' +mcporter call exa.web_search_exa query="query" numResults=5 # Read any web page curl -s "https://r.jina.ai/URL" diff --git a/agent_reach/skill/references/career.md b/agent_reach/skill/references/career.md index f1b46fe7..56189df3 100644 --- a/agent_reach/skill/references/career.md +++ b/agent_reach/skill/references/career.md @@ -6,16 +6,16 @@ LinkedIn。 ```bash # 获取个人资料 -mcporter call 'linkedin-scraper.get_person_profile(linkedin_url: "https://linkedin.com/in/username")' +mcporter call linkedin-scraper.get_person_profile linkedin_url="https://linkedin.com/in/username" # 搜索人才 -mcporter call 'linkedin-scraper.search_people(keyword: "AI engineer", limit: 10)' +mcporter call linkedin-scraper.search_people keyword="AI engineer" limit=10 # 获取公司资料 -mcporter call 'linkedin-scraper.get_company_profile(linkedin_url: "https://linkedin.com/company/xxx")' +mcporter call linkedin-scraper.get_company_profile linkedin_url="https://linkedin.com/company/xxx" # 搜索职位 -mcporter call 'linkedin-scraper.search_jobs(keyword: "software engineer", limit: 10)' +mcporter call linkedin-scraper.search_jobs keyword="software engineer" limit=10 ``` > **需要登录**: LinkedIn scraper 需要有效的登录态。 diff --git a/agent_reach/skill/references/search.md b/agent_reach/skill/references/search.md index 4a0fa4c6..1fb02929 100644 --- a/agent_reach/skill/references/search.md +++ b/agent_reach/skill/references/search.md @@ -7,8 +7,8 @@ Exa AI 搜索引擎。 高质量 AI 搜索引擎,擅长技术和代码搜索。 ```bash -mcporter call 'exa.web_search_exa(query: "query", numResults: 5)' -mcporter call 'exa.get_code_context_exa(query: "code question", tokensNum: 3000)' +mcporter call exa.web_search_exa query="query" numResults=5 +mcporter call exa.get_code_context_exa query="code question" tokensNum=3000 ``` ### 使用场景 diff --git a/agent_reach/skill/references/social.md b/agent_reach/skill/references/social.md index fabfcfcb..69e202b9 100644 --- a/agent_reach/skill/references/social.md +++ b/agent_reach/skill/references/social.md @@ -38,13 +38,13 @@ opencli xiaohongshu user USER_ID -f yaml agent-reach configure xhs-cookies "导出的 Cookie Header String" # 只读检查当前状态 -mcporter call 'xiaohongshu.check_login_status()' --timeout 120000 +mcporter call xiaohongshu.check_login_status --timeout 120000 # 搜索 -mcporter call 'xiaohongshu.search_feeds(keyword: "query")' --timeout 120000 +mcporter call xiaohongshu.search_feeds keyword="query" --timeout 120000 # 笔记详情+评论(feed_id 和 xsec_token 从搜索结果取) -mcporter call 'xiaohongshu.get_feed_detail(feed_id: "...", xsec_token: "...")' --timeout 120000 +mcporter call xiaohongshu.get_feed_detail feed_id="..." xsec_token="..." --timeout 120000 ``` > 首次调用会自动下载约 150MB 无头浏览器,务必带 `--timeout 120000`。 diff --git a/agent_reach/skill/references/web.md b/agent_reach/skill/references/web.md index 5977b1c4..877616b9 100644 --- a/agent_reach/skill/references/web.md +++ b/agent_reach/skill/references/web.md @@ -18,13 +18,13 @@ curl -s "https://r.jina.ai/https://example.com/article" ```bash # 读取网页内容 (Markdown 格式) -mcporter call 'web-reader.webReader(url: "https://example.com")' +mcporter call web-reader.webReader url="https://example.com" # 保留图片 -mcporter call 'web-reader.webReader(url: "https://example.com", retain_images: true)' +mcporter call web-reader.webReader url="https://example.com" retain_images=true # 纯文本格式 -mcporter call 'web-reader.webReader(url: "https://example.com", return_format: "text")' +mcporter call web-reader.webReader url="https://example.com" return_format=text ``` **适用场景**: 需要更精确控制输出格式时使用。 diff --git a/docs/install.md b/docs/install.md index 67de80c0..9b587629 100644 --- a/docs/install.md +++ b/docs/install.md @@ -377,10 +377,10 @@ After installation, use upstream tools directly. See SKILL.md for the full comma | Instagram | `opencli` | `opencli instagram user nasa -f yaml` | | GitHub | `gh` | `gh search repos "query"` | | Web | `curl` + Jina | `curl -s "https://r.jina.ai/URL"` | -| Exa Search | `mcporter` | `mcporter call 'exa.web_search_exa(...)'` | +| Exa Search | `mcporter` | `mcporter call exa.web_search_exa query="..." numResults=5` | | 小红书 | `opencli`(服务器 `mcporter`) | `opencli xiaohongshu search "query" -f yaml` | | 小宇宙播客 | `transcribe.sh` | `bash ~/.agent-reach/tools/xiaoyuzhou/transcribe.sh ` | -| LinkedIn | `mcporter` | `mcporter call 'linkedin.get_person_profile(...)'` | +| LinkedIn | `mcporter` | `mcporter call linkedin.get_person_profile linkedin_url="..."` | | RSS | `feedparser` | `python3 -c "import feedparser; ..."` | > 多后端平台以 `agent-reach doctor --json` 的 `active_backend` 为准。 diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index fea4c4c3..c38a9681 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -52,7 +52,7 @@ proxychains twitter search "test" -n 1 twitter-cli 不可用时,可以直接用 Exa 搜索 Twitter 内容: ```bash -mcporter call 'exa.web_search_exa(query: "site:x.com 搜索词", numResults: 5)' +mcporter call exa.web_search_exa query="site:x.com 搜索词" numResults=5 ``` ### 方案 4:检查认证 diff --git a/tests/test_skill_command.py b/tests/test_skill_command.py index 15f1edd2..2e0facea 100644 --- a/tests/test_skill_command.py +++ b/tests/test_skill_command.py @@ -3,8 +3,10 @@ import importlib.resources import os +import re import tempfile import unittest +from pathlib import Path from unittest.mock import patch from agent_reach.cli import _install_skill, _uninstall_skill @@ -23,6 +25,22 @@ def test_skill_resources_include_both_locales(self): self.assertTrue(default_skill.strip()) self.assertTrue(english_skill.strip()) + def test_mcporter_examples_use_shell_safe_named_arguments(self): + """Packaged guidance must avoid function-call syntax that breaks in PowerShell.""" + repo_root = Path(__file__).resolve().parents[1] + markdown_files = [ + *(repo_root / "agent_reach" / "skill").rglob("*.md"), + *(repo_root / "agent_reach" / "guides").rglob("*.md"), + repo_root / "docs" / "install.md", + repo_root / "docs" / "troubleshooting.md", + ] + function_call = re.compile(r"mcporter call\s+['\"][^'\"\r\n]+\(") + + for markdown_file in markdown_files: + with self.subTest(markdown_file=markdown_file): + content = markdown_file.read_text(encoding="utf-8") + self.assertNotRegex(content, function_call) + 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: