俾 Agent 一條網址,自動安裝兩個 MCP

你只需將安裝網站同一個短期一次性 access code 交俾 Agent。Agent 會驗證可信 manifest,再換取兩個分角色 MCP token,自動安裝、驗證,之後先等你叫佢發布。

安裝只需要1 條可信網站 URL1 個 30 分鐘一次性 access code1 個支援的 Agent client
推薦 · URL + one-time code install

交俾 Agent 嘅兩項資料

Code 永不放入 URL 或網站
1

安裝網站https://company-cloudflare-agent-mcp-guide.pages.dev/#install

2

一次性 access code由你獨立交俾 Agent;30 分鐘有效、只可使用一次

複製安裝網站https://company-cloudflare-agent-mcp-guide.pages.dev/#install
  1. 1
    驗證網站與 manifest

    只信任 canonical origin、精確 #install marker、同源 manifest,以及唯一 endpoint pair;canonical HTTPS pair id 必須係 production,唔一致就唔使用 code。

  2. 2
    先準備 owner-private 設定

    偵測一個 client,確保 target 同 backup 可先保護為 0600 或 user-only equivalent;做唔到就唔消耗 code。

  3. 3
    一次 claim、最小 merge、只讀驗證

    由可信 Deployer origin 推導 /agent/claim,換取 Validator ccpv_ + 48 lowercase hex 與 Deployer ccpd_ + 48 lowercase hex token,先驗證格式及角色再各自寫入 matching entry;安裝不授權 upload 或 deploy。

選擇要設定的 Agent

1company-cloudflare-validator只校驗
Endpoint
https://<validator-mcp-host>/mcp
Token 來源
claim 返回的 ccpv_ + 48 lowercase hex Validator token
2company-cloudflare-deployer等確認才發布
Endpoint
https://<deployer-mcp-host>/mcp
Token 來源
claim 返回的 ccpd_ + 48 lowercase hex Deployer token
查看 OpenClaw 設定詳情
設定位置Control UI 的 /settings/mcp,或 openclaw.json
儲存後先執行 openclaw mcp list(不用 --json),再 reload/Restart Gateway,並在新會話呼叫兩個 requirements 工具。
Credential 儲存限制OpenClaw warns about literal sensitive headers and its structured SecretRef surface does not cover claimed MCP headers in this contract; the interim tokens remain in owner-private openclaw.json until native OAuth migration. Protect as 0600-on-posix-or-user-only-equivalent.
JSON5 · OpenClaw
{
  mcp: {
    servers: {
      "company-cloudflare-validator": {
        url: "https://<validator-mcp-host>/mcp",
        transport: "streamable-http",
        headers: { Authorization: "Bearer {{validatorAccessToken}}" },
        requestTimeoutMs: 900000
      },
      "company-cloudflare-deployer": {
        url: "https://<deployer-mcp-host>/mcp",
        transport: "streamable-http",
        headers: { Authorization: "Bearer {{deployerAccessToken}}" },
        requestTimeoutMs: 900000
      }
    }
  }
}
查看 Hermes 設定詳情
設定位置~/.hermes/config.yaml 的 mcp_servers
儲存後先執行 hermes mcp list,再開新會話並呼叫兩個 requirements 工具。
Credential 儲存限制Hermes supports environment substitution, but this zero-dependency interim template keeps claimed tokens in the owner-private YAML; native 0600 mcp-tokens storage applies only to OAuth credentials. Protect as 0600-on-posix-or-user-only-equivalent.
YAML · Hermes
mcp_servers:
  company-cloudflare-validator:
    url: "https://<validator-mcp-host>/mcp"
    headers:
      Authorization: "Bearer {{validatorAccessToken}}"
    timeout: 900
  company-cloudflare-deployer:
    url: "https://<deployer-mcp-host>/mcp"
    headers:
      Authorization: "Bearer {{deployerAccessToken}}"
    timeout: 900
查看 Codex 設定詳情
設定位置Settings → MCP servers,或 ~/.codex/config.toml
儲存後先執行 codex mcp list(不用 --json),Restart Codex,再在新會話呼叫兩個 requirements 工具。
Credential 儲存限制Codex has no documented interface for importing custom claimed bearers into its native OAuth credential store; this interim configuration keeps both role tokens as static headers in the private config.toml. Protect as 0600-on-posix-or-user-only-equivalent.
TOML · Codex
[mcp_servers.company-cloudflare-validator]
url = "https://<validator-mcp-host>/mcp"
http_headers = { Authorization = "Bearer {{validatorAccessToken}}" }
required = true
tool_timeout_sec = 900

