mcpField
P
Proof CLI (unofficial)

Proof CLI (unofficial)

本地服务
github.com/tsarlewey法律与政务04 天前更新

关于 Proof CLI (unofficial)

Proof CLI (unofficial) 是面向 Proof API 用户的 Alpha 命令行工具,涵盖 Business、Real Estate 和 SCIM 操作,并可通过内置 MCP 服务以工具形式提供命令。

主要功能

  1. 01Business、Real Estate 和 SCIM API
  2. 02API 密钥与 OAuth 2.0 身份验证
  3. 03JSON 响应与配置命令
  4. 04MCP 只读模式
  5. 05安全事件与证书 API

适用场景

  1. 01管理 Business 交易与文档
  2. 02处理房地产和抵押贷款交易
  3. 03管理 SCIM 用户并查看安全事件

MCP 相关

`proof mcp` 通过 stdio 将 API 命令作为工具提供,并标注只读或破坏性操作。MCP 客户端可使用只读模式。

配置

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

mcp.json · 通用配置
{
"mcpServers": {
"tsarlewey-proof-cli": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PROOF_API_KEY",
"-e",
"PROOF_API_ENDPOINT",
"ghcr.io/tsarlewey/proof-cli:0.4.0"
],
"env": {
"PROOF_API_KEY": "<PROOF_API_KEY>",
"PROOF_API_ENDPOINT": "<PROOF_API_ENDPOINT>"
}
}
}
}
启动命令docker run -i --rm -e PROOF_API_KEY -e PROOF_API_ENDPOINT ghcr.io/tsarlewey/proof-cli:0.4.0
需要配置的环境变量
PROOF_API_KEY密钥Proof API key (https://dev.proof.com/docs/api-keys)
PROOF_API_ENDPOINTAPI base URL. Defaults to production; use https://api.fairfax.proof.com for the sandbox.

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

安装包
ocighcr.io/tsarlewey/proof-cli:0.4.0

工具

还没有获取到工具列表

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

详细介绍

Proof CLI

用于与 Proof API 交互的非官方命令行界面。Proof CLI 通过统一界面提供对 Business、Real Estate 和 SCIM API 的访问。

这是一个 Alpha 产品,请谨慎使用。它不是 Proof 的官方产品。

安装

预构建二进制文件
# macOS / Linux: downloads the latest release for your OS and CPU into the current directory
curl -sL "https://github.com/tsarlewey/proof-cli/releases/latest/download/proof_$(uname -s | tr A-Z a-z)_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz proof
./proof version

Windows 压缩包和校验和可在 Releases 页面获取。

通过 Go 安装
go install github.com/tsarlewey/proof-cli@latest
从源代码构建
git clone https://github.com/tsarlewey/proof-cli.git
cd proof-cli
go build -o proof
./proof --help

与 AI Agent 搭配使用

Claude Code 插件(捆绑了使用技能和 MCP 服务;需要将 proof 添加到 PATH 中):

/plugin marketplace add tsarlewey/proof-cli
/plugin install proof@proof

MCP 服务,适用于任何 MCP 客户端。proof mcp 会将每个 API 命令作为工具通过 stdio 暴露,并标注为只读或具有破坏性:

claude mcp add proof -- proof mcp               # Claude Code
claude mcp add proof -- proof mcp --read-only   # only tools that don't change anything

对于其他客户端,请运行命令 proof mcp。它以与 CLI 相同的方式读取凭据(PROOF_API_KEY 或 proof config)。

Docker,无需在本地安装任何内容。此镜像运行 proof mcp,并以 io.github.tsarlewey/proof-cli 为名称列在 MCP Registry 中:

docker run -i --rm -e PROOF_API_KEY -e PROOF_API_ENDPOINT=https://api.fairfax.proof.com ghcr.io/tsarlewey/proof-cli

镜像名称后的参数会传递给 proof mcp,例如 --read-only。PROOF_API_ENDPOINT 在任何模式下都会覆盖已配置的端点;生产环境中请勿设置此变量。

使用 shell 的 Agent 可以参考 skills/proof/SKILL.md。输出为 JSON(使用 --pretty=false 可获得紧凑格式),API 错误会以响应正文写入 stderr,并以状态码 1 退出。测试时请指向沙盒:proof config set-endpoint https://api.fairfax.proof.com。

入门

1. 配置

使用 CLI 前,需要配置 API 密钥:

# Set your API key
proof config set-api-key YOUR_API_KEY

# Or set via environment variable
export PROOF_API_KEY=YOUR_API_KEY

# Verify your configuration
proof config get

要获取 API 密钥,你需要拥有一个启用了 API 使用权限的账户。请访问此处获取:https://www.proof.com/pricing#business

创建账户并升级后,请访问 https://dev.proof.com/docs/api-keys 设置密钥。

OAuth 2.0 身份验证

CLI 支持 OAuth 2.0 客户端凭据流程,用于安全地进行 API 身份验证:

# Configure OAuth credentials
proof config set-oauth <client-id> <client-secret> [--scope="read write"]

# Test OAuth authentication
proof config test-oauth

# Disable OAuth (fallback to API key)
proof config disable-oauth

OAuth 令牌会在过期前自动刷新(提前 5 分钟)。

2. 基本用法

CLI 分为三个主要 API 组:

  • business - Business API 操作(事务、文档、webhook、公证人等)
  • real-estate - Real Estate/Mortgage API 操作
  • scim - 用于用户管理的 SCIM API 操作
# Get help for any command
proof --help
proof business --help
proof real-estate --help
proof scim --help

API 参考

Business API

Business API 提供全面的事务和文档管理功能。

事务
# List all transactions
proof business transactions list

# List with filtering
proof business transactions list --limit 10 --status completed

# Get a specific transaction
proof business transactions get <transaction-id>

# Create a new transaction
proof business transactions create \
  --email "[email protected]" \
  --first-name "John" \
  --last-name "Doe" \
  --document "/path/to/document.pdf" \
  --name "Contract Signing" \
  --draft

# Multiple documents, scheduled notary meeting, and a redirect
proof business transactions create \
  --email "[email protected]" \
  --document "/path/to/deed.pdf" \
  --document "/path/to/rider.pdf" \
  --notary-meeting-time "2026-09-02T15:30:00Z" \
  --allowed-notary-states "CA,NY" \
  --notary-note "Verify the property address" \
  --payer sender \
  --idv-use-case ACCOUNT_RECOVERY \
  --recipient-details-config "name=locked" \
  --redirect-url "https://example.com/done"

# Multiple signers, from a JSON file holding an array of signer objects
# (max 10, each needs at least an email). --email stays the primary signer.
proof business transactions create \
  --email "[email protected]" \
  --document "/path/to/document.pdf" \
  --signers-file ./signers.json

# Replace a draft transaction (PUT) -- anything you omit reverts to default
proof business transactions update <transaction-id> \
  --name "Contract Signing (revised)" \
  --expiry "2026-09-08T10:00:00Z"

# Change individual fields and leave the rest alone (PATCH)
proof business transactions patch <transaction-id> --expiry "2026-09-15T10:00:00Z"

# Reorder documents already attached to a draft
proof business transactions patch <transaction-id> \
  --document-order "doc_abc123=1" \
  --document-order "doc_def456=2"

# See the full parameter set
proof business transactions create --help

# Activate a draft transaction
proof business transactions activate <transaction-id>

# Delete a transaction
proof business transactions delete <transaction-id>

# Cancel a transaction
proof business transactions cancel <transaction-id>
文档
# Add a document to a transaction
proof business documents add <transaction-id> /path/to/document.pdf \
  --filename "Contract.pdf" \
  --requirement "esign" \
  --esign-required

# Apply a specific template instead of automatic matching
proof business documents add <transaction-id> /path/to/document.pdf --template-id <template-id>

# Get a document
proof business documents get <transaction-id> <document-id>

# Get document as hosted URL (after completion)
proof business documents get <transaction-id> <document-id> --encoding uri

# Delete a document
proof business documents delete <document-id>
Webhook
# List webhooks (v2)
proof business webhooks list

# Get webhook details
proof business webhooks get-v2 <webhook-id>

# Create a webhook
proof business webhooks create \
  --url "https://example.com/webhook" \
  --name "Transaction Updates" \
  --events "transaction.created,transaction.completed"

# Update a webhook
proof business webhooks update <webhook-id> \
  --url "https://new-url.com/webhook"

# Delete a webhook
proof business webhooks delete <webhook-id>

# Get webhook events
proof business webhooks events <webhook-id>

# List available event subscriptions
proof business webhooks subscriptions
公证人
# List notaries
proof business notaries list

# List notaries by state
proof business notaries list --state CA

# Get notary details
proof business notaries get <notary-id>

# Create a notary
proof business notaries create \
  --email "[email protected]" \
  --first-name "Jane" \
  --last-name "Smith" \
  --state "CA"

# Delete a notary
proof business notaries delete <notary-id>
模板
# List document templates
proof business templates list

# List with pagination
proof business templates list --limit 50 --offset 100
成本中心
# List cost centers, then attribute a transaction with --cost-center-id
proof business cost-centers list
proof business transactions create --email [email protected] --cost-center-id <id>
推荐
# Create a referral campaign
proof business referrals create \
  --name "Partner Referrals" \
  --cover-payment \
  --redirect-url "https://example.com/signup"

# Generate a referral code
proof business referrals generate-code <campaign-id> \
  --expires-at "2024-12-31T23:59:59Z"
集成
# Create an Adobe integration
proof business integrations create \
  --name "ADOBE" \
  --org-id "your-org-id" \
  --account-id "adobe-account-id" \
  --environment "production"

# Create a DocuTech integration
proof business integrations create \
  --name "DOCUTECH" \
  --org-id "your-org-id"
Real Estate API

Real Estate API 专注于抵押贷款和房地产事务管理。

事务
# List real estate transactions
proof real-estate transactions list

# List with filtering
proof real-estate transactions list --status "in_progress" --limit 20

# Get transaction details
proof real-estate transactions get <transaction-id>

# Create a transaction
proof real-estate transactions create \
  --type "purchase" \
  --file-number "RE-2024-001" \
  --loan-number "LN-2024-001"

# Place an order for a transaction
proof real-estate transactions place-order <transaction-id>

# Cancel a transaction
proof real-estate transactions cancel <transaction-id>
模板
# List templates
proof real-estate templates list
成本中心
proof real-estate cost-centers list
proof real-estate transactions create --cost-center-id <id>
文档
# List documents
proof real-estate documents list <transaction-id>

# Get document details
proof real-estate documents get <document-id>

# Upload a document
proof real-estate documents upload <transaction-id> /path/to/document.pdf \
  --type "purchase_agreement" \
  --external-id "PA-001"
Webhook
# List real estate webhooks
proof real-estate webhooks list

# Create a webhook
proof real-estate webhooks create "https://example.com/re-webhook" \
  --subscriptions "transaction.created,document.uploaded"
地址验证
# Verify an address
proof real-estate verify-address \
  --line1 "123 Main St" \
  --city "San Francisco" \
  --state "CA" \
  --postal-code "94102"
SCIM API

SCIM API 提供标准化的用户管理功能。

用户
# List users in an organization
proof scim users list <organization-id>

# List with pagination
proof scim users list <organization-id> --start-index 1 --count 25

# Get user details
proof scim users get <organization-id> <user-id>

# Create a user
proof scim users create <organization-id> \
  --username "[email protected]" \
  --given-name "John" \
  --family-name "Doe" \
  --email "[email protected]" \
  --active

# Update a user (full replacement)
proof scim users update <organization-id> <user-id> \
  --username "[email protected]" \
  --given-name "Jane"

# Patch a user (partial update); --operation is repeatable, format op:path[:value]
proof scim users patch <organization-id> <user-id> \
  --operation 'replace:active:false'

# Delete a user
proof scim users delete <organization-id> <user-id>
架构
# Get user schema
proof scim schemas user <organization-id>

# Get service provider configuration
proof scim schemas service-provider-config <organization-id>

# Get resource types
proof scim schemas resource-types <organization-id>
Security Events API

读取组织的 OCSF 格式安全事件日志。

# List recent security events
proof logs list

# Page through results
proof logs list --limit 100
proof logs list --cursor <next_cursor-from-previous-response>

# Filter
proof logs list --since 2026-01-01T00:00:00Z
proof logs list --class-uid 1001 --severity-id 3
Certificates API

签发、使用和撤销组织证书。

# List certificates
proof certificates list --limit 25 --offset 0

# Get one certificate
proof certificates get <certificate-id>

# Issue a certificate with a Proof-generated key
proof certificates create \
  --common-name "Acme Signing Authority" \
  --profile organization_authenticity_al2

# Issue a certificate from your own CSR
proof certificates create-from-csr --csr "$(cat request.pem)"

# Sign base64-encoded SHA256 digests (--digest is repeatable, max 25)
proof certificates sign <certificate-id> --digest "BOGQnhPlcpXqM7fAH6tvFPI4QOXsIyXMiBKtFpblmjU="

# Revoke
proof certificates revoke <certificate-id> --reason "key compromise"
Verifiable Credentials API

向终端用户请求可验证凭证的展示。此端点是 浏览器重定向,而非服务器到服务器的调用——CLI 会打印 URL,供你 发送给终端用户,且不会跟随该 URL。

# Fragment mode: the vp_token comes back on your redirect URI
proof credentials authorize-url \
  --client-id <oauth-client-id> \
  --response-mode fragment \
  --redirect-uri https://app.example.com/callback \
  --scope "openid" \
  --login-hint [email protected] \
  --nonce "$(openssl rand -hex 16)" \
  --state "$(openssl rand -hex 8)"

# direct_post mode: Proof POSTs the vp_token to your response URI
proof credentials authorize-url \
  --client-id <oauth-client-id> \
  --response-mode direct_post \
  --response-uri https://app.example.com/vp \
  --scope "openid" \
  --login-hint [email protected] \
  --nonce "$(openssl rand -hex 16)"

在 fragment 模式下必须提供 --redirect-uri,而在 direct_post 模式下不允许提供;--response-uri 则相反。这两个 URI 都必须在你的 OAuth Application 中注册。

示例

CLI 包含一些示例命令,用于演示常见工作流:

# List all available examples
proof example --help

# Business API examples
proof example business-transactions     # List business transactions
proof example business-notary          # Create a notary

# Real Estate API examples
proof example real-estate-transactions  # List real estate transactions
proof example verify-address           # Verify an address

# SCIM API examples
proof example scim-users <org-id>       # List SCIM users
proof example scim-schema <org-id>      # Get SCIM user schema

配置

CLI 将配置存储在 ~/.proof-cli/ 中:

  • config.json - 主配置文件
  • api_key - API 密钥(权限为 0600)

配置选项:

  • endpoint - API 端点 URL
  • timeout - 请求超时时间,单位为秒
# View current configuration
proof config get

# Set API endpoint
proof config set-endpoint "https://api.proof.com"

# Set request timeout
proof config set-timeout 30

# Set API key
proof config set-api-key "your-api-key"

全局标志

所有命令都支持以下全局标志:

  • --pretty - 美化输出 JSON(默认值:true)
  • --verbose - 显示其他调试输出
  • --help - 显示帮助信息

环境变量

  • PROOF_API_KEY - 用于身份验证的 API 密钥
  • PROOF_ENDPOINT - 覆盖默认 API 端点
  • PROOF_TIMEOUT - 请求超时时间,单位为秒

错误处理

CLI 提供详细的错误消息,并使用标准退出代码:

  • 0 - 成功
  • 1 - 一般错误(API 错误、无效参数等)

开发

从源代码构建
git clone https://github.com/tsarlewey/proof-cli.git
cd proof-cli
go mod download
go build -o proof
Makefile 目标

项目提供了用于常见开发任务的 Makefile:

make build          # Build the ./proof binary
make install        # Install the CLI via go install
make fmt            # Run go fmt
make vet            # Run go vet
make test           # Run all tests
make test-race      # Run all tests with -race
make coverage       # Run tests with coverage profile
make check          # fmt + vet + build + test-race
make clean          # Remove the built binary
make smoke          # Run shell smoke tests against live API
make smoke-go       # Run Go smoke tests (build-tag smoke)
make smoke-write    # Run shell write smoke tests (PROOF_SMOKE_WRITE=1)
make smoke-write-go # Run Go write smoke tests (build-tag smoke_write)
SDK 源码

生成的 Go SDK 客户端现已迁至独立仓库:github.com/tsarlewey/proof-sdk-go。此 CLI 将其作为常规 Go 模块依赖导入。如果上游 OpenAPI 规范发生更改,需要重新生成客户端,请在 SDK 仓库中操作——生成工具链(OpenAPI 规范、oapi-codegen 配置、预处理脚本、make regenerate)已迁至该仓库。

要在此 CLI 中使用新的 SDK 版本:

go get github.com/tsarlewey/proof-sdk-go@<new-version>
go mod tidy
make check
添加或更新命令

CLI 命令位于 cmd/ 中(每个 API 接口一个文件),并使用 Cobra 构建。每个命令的 Run 闭包都会通过 cmd/root.go 中的工厂辅助函数(getBusinessClient、getRealEstateClient、getSCIMClient)调用生成的 SDK 客户端上的方法。这些工厂会使用 common.AuthenticatedDoer(来自 SDK 仓库)封装 SDK 客户端,并在每次请求中注入 OAuth bearer 令牌或 API 密钥。

cmd/root.go 中的共享辅助函数:

  • initializeForAPICall — 延迟初始化客户端,用作每个调用 API 的命令的 PreRun。
  • PrintResponse / PrintVerbose — 输出响应,可选择美化格式并添加颜色。
  • parseDateFlag — 解析可选的日期标志值;解析失败时显示明确消息并退出。
  • isSuccess — 检查状态码是否为 2xx。
  • checkAPIStatus — 每次 SDK 调用后,如果 API 返回非 2xx 响应,则将响应正文输出到 stderr 并以 1 退出。

SDK 调用产生的错误会通过 utils.HandleError(err, "action phrase") 处理传输错误,并通过 checkAPIStatus(resp.StatusCode(), resp.Body, "action phrase") 处理应用级 HTTP 错误。两者都会以 1 退出。

支持

如需反馈问题或请求新功能,请访问 GitHub 仓库。

许可证

评论

支持 Markdown

第一次接触 MCP?

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

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