← 返回 CLI 目录
grpcurl
$ grpcurl 社区开源 中风险 FullStory (OSS) · 浏览器与网页抓取 · MIT · macos / linux / windows
grpcurl 允许开发者与编码 Agent 通过服务端反射或 .proto 文件检查 gRPC 服务、枚举方法列表,并使用标准 JSON 输入输出调用一元或流式 RPC。
FCRS-1.0 综合评分
88 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install grpcurl CLI vs MCP 选型建议 仅 CLI 可用
在 Shell 管道中无状态完成 JSON 进/出的 gRPC 调试,无需额外搭建 MCP 桥接。
Agent 友好度体检单
✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
✓ 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
Agent 友好度 23 / 25
原生支持 JSON 请求与响应、自描述 list/describe 反射、-max-time 超时且无 ANSI 颜色噪音。
- JSON input (
-d) and JSON stdout withlist/describeschema introspection
安全与权限边界 21 / 25
list/describe 属于只读元数据查询;具体 RPC 调用是否产生副作用取决于服务端实现。
- TLS enabled by default unless
-plaintextis explicitly passed
安装与运行摩擦 14 / 15
静态 Go 单二进制,可通过 brew、go install、Docker 和 GitHub Releases 获取。
- Cross-platform static binary on macOS, Linux, Windows
能力覆盖与边际价值 14 / 15
无需生成客户端代码即可快速探测和测试 gRPC 接口。
- Supports server reflection,
.proto, and protoset files
维护与来源背书 8 / 10
由 fullstorydev/grpcurl 开源维护(MIT 协议),社区认可度极高。
- Official
fullstorydev/grpcurlGo repository
文档与可验证性 8 / 10
README 示例与 --help 参数说明清晰。
- README covers reflection, TLS, metadata, and proto flags
安全边界、鉴权与放权指南
鉴权方式
无需鉴权 环境变量密钥 本地配置文件
凭证存储位置
支持临时传入 -H "authorization: Bearer ..." 元数据头或 TLS 客户端证书(-cert/-key);不持久化凭据。
潜在副作用
只读查询 远端写入
费用与配额提示
免费开源(MIT 协议)Go 二进制。
可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# grpcurl Agent Rules - Run `list` and `describe` first so method names and Protobuf fields are verified before calling RPCs. - Always pass `-max-time <seconds>` on streaming or remote RPCs and avoid `-plaintext` outside localhost/trusted networks.
Agent 高频安全命令配方
只读查询(安全推荐)
通过服务端反射列出 gRPC 服务
grpcurl -plaintext localhost:50051 list
查询本地开发服务的 gRPC 反射接口以发现已注册的服务。
查看 Protobuf 消息或方法结构
grpcurl -plaintext localhost:50051 describe helloworld.Greeter
在构造请求前打印服务签名与消息字段定义。
受控写入与预演
使用 JSON 载荷调用 gRPC 方法
grpcurl -plaintext -max-time 10 -d '{"name":"agent"}' localhost:50051 helloworld.Greeter/SayHello 在限时保护(-max-time 10)下发起一元 RPC 调用并返回 JSON。
核心优势
- +
list与describe支持通过反射动态发现 Protobuf 结构。 - +
-d输入与 stdout 均使用 JSON,可无缝对接jq。 - + 支持
-max-time与-connect-timeout避免调用长期挂起。
注意事项与踩坑点
- ! 要求目标服务开启反射,或在本地提供
-proto/-protoset定义文件。
已验证兼容的 Agent 宿主
Claude Code Codex CLI Gemini CLI