[mcp_servers.company-cloudflare-deployer]
url = "https://<deployer-mcp-host>/mcp"
http_headers = { Authorization = "Bearer {{deployerAccessToken}}" }
required = true
tool_timeout_sec = 900
查看 Claude 設定詳情
設定位置Claude Code user scope 的 ~/.claude.json
儲存後先執行 claude mcp list,重新開啟 Claude Code,以 /mcp 檢查狀態,再在新會話呼叫兩個 requirements 工具。
Credential 儲存限制Claude Code stores these custom claimed bearers as static headers in the private user configuration; its secure native OAuth storage is used only by a later client-native OAuth flow. Protect as 0600-on-posix-or-user-only-equivalent.
JSON · Claude
{
  "mcpServers": {
    "company-cloudflare-validator": {
      "type": "http",
      "url": "https://<validator-mcp-host>/mcp",
      "headers": { "Authorization": "Bearer {{validatorAccessToken}}" },
      "timeout": 900000
    },
    "company-cloudflare-deployer": {
      "type": "http",
      "url": "https://<deployer-mcp-host>/mcp",
      "headers": { "Authorization": "Bearer {{deployerAccessToken}}" },
      "timeout": 900000
    }
  }
}

範例沒有真實秘密。 Endpoint 只可來自同源 manifest 唯一可信 pair;{{validatorAccessToken}}{{deployerAccessToken}} 只係分角色 placeholder,由 Agent 寫入 owner-private client config。網站不接收、顯示或交換 access code;只有精確 #install 網址先授權安裝,安裝永不授權發布。

用戶先測試兩個連線

這一步只做 discovery,不上載文件、不建立 deployment。

1
company-cloudflare-validator

必須見到 get_site_requirements

2
company-cloudflare-deployer

必須見到 get_deployment_requirements

Prompt · 無副作用連線測試
請檢查 company-cloudflare-validator 和 company-cloudflare-deployer
兩個 MCP server 是否已連線,列出可用工具名稱。
再只讀呼叫 get_site_requirements 和 get_deployment_requirements,摘要版本、project admission 和下一步。
只讀取資料,不要建立 upload、不要部署、不要顯示任何 token。
兩個都成功才去下一步

少一個、401、403、TLS 或 timeout:停止並把公開 error code 交給管理員。

選擇網站,輸入全新 exact projectName

每次新 upload 都由你提供名稱。Server 以 first-claim 原子保留;如已有人使用,就停止並請你另選。

單一 HTML/proposalUTF-8;包含 doctype 或 html element
Static folder/ZIP最外層直接有 index.html,不多包一層 folder
React/Vue先在可信任本機 build,只交 dist/build 靜態輸出
不支援server、database、API、SSR、Worker、未 build source
Prompt · 選網站並準備計劃
cloudflare-publish

請上傳並檢查我目前選取/開啟的 HTML、proposal 或 static site。
每次新 upload 都先問我 exact projectName;不要猜、不要自動產生、不要自動加 suffix、不要重用已被 reserve/claim 的名稱。
先用兩個 requirements 工具確認 projectAdmission.mode=first-claim。名稱被使用時停止,請我另選 exact projectName。

校驗成功後,用 create_credential_input({projectName}) 取得 credentialRef 和 URL。只接受 origin 精確等於已設定 Deployer endpoint origin、path 精確是 /credential-input/、沒有 query,而且 fragment 只有 projectName、credentialRef、submissionToken 各一個的 URL。叫我只在該頁輸入 username/password;不要在對話詢問、接收、重述或產生它們,也不要讀取或記錄 submissionToken。
用 get_credential_input_status({projectName,credentialRef}) 等到 status=captured 並保存該狀態。之後 readiness 和 plan 只傳 {projectName,receipt,credentialRef};deploy 只額外加入 confirmationId。不可把 raw username/password 傳給任何 MCP 工具。

