Pact Tooling

io.github.Pact-Community-Organization由 GitHub 账号 Pact-Community-Organization 发布v0.2.2更新于 Oct 24, 2026

Pact 5 tooling: REPL test runs, trap scanning, gas estimation, interface diff, format checks.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

面向 Kadena 上 Pact 5 智能合约开发的本地 MCP 服务器:运行 REPL 测试、扫描语言陷阱、估算 gas、比对接口并检查格式。

可以做什么
  • 用真实 Pact 解释器运行 REPL 测试文件并汇总失败项
  • 扫描 Pact 模块中的 Pact 5 关键陷阱,如非二元 +、enforce 内的数据库读取、内建名称遮蔽
  • 估算 Pact 代码的 gas
  • 比对两个模块的公开接口,报告新增、删除、变更的函数以及是否为破坏性变更
  • 检查模块格式
适用场景
适合在助手协助编写、测试或审查 Kadena 上的 Pact 5 合约时使用,让它在编辑器内直接执行 REPL 测试、发现语言陷阱、比较模块接口或检查格式。
运行要求
通过 npx 从 npm 包 @pact-community/mcp-pact 以 stdio 在本地运行。需要安装 Pact CLI 并置于 PATH,或用 PACT_COMMUNITY_PACT_BIN 指定其路径。必须设置 PACT_COMMUNITY_WORKSPACE_ROOT,所有文件访问都限制在该目录内。无需节点或账户,未声明认证。
安装前请注意
该服务器会用真实解释器执行 Pact REPL 文件,并读取工作区根目录内的文件,请将工作区指向可信项目。README 声称它从不接触私钥、会剥离工具输出中的提示注入、以 SHA-256 哈希记录调用、不执行 shell 且拒绝以 root 运行,但这些均为提供方自述。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Pact Tooling,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

pact-mcp — MCP servers for Pact & Chainweb

[CI] [npm] [License: Apache-2.0] [Node >= 20.11]

Model Context Protocol servers that give your AI agent safe, auditable access to the Pact 5 development loop on Kadena Chainweb.

Run REPL tests, scan modules for critical language traps, estimate gas, and query or submit to Chainweb nodes — from Claude, Cursor, VS Code, or any MCP-compatible client. Every tool runs behind a strict, tested security baseline, and no tool ever touches a private key.

json
{  "mcpServers": {    "pact": {      "command": "npx",      "args": ["-y", "@pact-community/mcp-pact"],      "env": { "PACT_COMMUNITY_WORKSPACE_ROOT": "/path/to/your/project" }    }  }}

Servers

ServerInstallToolsWhat it does
Pact Tooling — @pact-community/mcp-pact[npm]6REPL test runs, critical-trap scanning, gas estimation, interface diff, format checks
Chainweb API — @pact-community/mcp-chainweb[npm]11/local simulation, pre-signed /send, poll, table reads, SPV proofs, module deploys

Both are listed in the official MCP registry as io.github.Pact-Community-Organization/pact and io.github.Pact-Community-Organization/chainweb.

Install

VS Code (one click)

Using VS Code with GitHub Copilot? Install with a single click:

[Install Pact Tooling in VS Code] [Install Chainweb API in VS Code]

The button opens VS Code and pre-fills the configuration. You can also search the MCP Servers view, or add from the command line:

bash
code --add-mcp '{"name":"pact","command":"npx","args":["-y","@pact-community/mcp-pact"],"env":{"PACT_COMMUNITY_WORKSPACE_ROOT":"${workspaceFolder}","PACT_COMMUNITY_PACT_BIN":"pact"}}'

On VS Code Insiders, use vscode-insiders: in the links or code-insiders on the command line.

Claude Code

bash
claude mcp add pact -e PACT_COMMUNITY_WORKSPACE_ROOT=/path/to/your/project \  -- npx -y @pact-community/mcp-pact

Any MCP client

Add both servers to your client configuration:

json
{  "mcpServers": {    "pact": {      "command": "npx",      "args": ["-y", "@pact-community/mcp-pact"],      "env": {        "PACT_COMMUNITY_WORKSPACE_ROOT": "/path/to/your/project",        "PACT_COMMUNITY_PACT_BIN": "pact"      }    },    "chainweb": {      "command": "npx",      "args": ["-y", "@pact-community/mcp-chainweb"],      "env": {        "PACT_COMMUNITY_WORKSPACE_ROOT": "/path/to/your/project",        "PACT_COMMUNITY_CHAINWEB_MODE": "devnet",        "PACT_COMMUNITY_CHAINWEB_PROFILE": "devnet",        "PACT_COMMUNITY_CHAINWEB_BASE_URL": "http://localhost:8081",        "PACT_COMMUNITY_CHAINWEB_NETWORK_ID": "development"      }    }  }}

Each server's README documents its full tool list and environment variables: Pact Tooling · Chainweb API.

Your first 10 minutes

  1. Install the Pact CLI — Pact Tooling uses it for REPL runs and gas estimation. Download a release from kadena-io/pact-5, put pact on your PATH, and verify with pact --version.
  2. Add the servers to your client with the config above, pointing PACT_COMMUNITY_WORKSPACE_ROOT at your contract project.
  3. Ask your agent:
    • "Scan contracts/token.pact for critical Pact 5 traps" — flags non-binary +, DB reads inside enforce, built-in shadowing, and more.
    • "Run tests/token.repl and summarize the failures" — executes the file with the real Pact interpreter and parses the results.
    • "Diff the public interface of token.pact against token-v2.pact" — reports added/removed/changed functions and whether the change is breaking.
    • "What's the current block height on chain 0?" — queries a Chainweb node.

Everything in Pact Tooling works with just the CLI — no node required. Chainweb API works against any Chainweb-compatible node: point PACT_COMMUNITY_CHAINWEB_BASE_URL at your devnet, or use the read-only testnet06 / mainnet profiles to query public networks.

Security

Both servers enforce the same tested baseline (details in SECURITY.md):

  • No private keys, ever. chainweb_send, chainweb_deploy_module, and chainweb_continue_pact require transactions to be signed externally (Ledger, @kadena/client, …) and passed in pre-signed.
  • Read-only public networks. The testnet06 and mainnet profiles block every write tool with PROFILE_WRITE_BLOCKED.
  • Audit logging of every tool call with SHA-256 input hashes (never raw inputs).
  • Prompt-injection stripping on all tool output before it reaches the model.
  • Tool-schema locking — a server refuses to start if its tool schemas drift.
  • Network and filesystem allowlists, no shell execution, and refusal to run as root.

Compatibility

ServerLocal devnetTestnetMainnet
Pact Tooling✅——
Chainweb API✅✅ read-only✅ read-only

Contributing

bash
git clone https://github.com/Pact-Community-Organization/pact-mcp.gitcd pact-mcppnpm installpnpm buildpnpm test

Requires Node.js >= 20.11 and pnpm >= 9. See CONTRIBUTING.md for workflow, coding standards, and how to add or change a tool.

License

Apache-2.0

来源:README.md,提交 80e2e60

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分