mcpField
H
hermai-cli

hermai-cli

本地服务
github.com/hermai-ai开发工具4810 周前更新

关于 hermai-cli

hermai 是 Hermai 注册中心的开源命令行工具,用于查找、提交和调用网站 API 的结构化 schema。它面向需要让 Agent 访问网站数据或编写 schema 的开发者,并支持带按请求签名的认证写操作。

主要功能

  1. 01查询、拉取和提交网站 API schema
  2. 02hermai action 处理会话与请求签名
  3. 03支持 --dry-run 预览已签名的请求
  4. 04发现工具集,输出 JSON 供后续步骤使用
  5. 05从本地浏览器导入会话 Cookie
  6. 06本地缓存与 doctor 环境检查

适用场景

  1. 01让 Agent 调用网站接口读取数据
  2. 02执行需要登录的写操作,如发布草稿
  3. 03捕获网页写流程并编写 schema 后提交

MCP 相关

该项目是命令行工具而非 MCP 服务,README 未说明与 MCP 的直接关系。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"hermai-ai-hermai-cli": {
"command": "npx",
"args": [
"-y",
"hermai-cli"
]
}
}
}
启动命令npx -y hermai-cli

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmhermai-cli0.3.0

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

hermai-cli

英语 · 繁體中文 · 简体中文

在终端中发现、贡献并调用结构化的网站 API。

hermai 是 Hermai registry 的开源命令行工具(CLI)——这是一个面向 AI Agent 的网站 API 架构社区目录。探测网站以记录其端点,将架构推送到目录,或拉取现有架构并调用它——包括使用逐请求签名进行身份验证的写入操作。

安装
# macOS and Linux via Homebrew
brew install hermai-ai/hermai/hermai

# Anywhere Node is installed (no Go toolchain needed)
npm install -g hermai-cli      # or: npx hermai-cli --help

# Go developers
go install github.com/hermai-ai/hermai-cli/cmd/hermai@latest

# Prebuilt binaries for every OS × arch
# https://github.com/hermai-ai/hermai-cli/releases/latest

已经安装?无需重新运行上述任何命令,即可直接升级:

hermai update

Agent 技能

正在使用 Claude Code、Codex、Cursor 或其他 Agent?安装 Hermai 技能,让 Agent 学会如何使用此 CLI:

npx skills add hermai-ai/hermai-skills --skill hermai

一项技能即可服务这两类用户。用户需要获取某个网站的数据时,Agent 会拉取架构并调用它。用户想要添加新网站时,技能中的贡献者参考资料(通过渐进式披露按需加载)会引导 Agent 完成发现、架构编写和推送。

仓库:hermai-ai/hermai-skills。

将网站作为 API 调用

# Pull a schema (API key required, GitHub sign-in at hermai.ai/dashboard)
hermai registry login
hermai registry pull x.com --intent "drafting a post from my agent"

# Read endpoints: call them directly with curl / fetch / any HTTP client.
# Authenticated writes: `hermai action` handles sessions + signing for you.
hermai action x.com CreateDraftTweet --arg text="drafted by hermai"

hermai action 会加载架构、解析用户会话(从磁盘读取 Cookie,或在首次运行时从已安装的浏览器提取),运行架构声明的引导 JS 以计算会话级状态,运行请求级签名器 JS,再通过具有 Chrome TLS 指纹的 HTTP 客户端发送请求,并在 2xx 响应中轮换 Set-Cookie。无需打开浏览器,即可调用需要逐请求签名的网站(例如 X 的 x-client-transaction-id、TikTok 的 X-Bogus)。

实用标志:

  • --dry-run — 打印完整签名后的请求,不访问网络
  • --schema <file> — 使用本地架构 JSON,而不是注册表缓存
  • --arg key=value — 可重复使用,用于填充架构 URL/正文模板中的 {{var}} 占位符

注册表

hermai registry login                         # GitHub OAuth, stores API key
hermai registry list                          # browse the catalog
hermai registry pull <site> --intent "..."    # download a schema
hermai registry push schema.json              # contribute a schema

发现工具集

用于组合新架构的确定性子命令。无需 LLM 密钥——每个子命令都会输出可供下一步使用的 JSON。

hermai detect <url>                          # platform + anti-bot classification
hermai wellknown <domain>                    # robots, sitemap, RSS, GraphQL
hermai probe --body <url> | hermai extract   # 13 named embedded-data patterns plus
                                             # any <script type="application/json" id="X">
hermai probe --body <pdf-url> | hermai extract --state IL --url <pdf-url> --report-month 2026-02
hermai enforcement --state IL <root-url>     # discover Illinois IDFPR PDFs and emit cited actions
hermai intercept <url>                       # capture XHR in a browser
hermai introspect <graphql-url>              # GraphQL schema
hermai replay request.json                   # replay a captured request
hermai session bootstrap <site>              # warm a fresh browser session
hermai session import <site>                 # import cookies from your current browser
捕获经过身份验证的写入端点

大多数有价值的 API 都需要 Cookie 才能访问。无需再次登录,即可通过结合有头拦截和会话注入来捕获写入流程(添加到购物车、保存草稿、提交评价):

# 1. Pull cookies from the browser you're already signed in with
hermai session import example.com

# 2. Open a visible Chrome, pre-loaded with those cookies, and capture what you click
hermai intercept https://example.com/product/123 \
  --headful --session example.com \
  --timeout 120s --wait 100s --ndjson > capture.ndjson

# 3. Grep/jq the captured JSON for the XHR of interest
grep -F 'CreateOrder' capture.ndjson | jq '.request.body'

请求正文会直接写入架构的 body_template,其中用 {{var}} 占位符表示因用户而异的字段。捕获,不要猜测——凭空编造正文中的字段,是写入架构被拒绝的首要原因。

对于 Shopify Storefront 或 Estée Lauder 的 Stardust 等需要身份验证的 GraphQL 端点,hermai introspect 可接受 --header name=value(可重复使用)。

导入现有浏览器会话

架构需要登录时(发布推文、添加到购物车、回复 RSVP),你可以使用现有的 Chrome、Firefox、Safari、Edge 或 Brave 会话——无需再次登录:

hermai session import x.com
# Reads cookies scoped to x.com from your installed browsers,
# saves them to ~/.hermai/sessions/x.com/cookies.json

首次运行时会出现操作系统级授权提示(macOS Keychain、Windows DPAPI、Linux libsecret)——未经你在操作系统级别明确同意,Hermai 无法读取你的 Cookie。读取范围始终限定为你指定的单个域名;我们绝不会触碰其他网站的 Cookie。

使用 --dry-run 查看 Cookie 名称,不将值写入磁盘:

hermai session import x.com --dry-run

本地缓存

hermai catalog <url>                          # summarize cached endpoints for a URL
hermai schema <url>                           # show the cached schema JSON
hermai cache list                             # list cached domains
hermai init                                   # create ~/.hermai/config.yaml
hermai doctor                                 # verify your setup

运行 hermai --help 查看完整命令列表。

文档

  • 概念与架构规范 — docs.hermai.ai
  • 托管注册表与控制面板 — hermai.ai
  • 技能参考:hermai-ai/hermai-skills — 架构、运行时、CLI、贡献

许可证

AGPL-3.0。将修改后的版本作为托管服务运行,需要公开你的修改。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。