Credential page、receipt 或確認回應有歧義時,先呼叫 get_deployment_status({projectName})。Status 只判斷 recovery branch,永不返回 receipt。只有明確 STATUS_NOT_FOUND 才可保留 exact 原有 projectName 同 inputRef,重新呼叫 validate_site({projectName,inputRef}),只為同一 finalized first-claim/同一 artifact 更新 receipt;之後建立新 credential input、重新 readiness/plan、顯示改變並重新取得明確確認。SERVICE_UNAVAILABLE、status read failure 或任何其他非明確 STATUS_NOT_FOUND error 都禁止 renewal/建立 credential input;停止,稍後重查 status 或交 operator,絕不可把 error 當成 absence。
若 status 是 nonterminal,只有 exact project/artifact 完全相符,而且 server-authoritative recoveryMode=exact-receipt,才可使用 Agent workflow 自行保留的 original accepted exact signed receipt;禁止 Validator renewal,亦不可向 status 取 receipt。recoveryMode=operator-required、缺失或 invalid 一律停止並交 operator。Stable、mismatched 或 malformed status 同樣停止。任何分支都不可建立新 upload、改 projectName、重新 claim 或更換 credential/artifact。

先用 Validator 校驗文件,再用 Deployer 顯示完整部署計劃。
未經我確認,不要改動 Cloudflare。只有 deploy_proposal 回傳 state=active 時,才由 access 欄位返回最終 URL、Basic Auth username 同 status=captured;永不返回 password。

登入秘密分流:Agent 呼叫 create_credential_input({projectName}) 後,只可叫你在 Deployer 同源的 /credential-input/ 頁面輸入 username/password。Project password 不可重用一次性 access code、任何 claimed MCP token 或其他服務 credential。頁面 URL 不可有 query,fragment 必須只有 projectNamecredentialRefsubmissionToken。Agent 不可在對話詢問或把 raw credential 傳入 MCP。

查看只讀計劃,核對六項資料

plan_deployment 不會改動 Cloudflare。唔清楚就停,不要估。

Project
用戶今次明確輸入;不可猜、改名、加 suffix 或重用
URL
server-derived hostname + /<projectName>/;完整 URL 必須有 trailing slash
Artifact
site kind、file count、size、artifact ID 是今次版本
狀態
currentState/noOp 符合預期
登入保護
credential input status 已獨立 captured;plan credentialState 是 new/unchanged;plan 只顯示 username,永不顯示 password
一致性
source、project、receipt、hostname、publicPath、URL、artifact、credentialRef、captured status、confirmationId 未改變
Agent 正確調用次序
  1. 1get_site_requirements
  2. 2create_input_upload
  3. 3HTTPS PUT(一次性 upload)
  4. 4check_site_readiness
  5. 5validate_site
  6. 6get_deployment_requirements
  7. 7create_credential_input({projectName})
  8. 8用戶只在可信 Deployer 頁面輸入登入資料
  9. 9get_credential_input_status({projectName,credentialRef}) → captured
  10. 10check_deployment_readiness
  11. 11plan_deployment
  12. 12用戶確認
  13. 13deploy_proposal → active

只確認眼前這一份計劃

確認綁定同一個 project、URL、artifact、receipt、credentialRef、captured status、username 同 confirmationId;任何一項變動都要重新計劃。

Prompt · 確認同一份計劃
我已核對以上 project、workers.dev hostname、publicPath、完整 URL、artifact、state、authMode=basic、credentialRef、分開取得的 credential input status=captured、plan credentialState=new/unchanged、username 和 confirmationId。
確認,直接上線這一份計劃。若任何資料已改變,立即停止並重新顯示計劃。

確認不會跳過任何 gate

  • Receipt、artifact digest、project、hostname、publicPath、URL 與 credential 仍要驗證
  • 真實網站只在未登入 401 Basic challenge 通過後才上載
  • Ambiguous recovery 先呼叫 get_deployment_status({projectName});status 只判斷 branch、永不返回 receipt。只有 STATUS_NOT_FOUND 才可用 exact 原 projectName + inputRef 重跑 validate_site
  • SERVICE_UNAVAILABLE/status read failure/任何非明確 STATUS_NOT_FOUND error:禁止 renewal 同 credential input;停止,稍後重查 status 或交 operator
  • Nonterminal 只有 exact project/artifact 相符兼 recoveryMode=exact-receipt,才可用 Agent-retained original accepted receipt;禁止 Validator renewal
  • operator-required、missing 或 invalid recoveryMode:停止並交 operator,禁止 receipt reuse/automated recovery
  • Stable/mismatched/malformed state:停止並交 operator。任何 recovery 都不可建立新 upload、改 projectName、重新 claim 或更換 artifact
  • failed 或 non-retryable:停止並找管理員,不自動 delete/adopt
