AEP Integration
When to Use
- User wants to add AEP MCP server to Cursor
- User needs to add AEP skills to OpenClaw
- User asks about execute UserOp, bundler, or integration setup
MCP Setup
Add to your MCP config (e.g., Cursor):
{
"mcpServers": {
"aep": {
"command": "node",
"args": ["<path-to-clone>/packages/mcp/dist/index.js"]
}
}
}
Ensure ~/.aep/config.json has account and rpcUrl. Set AEP_KEYSTORE_ACCOUNT (preferred) or PRIVATE_KEY for set_budget_caps.
Tools: get_balance, get_policy_state, set_budget_caps, resolve_intent, get_analytics, get_credit_score, get_recommendations, fleet_summary, fleet_accounts, fleet_alerts, credit_state, escrow_state, splitter_state, sla_state.
OpenClaw Setup
Install AEP CLI
pnpm add -g @economicagents/cli
Or build from a local clone of the repository:
cd packages/cli && pnpm run build
# Add to PATH or use: pnpm exec aep (from repo root)
Add AEP Skills to OpenClaw
Copy the skill directories to OpenClaw's skills location:
cp -r skills/aep-budget skills/aep-counterparty skills/aep-x402 skills/aep-rate-limit \
skills/aep-relationships skills/aep-deploy skills/aep-monetization skills/aep-integration \
skills/aep-intent-resolution skills/aep-monitor skills/aep-fleet skills/aep-graph skills/aep-indexer \
~/.openclaw/skills/
Or symlink from the AEP repo for each skill.
OpenClaw Config
Ensure ~/.aep/config.json has account and rpcUrl. Set AEP_KEYSTORE_ACCOUNT (preferred) or PRIVATE_KEY for policy updates. OpenClaw will load the skills and use the aep CLI for budget and counterparty management.
Execute UserOp
Requires a bundler RPC URL (e.g., Pimlico, Stackup).
aep execute -t 0xRecipient -v 1000000 -d 0x --bundler https://...
Or via SDK:
import { execute } from "@economicagents/sdk";
const hash = await execute(
[{ to: recipient, value: amount, data: "0x" }],
{ account, privateKey, rpcUrl, bundlerRpcUrl, entryPointAddress }
);
REST API (self-hosted, optional x402)
cd packages/api
pnpm run build
# Without treasury / pricing → no x402 gate on POST /resolve
node dist/index.js
# With x402 paywall on POST /resolve
AEP_TREASURY_ADDRESS=0x... AEP_RESOLVE_PRICE=0.005 node dist/index.js
Intent Resolution
Sync the provider index before using aep resolve or MCP resolve_intent:
aep-index sync [--rpc <url>] [--probe-x402]
From a local clone: cd packages/indexer && pnpm run build && node dist/cli.js sync
Optionally run aep-index embed for semantic capability matching. Index stored at ~/.aep/index/ by default.
Config Validation
Validate config format and paths before operations:
aep config validate
Examples
Example 1: Add AEP MCP to Cursor
Scenario: Add the AEP MCP server to Cursor.
Steps:
- Add MCP config with
command: node,args: [path/to/packages/mcp/dist/index.js] - Ensure
~/.aep/config.jsonhasaccount,rpcUrl,factoryAddress - Set
PRIVATE_KEYfor policy updates
Result: MCP connected; tools get_balance, get_policy_state, set_budget_caps, etc. available.
Example 2: Execute a payment via bundler
Scenario: Send 0.001 ETH to a recipient via UserOp.
Steps:
- Add
bundlerRpcUrlto~/.aep/config.json - Run
aep execute -t 0xRecipient -v 1000000000000000 -d 0x --bundler https://...
Result: UserOp submitted; transaction hash returned.
Troubleshooting
Error: MCP connection refused or "Could not connect"
Cause: MCP server not running or path incorrect.
Solution:
- Verify path:
packages/mcp/dist/index.jsexists (runpnpm run buildin packages/mcp) - Check Cursor Settings > Extensions > MCP for connection status
- Ensure Node.js can execute the path
Error: Config validation fails
Cause: Missing or invalid ~/.aep/config.json.
Solution: Run aep config validate to see specific errors. Required: account, rpcUrl, factoryAddress. Deploy first via aep deploy if no account exists.
Error: set_budget_caps fails
Cause: PRIVATE_KEY not set or signer is not account owner.
Solution: Set PRIVATE_KEY env var. Only the account owner can update policy modules.