CornerStone MCP x402 Skill (for Agents)
Skill that gives agents tools to call x402-protected MCP endpoints: stock prediction, backtest, bank linking, and agent/borrower scores. Payment is automatic — the skill handles 402 → sign → verify → settle → retry transparently. Supports wallet attestation (signing) for onboarding (POST /attest/aptos, /attest/evm).
Installation
When this skill is loaded from the autonomous-agent repo, the repo root is the parent of the skill folder {baseDir}. Clone and install from the repo root:
git clone https://github.com/FinTechTonic/autonomous-agent.git && cd autonomous-agent
npm install
Copy .env.example to .env and set:
- set
X402_FACILITATOR_URL too
LLM_BASE_URL, HUGGINGFACE_API_KEY or HF_TOKEN, LLM_MODEL – for inference
APTOS_WALLET_PATH, EVM_WALLET_PATH (or EVM_PRIVATE_KEY) – for payments
Quick-start workflow
get_wallet_addresses() – check what wallets exist.
- If empty:
create_aptos_wallet() + create_evm_wallet().
- Fund:
credit_aptos_wallet() + fund_evm_wallet().
- Whitelist addresses at https://arnstein.ch/sse/flow.html.
- Check balances:
balance_aptos(), balance_evm({ chain: "baseSepolia" }).
- Call paid tools:
run_prediction, run_backtest, link_bank_account, or score tools.
Run the skill (demo)
npx cornerstone-agent "Run a 30-day prediction for AAPL"
npx cornerstone-agent
npm run agent -- "..."
node src/run-agent.js "..."
Wallet attestation (signing)
- Aptos:
npm run attest:aptos or npx cornerstone-agent-attest-aptos — output to POST /attest/aptos
- EVM:
npm run attest:evm or npx cornerstone-agent-attest-evm — output to POST /attest/evm
Tool reference
Wallet tools (local)
| Tool |
Args |
Returns |
get_wallet_addresses |
none |
{ aptos: [{ address, network }], evm: [...] } |
create_aptos_wallet |
{ force?, network? } |
{ success, address, network } |
create_evm_wallet |
{ force?, network? } |
{ success, address, network } |
credit_aptos_wallet |
{ amount_octas? } |
devnet: funds directly; testnet: { faucet_url, address } |
fund_evm_wallet |
none |
{ faucet_url, address, message } |
balance_aptos |
none |
{ address, balances: { usdc, apt } } |
balance_evm |
{ chain? } |
{ address, chain, balance, symbol } |
Paid MCP tools (x402 — payment automatic)
| Tool |
Args |
Returns |
Cost |
run_prediction |
{ symbol, horizon? } |
Forecast data |
~6¢ |
run_backtest |
{ symbol, startDate?, endDate?, strategy? } |
Performance metrics |
~6¢ |
link_bank_account |
none |
{ link_token } |
~5¢ |
get_agent_reputation_score |
{ agent_address?, payer_wallet? } |
{ reputation_score } |
~6¢ or credits |
get_borrower_score |
{ agent_address?, payer_wallet? } |
{ score } |
~6¢ or credits |
get_agent_reputation_score_by_email |
{ email, payer_wallet? } |
{ reputation_score } |
higher |
get_borrower_score_by_email |
{ email, payer_wallet? } |
{ score } |
higher |
Whitelist the addresses the agent uses at https://arnstein.ch/sse/flow.html so the server allows those wallets.
1---2name: autonomous-agent-53description: CornerStone MCP x402 skill for agents. Tools for stock predictions, backtests, bank linking, and agent/borrower scores. Payment-protected MCP tools with x402 flow (Aptos + Base). Skill handles 402 → pay → retry. Wallet attestation for onboarding. For marketplaces where agents download and use skills autonomously.4---56# CornerStone MCP x402 Skill (for Agents)78Skill that gives **agents** tools to call x402-protected MCP endpoints: stock prediction, backtest, bank linking, and agent/borrower scores. **Payment is automatic** — the skill handles 402 → sign → verify → settle → retry transparently. Supports **wallet attestation** (signing) for onboarding (POST /attest/aptos, /attest/evm).910## Installation1112When this skill is loaded from the **autonomous-agent** repo, the repo root is the parent of the skill folder `{baseDir}`. Clone and install from the repo root:1314```bash15git clone https://github.com/FinTechTonic/autonomous-agent.git && cd autonomous-agent16npm install17```1819Copy `.env.example` to `.env` and set:2021- set `X402_FACILITATOR_URL` too22- `LLM_BASE_URL`, `HUGGINGFACE_API_KEY` or `HF_TOKEN`, `LLM_MODEL` – for inference23- `APTOS_WALLET_PATH`, `EVM_WALLET_PATH` (or `EVM_PRIVATE_KEY`) – for payments2425## Quick-start workflow26271. `get_wallet_addresses()` – check what wallets exist.282. If empty: `create_aptos_wallet()` + `create_evm_wallet()`.293. Fund: `credit_aptos_wallet()` + `fund_evm_wallet()`.304. Whitelist addresses at https://arnstein.ch/sse/flow.html.315. Check balances: `balance_aptos()`, `balance_evm({ chain: "baseSepolia" })`.326. Call paid tools: `run_prediction`, `run_backtest`, `link_bank_account`, or score tools.3334## Run the skill (demo)3536```bash37npx cornerstone-agent "Run a 30-day prediction for AAPL"38npx cornerstone-agent39npm run agent -- "..."40node src/run-agent.js "..."41```4243## Wallet attestation (signing)4445- Aptos: `npm run attest:aptos` or `npx cornerstone-agent-attest-aptos` — output to POST /attest/aptos46- EVM: `npm run attest:evm` or `npx cornerstone-agent-attest-evm` — output to POST /attest/evm4748## Tool reference4950### Wallet tools (local)51| Tool | Args | Returns |52|------|------|---------|53| `get_wallet_addresses` | none | `{ aptos: [{ address, network }], evm: [...] }` |54| `create_aptos_wallet` | `{ force?, network? }` | `{ success, address, network }` |55| `create_evm_wallet` | `{ force?, network? }` | `{ success, address, network }` |56| `credit_aptos_wallet` | `{ amount_octas? }` | devnet: funds directly; testnet: `{ faucet_url, address }` |57| `fund_evm_wallet` | none | `{ faucet_url, address, message }` |58| `balance_aptos` | none | `{ address, balances: { usdc, apt } }` |59| `balance_evm` | `{ chain? }` | `{ address, chain, balance, symbol }` |6061### Paid MCP tools (x402 — payment automatic)62| Tool | Args | Returns | Cost |63|------|------|---------|------|64| `run_prediction` | `{ symbol, horizon? }` | Forecast data | ~6¢ |65| `run_backtest` | `{ symbol, startDate?, endDate?, strategy? }` | Performance metrics | ~6¢ |66| `link_bank_account` | none | `{ link_token }` | ~5¢ |67| `get_agent_reputation_score` | `{ agent_address?, payer_wallet? }` | `{ reputation_score }` | ~6¢ or credits |68| `get_borrower_score` | `{ agent_address?, payer_wallet? }` | `{ score }` | ~6¢ or credits |69| `get_agent_reputation_score_by_email` | `{ email, payer_wallet? }` | `{ reputation_score }` | higher |70| `get_borrower_score_by_email` | `{ email, payer_wallet? }` | `{ score }` | higher |7172Whitelist the addresses the agent uses at https://arnstein.ch/sse/flow.html so the server allows those wallets.