CornerStone MCP x402技能——特工工具
A. 技能 这为代理人提供了一套 x402付费MCP工具:预测股票行情、回溯测试策略、链接银行账户和查询代理/借款人得分。使用此技能的代理人支付 阿普托斯 或 以太坊虚拟机 通过x402主持人。专为代理商可以自主下载和使用该技能的市场而设计;也可用于Cursor、OpenClaw/Moltbot和无头跑步器。
为什么?
代理需要工具,而不是完整的后端。此技能提供 run_预测, run_backtest 运行, link_bank_account,以及 评分工具 (通过电子邮件变体发送get_agent_reputation_score、get_borrower_score)。使用它的特工与 x402 MCP服务器,用自己的Aptos和EVM钱包支付(验证→ 结算),并在最小的设置后获得结果——将代理的地址、资金钱包列入白名单,然后代理可以调用这些工具。服务器提供Aptos和EVM支付选项;技能手柄402→ pay → 请重试,以便代理只调用该工具。
安装
来自npm(推荐)
npm install cornerstone-autonomous-agent复制包裹的 .env.example 进入你的项目并设置 X402_FACILITATOR_URL, HUGGINGFACE_API_KEY, LLM_MODEL和钱包路径。看 配置.
来源
git clone https://github.com/FinTechTonic/autonomous-agent.git && cd autonomous-agent
npm installOpenClaw/Moltbot: 看 适配器/开口爪/SKILL.md 或者使用您平台的技能安装(例如ClawHub)。
快速开始
重要提示: 另一个npm包被命名为 自主的.跑步 这 如果不安装软件包,请始终使用全名: npx cornerstone-autonomous-agent在你之后 npm install cornerstone-autonomous-agent,短二进制 autonomous 在该项目中运行此CLI。
# Run without installing (use full package name so the other "autonomous" package isn’t used)
npx cornerstone-autonomous-agent setup:aptos
npx cornerstone-autonomous-agent setup
npx cornerstone-autonomous-agent addresses
npx cornerstone-autonomous-agent attest:aptos
npx cornerstone-autonomous-agent "Run a 30-day prediction for AAPL"
# Or install first, then you can use the short command in that project
npm install cornerstone-autonomous-agent
npx autonomous setup:aptos
npx autonomous attest:aptos
# Or install globally for the short command everywhere
npm i -g cornerstone-autonomous-agent
autonomous setup:aptos
autonomous "Run a 30-day prediction for AAPL"
# From source:
node src/setup-aptos.js
node src/run-agent.js "Run a 30-day prediction for AAPL"CLI: 此程序包注册了 autonomous 二进制(简称)和 cornerstone-autonomous-agent (与包名称匹配)。使用 npx cornerstone-autonomous-agent 当您尚未安装该软件包时;使用 npx autonomous 只有在一个项目中 cornerstone-autonomous-agent 已安装,或 autonomous 全局安装后。
配置
复制 .env.example 到 .env 并设置:
| 变量 | 描述 | |||
|---|---|---|---|---|
X402_FACILITATOR_URL | 主持人基本URL(Aptos+EVM验证/结算)。使用公共(例如。https://x402-navy.vercel.app/facilitator)完整演示。 | |||
X402_EVM_FACILITATOR_URL | 可选。EVM协调员;默认为X402_FACILITATOR_URL | |||
PREFERRED_PAYMENT_ORDER | 可选。逗号分隔 `network | asset (例如。 aptos:2 | usdc,eip155:84532 | usdc`)当服务器返回多个时,选择付款选项。 |
LLM_BASE_URL | OpenAI兼容的基本URL(默认https://router.huggingface.co/v1) | |||
HUGGINGFACE_API_KEY 或 HF_TOKEN | 拥抱面部API键 | |||
LLM_MODEL | 型号ID(例如元骆驼/llama-3.2-3B-说明书) | |||
APTOS_WALLET_PATH | Aptos钱包JSON路径。多钱包:~/.aptos-agent-wallets.json。 | |||
EVM_WALLET_PATH | EVM钱包路径。多钱包:~/.evm-wallets.json。或者设置EVM_PRIVATE_KEY。 | |||
BASE_SEPOLIA_RPC | 可选;基础Sepolia RPC。Skill支持lib/chains.js中的所有EVM链(Base、以太坊、Polygon等)。 |
命令
使用 npx cornerstone-autonomous-agent (或者在安装了此软件包的项目中, npx autonomous ).来源: node src/.js 或 npm run .
| 命令 | 描述 |
|---|---|
autonomous setup | 生成EVM钱包(单个;用于多用途代理工具create_EVM_wallet) |
autonomous setup:aptos | 生成Aptos钱包(单个;用于多用途create_Aptos_wallet) |
autonomous setup:evm:multichain | 生成EVM多链钱包 |
autonomous addresses | 打印所有Aptos和EVM地址以列入白名单,网址为https://arnstein.ch/flow.html |
autonomous attest:aptos | Aptos钱包签名证明(套 APTOS_PRIVATE_KEY 或 APTOS_TESTNET_*);提交给POST/certain/aptos |
autonomous attest:evm | EVM钱包签名认证;提交给POST/certain/evm |
autonomous balance [chain] | EVM余额 |
autonomous transfer | 传输(有关参数,请参阅脚本) |
autonomous contract | 合同交互助手 |
autonomous swap | 交换助手 |
autonomous 或 autonomous agent 或 autonomous start [message] | 运行技能演示(默认:平衡+预测) |
npm run credit:aptos | Credit Aptos钱包(devnet:程序化;testnet:指令) |
npx cornerstone-agent [message] | 运行技能演示(旧仓位名称) |
MCP工具
| 工具 | 描述 | 付款 |
|---|---|---|
run_prediction | 股票预测(交易品种、水平线) | x402:Aptos或EVM |
run_backtest | 回溯测试交易策略 | x402:Aptos或EVM |
link_bank_account | CornerStone银行链接(格子) | x402:Aptos或EVM |
get_agent_reputation_score | 信誉评分:衡量代理人使用x402 | x402或贷款人信用进行交易的能力 |
get_borrower_score | 借款人评分:衡量真实借款人行为 | x402或贷款人信用 |
get_agent_reputation_score_by_email | 通过电子邮件获得的声誉评分(发送给代理人) | x402或贷方信用 |
get_borrower_score_by_email | 借款人通过电子邮件获得的分数 | x402或贷款人信用 |
分数定义: 信誉评分衡量代理人使用x402进行交易的能力。借款人评分衡量真实的借款人行为。
接受所有付费工具 Aptos和EVM;服务器返回402,其中包含多个选项。使用 PREFERRED_PAYMENT_ORDER 更喜欢一条链/资产。
支持的网络
| 网络 | 使用 |
|---|---|
| Aptos测试网(Aptos:2)/主网(apto:1) | 运行预测、运行备份测试、评分工具 |
| Base Sepolia(eip155:84532)、Base(eip155/8453)、以太坊、多边形、仲裁、乐观 | link_bank_account、评分工具(当服务器提供时) |
x402流量
Agent (using this skill) calls MCP tool
→ Server returns 402 + payment requirements (single or array of options: USDC, APT, native ETH)
→ Skill picks one option (by preferredPaymentOrder or first), builds payload (Aptos or EVM)
→ Skill calls facilitator /verify then /settle
→ Skill retries request with payment_payload
→ Server returns result + payment_receipt多资产: 服务器可能返回多个 paymentRequirements (例如,Aptos上的USDC,EVM上的USDC,Aptos中的APT,EVM中的原生ETH)。客户使用 preferredPaymentOrder (例如。 ["aptos:2|usdc", "eip155:84532|native"])选择,或第一个选项。原生ETH:客户端提交ETH转账,然后发送 txHash 在有效载荷中;主持人在链上进行验证。
建筑
autonomous/
├── src/
│ ├── agent/ # ReAct agent, LLM, tool wiring
│ ├── lib/
│ │ ├── mcp/ # MCP client + 402 handle/retry
│ │ ├── aptos/ # Aptos wallet, balance, signPayment
│ │ ├── evm/ # EVM wallet, signPayment (Base)
│ │ └── x402/ # Payment types, verify/settle flow
│ ├── cli.js # CLI router (autonomous / cornerstone-autonomous-agent)
│ ├── run-agent.js # Skill demo entrypoint (agent + tools)
│ ├── setup.js # EVM wallet generation
│ ├── setup-aptos.js # Aptos wallet generation
│ ├── attest-aptos-wallet.js / attest-evm-wallet.js
│ └── show-agent-addresses.js
├── adapters/ # OpenClaw, OpenAI, Anthropic, local
├── .env.example
└── package.json核心部件: lib/mcp --MCP客户端和402重试; lib/aptos / lib/evm --钱包和支付签名; lib/x402 --核实/结算; agent/ --LangChain.js ReAct运行器和工具(适用于使用该技能的代理)。
技术栈
- 运行时间: Node.js 18+
- 跑步者: LangChain.js(ReAct),OpenAI兼容的LLM(例如Hugging Face)用于演示;代理通过自己的运行时使用这些工具
- MCP: 模型上下文协议 +x402支付流程
- 链: Aptos(viem风格+@Aptos labs/ts sdk),Sepolia/Base的EVM(viem)
- 付款: x402协调员(验证/结算),本地钱包存储
安全
- 钱包: 本地存储(例如。
~/.aptos-agent-wallets.json,~/.evm-wallets.json)对于使用该技能的代理人;私钥未被记录或发送,除非作为签名的有效载荷发送给主持人。 - 付款: 只需向主持人核实/解决;MCP服务器不保管资金。
- 白名单: 在付费工具成功之前,必须在入职流程中分配代理使用的地址。
能力+适配器
- 能力: 核心(
src/)--MCP客户端、x402流、代理工具。代码中没有OpenAI/Claw/Anthropic逻辑。 - 适配器:
adapters/--每个平台或市场如何加载技能:
- 适配器/开口爪/SKILL.md --OpenClaw/Moltbot - 适配器/openai/openapi.yaml --定制GPT/助理 - 适配器/hanthropic/tools.json --克劳德工具 - 适配器/本地/README.md --LM工作室、AutoGen、CrewAI
部署命令
- x402主持人 --使用公共(例如。https://x402-navy.vercel.app/facilitator)完整演示;或者运行local并将link_bank_account的X402_EVM_FACILITATOR_URL设置为public。
- MCP服务器 --x402已启用。
- 技能跑者(演示) —
node src/run-agent.js或PM2(pm2 start ecosystem.config.cjs --only agent-autonomous从repo根目录)。
参考文献
- 食堂应用程序–Aptos x402 --钱包补水和信用
- LangChain.js MCP
- 拥抱面部推理——兼容OpenAI
- evm钱包技能 --代理的自主EVM钱包模式
许可证
仅限GPL-2.0。使用此软件还需遵守 负责任人工智能许可证(RAIL)。参见 许可证.md (GPL-2)和 铁路.