進階:已知 exact target 才可預先確認

cloudflare-publish now 只省略第二次詢問;仍須完整校驗、readiness、plan 和 Basic Auth gate。資料缺失或有變仍要停止。

只有 Active 才算完成

Upload 成功、receipt、產生 URL 或 pending 都不等於網站已上線。

Project
proposal-project
網址
company-pitch-sites.account-subdomain.workers.dev/proposal-project/
Artifact
html-static · 1 file
登入保護
已啟用 · project-path Basic Auth · captured
State: active

網站已部署並啟用,現在才可以把 URL、username 同 captured status 返回給用戶;永不返回 password。

https://company-pitch-sites.account-subdomain.workers.dev/proposal-project/
Agent 最後回覆發布成功 · State: active · URL: <server-derived-url> · Basic Auth username: <captured-username> · Credential status: captured

照結果判斷,不要叫 Agent 繞過

Happy flow 證明可以繼續;unhappy flow 告訴你何時重試、修正或停止。

1連線

兩個 MCP 都成功列出 requirements 工具

2校驗

一次性 PUT 成功;readiness=ready;validation=valid

3Credential

可信 Deployer 頁面完成;get_credential_input_status=captured;MCP 只用 credentialRef

4計劃

project、URL、artifact、authMode、credentialRef、captured username、confirmationId 一致;不顯示 password

5完成

deploy_proposal 到 active 後回傳 URL、username、captured status,永不返回 password

1401/403

停止;請管理員檢查 endpoint、token mapping 或 Host policy

2VALIDATION_FAILED

修正 HTML/ZIP,再建立新的 upload

3PROJECT_NAME_TAKEN

停止;請用戶提供另一個 exact projectName,不可靜默加 suffix

4credential input 無效

wrong origin/path/fragment 或 project mismatch:停止;pending 繼續等;expired 按 Deployer state recovery;不可在 chat 收 credential

5STATUS_NOT_FOUND

先查 get_deployment_status;只有此結果才可用 exact projectName+inputRef 重跑 validate_site,更新同一 finalized claim/artifact receipt,再建新 credential input、plan、確認

6SERVICE_UNAVAILABLE/status error

不可 renewal 或建立 credential input;停止,稍後重查 get_deployment_status 或交 operator;不可把 error 當成 absence

7confirmationId mismatch

重新 plan,顯示新計劃並再次確認

8matching nonterminal

只有 exact project/artifact + recoveryMode=exact-receipt 可用 Agent-retained receipt;operator-required/missing/invalid 一律停止交 operator

9stable/mismatched/malformed

停止並交 operator;不可 renew receipt、建 credential input、開新 upload 或推斷 deployment state

10failed/內容未登入可見

停止自動化並升級給管理員/security incident

安全 rollback 是獨立管理流程

先只讀規劃,再由用戶選 exact target,最後另行確認;不可沿用 publish 確認。

1只讀規劃

plan_rollback({projectName}) 回傳目前 artifact/deployment state 和已記錄 candidates。

2用戶選擇

逐一顯示 rollbackTargetIdartifactIddeployedAtconfirmationId;即使只有一個都不可自動選。

3獨立確認

並排顯示 exact current 與 exact selected target,取得新的明確 rollback 確認。

4精確執行

只有資料未變才可呼叫 rollback_proposal({projectName,rollbackTargetId,confirmationId});不可省略 target。

Prompt · 安全 rollback
請先只讀呼叫 plan_rollback({projectName})。
完整顯示目前 artifact/deployment state,以及每個已記錄 candidate 的 opaque rollbackTargetId、artifactId、deployedAt、confirmationId。
不可推斷、預設、省略或自動選 rollbackTargetId;即使只有一個 candidate,也要由我選 exact target。
我選擇後,再並排顯示 exact current 與 exact selected target,另行取得明確 rollback 確認。
只有資料完全未變,才可呼叫 rollback_proposal({projectName,rollbackTargetId,confirmationId});任何變動都要重新 plan 同重新確認。