mcpField
T
Tanilo

Tanilo

本地服务
github.com/TKCollective金融数据32 周前更新

关于 Tanilo

Tanilo MCP 服务将 Tanilo API 的合同价格和支出上限检查提供给 MCP 客户端,供 Agent 在接受报价或提交购买前核验输入的条款或预算。结果可附带签名回执;服务不持有密钥或付款,也不读取实际预算余额。

主要功能

  1. 01比较报价与调用方提供的合同条款
  2. 02按数量计算总价并检查支出上限
  3. 03返回已验证、矛盾或无法判定的结果
  4. 04生成签名检查回执
  5. 05提供 API 状态与发现文档

适用场景

  1. 01接受报价前核对合同单价
  2. 02购买前检查剩余支出上限
  3. 03查看 Tanilo API 状态与可用路由

MCP 相关

该 MCP 服务连接至 https://api.tanilo.io,向客户端提供 check-contract-price、check-spend-cap、check-health 和 get-manifest 工具。

配置

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

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

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

安装包
npmtanilo-mcp3.1.0

工具

3

收录的工具列表 · 更新于 2 周前

参数类型必填说明
offerobject是要检查的报价
offer.skustring否产品或资源标识符,例如 "api.weather.v1"
offer.unitstring是价格适用的单位,例如 "call"
offer.sellerstring否卖方标识符,例如 "seller.example"
offer.currencystring是ISO 4217 代码,例如 "USD"
offer.quantitystring否所提供的数量,以十进制字符串表示,例如 "1"
offer.offered_atstring否报价发出时间,采用 RFC 3339 UTC 格式,例如 "2026-10-01T12:00:00Z"
offer.unit_pricestring是每单位报价,以十进制字符串表示,例如 "2.00"
termsarray是你提供的条款(由调用方提供,未经真实性验证)。可以为空:此时结果为不确定,原因是 no_applicable_term。
agent_idstring否可选的 Agent 标识符,记录在回执中;否则回执中将包含 did:ao:verify-facts:anonymous
claim_hashstring否可选的 subject.claim_hash。可使用任何能为你标识该购买的哈希;默认使用输入对象规范 JSON 的 SHA-256。

详细介绍

Tanilo MCP 服务

一种 MCP 服务,可将 Claude Desktop、Cursor、Windsurf 或任何其他 MCP 客户端连接到 Tanilo API:https://api.tanilo.io。

Tanilo 会在 AI Agent 采取行动前检查前提条件。此服务提供两项检查:合同价格检查和支出上限检查,以及两份状态文档。它调用的路由目前处于免费测试阶段,有速率限制,无需密钥。此服务不保存任何机密信息,也不会进行任何付款。

Tanilo 在 2026 年 9 月之前名为 AgentOracle。版本不高于 2.1.2 的版本以 agentoracle-mcp 发布;该软件包已停止维护。

本 README 介绍的是 3.1.0 版本。以下输出是通过针对实时 API 运行工具获取的:合同价格检查的日期为 2026-10-08,支出上限检查的日期为 2026-10-13。


安装

npx tanilo-mcp
Claude Desktop

打开 Claude Desktop 配置文件:

Mac: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

添加以下内容,然后重启 Claude Desktop:

{
  "mcpServers": {
    "tanilo": {
      "command": "npx",
      "args": ["-y", "tanilo-mcp"]
    }
  }
}

Cursor(Settings → MCP → Add Server)和 Windsurf(Settings → MCP Servers → Add)使用相同的 tanilo 配置块。


工具

check-contract-price

这份报价是否符合你提供的条款?在 Agent 接受报价前,contract_price_match 会将报价的单价与所提供条款中适用的条款进行比较,并在签名成功时为结果签名。

此过程不涉及模型:结果通过算术运算和精确比较得出,任何持有相同输入的人都可以重新计算。条款由你提供;Tanilo 不会保存或查询你的合同。结果有三种:已验证、已驳回,或附带原因的无法确定。已验证表示价格符合所提供的条款。是否付款由你的策略决定。

输入:offer(包含 unit_price、currency、unit,以及可选的 quantity、seller、sku、offered_at)和 terms(一个列表;每项包含 agreement_id、version、currency、unit,以及 price_per_unit 或 tiers,另可包含 seller、product_scope、effective_from、effective_to、supersedes)。价格和数量使用十进制字符串,例如 "2.00"。完整的输入规则、阶梯价格和修订条款说明见 https://tanilo.io/docs/contract-price-check。

该工具会返回检查结果和签名收据。以下是 2026-10-08 从实时 API 获取的文档示例输出(报价为每次调用 USD 2.00,所提供的条款为每次调用 USD 1.00),已精简:

{
  "verdict": "halt",
  "state": "contradicted",
  "outcome": "fail",
  "reason": "price_mismatch",
  "recommendation": "offer price differs from the applicable term among the supplied terms",
  "evidence": {
    "rule_id": "contract-price-match/v0.1",
    "terms_source": "caller_supplied",
    "expected": { "price_per_unit": "1.00", "currency": "USD", "unit": "call" },
    "offered": { "unit_price": "2.00", "currency": "USD", "unit": "call", "quantity": "1" },
    "difference_per_unit": "1.00",
    "offer_is": "above_term_price"
  },
  "check_mode": "deterministic",
  "canonical_sha256": "sha256-…",
  "kid": "tanilo-2026-10-ed25519-7d885da9",
  "jwks_url": "https://tanilo.io/.well-known/jwks.json",
  "receipt": { "payload": "…", "signatures": [ … ] }
}

对于 "terms": [],相同报价会得到 state 为 indeterminate、reason 为 no_applicable_term、verdict 为 halt。

有效签名可以证明哪些密钥为这些字节签名,以及这些字节自签名后未被更改。但它无法证明所提供的条款真实有效。你可以使用 tanilo-receipt-verify,针对 https://tanilo.io/.well-known/jwks.json 中的密钥集离线验证签名:

pip install tanilo-receipt-verify
python3 -c "import json; from tanilo_receipt_verify import verify; r = verify(json.load(open('receipt.json')), jwks_by_issuer={'https://tanilo.io/.well-known/jwks.json': json.load(open('jwks.json'))}); print(r.status, r.canonical_sha256)"

其中,receipt.json 存放工具的 receipt 对象,jwks.json 存放密钥集。

check-spend-cap

此报价是否在你提供的上限内?在 Agent 确认购买之前,spend_cap 会精确地将报价的单价乘以数量,并将总额与你提供的剩余上限进行比较。签名成功时,它会为结果签名。

你需要提供上限和 already_spent。此检查不会检索预算余额、维护实时余额或预留资金。结果有三种:已验证、已否定,或无法判定并附带原因。已验证的结果表示报价总额在剩余上限内。是否付款由你的策略决定。

输入:offer(unit_price、currency,以及可选的 quantity、offered_at、seller、sku)和 cap(amount、currency、scope,取值为 per_purchase 或 per_period;若为 per_period,还需提供 already_spent 和包含 from、to 的 period;cap_id 可选)。claim_hash 和 agent_id 为可选项,格式与 check-contract-price 相同。格式详见文档页面:https://tanilo.io/docs/spend-cap-check。

工具会返回检查结果和签名收据。以下是 2026-10-13 为文档示例实时捕获的内容(三次调用,报价均为 USD 12.50,上限为 USD 100.00,其中已支出 USD 70.00),经删减:

{
  "verdict": "halt",
  "state": "contradicted",
  "outcome": "fail",
  "reason": "cap_exceeded",
  "recommendation": "offer total exceeds the remaining cap the caller supplied",
  "offer_total": "37.50",
  "remaining": "30.00",
  "excess": "7.50",
  "cap_already_exhausted": false,
  "evidence": {
    "rule_id": "spend-cap/v0.1",
    "cap_source": "caller_supplied",
    "offer_total": "37.50",
    "remaining": "30.00",
    "excess": "7.50",
    "cap_already_exhausted": false,
    "offer_sha256": "sha256-…",
    "cap_sha256": "sha256-…",
    "steps": [ … ]
  },
  "check_mode": "deterministic",
  "canonical_sha256": "sha256-…",
  "kid": "tanilo-2026-10-ed25519-7d885da9",
  "jwks_url": "https://tanilo.io/.well-known/jwks.json",
  "receipt": { "payload": "…", "signatures": [ … ] }
}

将 "already_spent": "62.50" 设为此值时,同一报价恰好达到上限:state 为 verified,remaining 为 37.50,excess 为 null,verdict 为 act。

请像验证 check-contract-price 的收据那样,使用你已验证属于 Tanilo 的密钥集来验证收据签名。有效签名可证明签名内容通过所选密钥验证且未被篡改。但它不能证明所提供的上限真实、已获批准或仍然有效,也不能证明该购买已获授权。

check-health

返回 API 的状态文档(GET /health):服务状态、当前路由及其价格、已退役的路由和速率限制。

get-manifest

返回 API 的发现文档(GET /.well-known/x402-manifest.json)。其中不列出任何可付费资源:付费研究路由已于 2026-10-04 退役。


此服务不会做什么

  • 它目前还没有用于 Tanilo 理赔检查的工具(POST /evaluate)。该路由在 Beta 期间免费,可直接调用;请参阅 https://tanilo.io/pricing。
  • 它不会付款、持有钱包或读取任何密钥。早期版本中的 x402 付款代码已移除。
  • 它不会自行验证签名;请按上述方式使用 tanilo-receipt-verify。

开发

npm install
npm run build
npm test          # starts the built server over stdio and calls the live API (free beta route)

将 TANILO_PYTHON 设置为已安装 tanilo-receipt-verify 的 Python;测试也会离线验证返回收据的签名。将 TANILO_API_BASE 设置为其他主机,以便让服务连接到该主机(仅用于测试)。


链接

联系:[email protected]

采用 MIT 许可证。TK Collective LLC。

评论

支持 Markdown

第一次接触 MCP?

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

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