@buildaureon/mcp 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,468 @@
1
+ # AUREON MCP Agent Guide
2
+
3
+ Playbooks for AI agents using `@buildaureon/mcp` against the **live** AUREON API.
4
+
5
+ This guide teaches agents how to think, which tools to call, and how to talk honestly about settlement. Pair it with the [tool reference](./tools.md). For typed contracts and error codes, see the **@buildaureon/sdk documentation**.
6
+
7
+ **Surface:** 34 tools · issued API key · optional Bearer · private key only outside MCP for broadcast.
8
+
9
+ ---
10
+
11
+ ## How agents should think
12
+
13
+ Use a simple loop on every non-trivial request:
14
+
15
+ **Read → Decide → Act.**
16
+
17
+ ### 1. Read
18
+
19
+ Gather facts before proposing mutations.
20
+
21
+ Typical read set:
22
+
23
+ - `aureon_ping` — is the live API up?
24
+ - `aureon_me` — which wallet am I acting as?
25
+ - `aureon_sync_portfolio` + `aureon_get_portfolio` — what does the Capital Book say?
26
+ - `aureon_get_vault_status` — can Automatic restores actually fund?
27
+ - `aureon_list_objectives` + `aureon_get_health` — what policy exists and is it breached?
28
+
29
+ ### 2. Decide
30
+
31
+ Translate operator intent into a **single** next action (or a short sequenced plan).
32
+
33
+ Decide:
34
+
35
+ - Do we need funding first (prepare deposit → host signs)?
36
+ - Do we create a new Automatic objective?
37
+ - Do we restore an existing breach?
38
+ - Is this only a rehearsal (market event)?
39
+
40
+ Prefer **Automatic** (`automationMode: "auto"`) for agents. Manual mode is for humans who must Approve in the utility.
41
+
42
+ ### 3. Act
43
+
44
+ Call the write / prepare / restore tool. Then **read again** to confirm.
45
+
46
+ Never claim success from prepare alone. Never claim on-chain settlement unless the receipt says `settlement: "vault"`.
47
+
48
+ ---
49
+
50
+ ## Trust boundary (memorize this)
51
+
52
+ | Credential | Role |
53
+ | --- | --- |
54
+ | Issued `AUREON_API_KEY` | Product access + wallet identity for control-plane tools |
55
+ | Optional Bearer | Wallet session via nonce → sign → `aureon_verify_wallet` (wins if both present) |
56
+ | Private key | **Outside MCP only** — host signs unsigned vault steps |
57
+
58
+ The MCP server is not a custodian and not a broadcaster. `prepare_*` returns unsigned steps.
59
+
60
+ ---
61
+
62
+ ## Locked fields and defaults
63
+
64
+ | Field | Rule |
65
+ | --- | --- |
66
+ | `automationMode` | Defaults to **`auto`** on create. Locked after create. |
67
+ | `targetSymbol` | Locked after create. Recreate to change the token. |
68
+ | Update patch | Name, weight, tolerance, priority (and related numeric fields) — **not** symbol/mode. |
69
+
70
+ Agents: create Automatic objectives unless the human explicitly asks for Manual.
71
+
72
+ ---
73
+
74
+ ## Settlement types
75
+
76
+ Restore and execution receipts may include:
77
+
78
+ | Value | Meaning | How to describe it |
79
+ | --- | --- | --- |
80
+ | `vault` | On-chain / vault-backed settlement | “Settled on-chain via vault.” |
81
+ | `staged` | Ledger-local / staged settlement | “Staged (not on-chain).” |
82
+
83
+ **Honesty rule:** If the field is missing or unclear, say so. Do not upgrade `staged` to “on-chain” in chat.
84
+
85
+ ---
86
+
87
+ ## Recommended workflows
88
+
89
+ ### A. Morning check
90
+
91
+ Goal: identity, book, vault readiness, health — no surprise mutations.
92
+
93
+ ```text
94
+ aureon_ping
95
+ aureon_me
96
+ aureon_sync_portfolio
97
+ aureon_get_portfolio
98
+ aureon_get_vault_status
99
+ aureon_get_overview
100
+ aureon_list_objectives
101
+ aureon_refresh_watchdog
102
+ aureon_get_health
103
+ ```
104
+
105
+ **Agent summary checklist**
106
+
107
+ - Wallet address
108
+ - Whether vault looks fundable / ready
109
+ - Objective count and any breaches
110
+ - One recommended next action (fund, restore, or none)
111
+
112
+ ### B. Create an Automatic objective
113
+
114
+ Example intent: maintain ~15% WETH with 3% tolerance.
115
+
116
+ **Read first**
117
+
118
+ ```text
119
+ aureon_me
120
+ aureon_sync_portfolio
121
+ aureon_get_vault_status
122
+ aureon_list_objectives
123
+ ```
124
+
125
+ **Act**
126
+
127
+ ```text
128
+ aureon_create_objective
129
+ name: "Maintain 15% WETH"
130
+ kind: balanced_portfolio
131
+ targetWeight: 0.15
132
+ tolerance: 0.03
133
+ targetSymbol: WETH
134
+ automationMode: auto
135
+ priority: medium
136
+ ```
137
+
138
+ **Confirm**
139
+
140
+ ```text
141
+ aureon_get_objective
142
+ aureon_get_health
143
+ ```
144
+
145
+ Remind the operator that `targetSymbol` and `automationMode` are locked.
146
+
147
+ ### C. Restore drift
148
+
149
+ ```text
150
+ aureon_refresh_watchdog
151
+ aureon_get_health
152
+ aureon_get_restore_plan # when breached — explain steps
153
+ aureon_restore_objective
154
+ aureon_list_timeline
155
+ aureon_list_executions
156
+ aureon_get_health # post-check
157
+ ```
158
+
159
+ **Agent summary checklist**
160
+
161
+ - Pre-health vs post-health
162
+ - Plan kind (e.g. vault swap / wrap)
163
+ - Receipt `settlement` (`vault` vs `staged`)
164
+ - Timeline events confirming the restore
165
+
166
+ If vault status says funding is insufficient, stop and switch to the deposit workflow.
167
+
168
+ ### D. Vault deposit (prepare + host signs)
169
+
170
+ ```text
171
+ aureon_get_vault_status
172
+ aureon_prepare_vault_deposit
173
+ symbol: ETH
174
+ amount: "0.1"
175
+ → host signs & broadcasts unsigned steps (private key outside MCP)
176
+ → wait for confirmation
177
+ aureon_sync_portfolio
178
+ aureon_get_vault_status
179
+ aureon_get_vault
180
+ ```
181
+
182
+ **Agent language**
183
+
184
+ - After prepare: “Here are unsigned steps. Sign and broadcast in your wallet. I cannot move funds with the API key alone.”
185
+ - After sync: report vault readiness. Do not invent tx hashes the host did not provide.
186
+
187
+ ### E. Market rehearsal (integration only)
188
+
189
+ ```text
190
+ aureon_list_market_presets
191
+ aureon_apply_market_event
192
+ symbol: TSLA
193
+ priceChangeRatio: -0.1
194
+ aureon_refresh_watchdog
195
+ aureon_get_health
196
+ # optional: restore_plan → restore_objective if rehearsing the full loop
197
+ ```
198
+
199
+ Do **not** treat rehearsal shocks as live oracle prices for production capital decisions.
200
+
201
+ ### F. Pause / resume / soft update
202
+
203
+ ```text
204
+ aureon_pause_objective
205
+ aureon_resume_objective
206
+ aureon_update_objective # name, weight, tolerance, priority only
207
+ ```
208
+
209
+ To change token or auto/manual mode: create a new objective; pause or leave the old one.
210
+
211
+ ### G. API key hygiene
212
+
213
+ ```text
214
+ aureon_list_api_keys
215
+ aureon_create_api_key # secret once — store in host env
216
+ aureon_toggle_api_key # pause without revoke
217
+ aureon_revoke_api_key
218
+ ```
219
+
220
+ Never paste full secrets into public transcripts if the host displays tool output broadly.
221
+
222
+ ---
223
+
224
+ ## Prompt examples
225
+
226
+ ### System prompt fragment (paste-ready)
227
+
228
+ ```text
229
+ You have AUREON MCP tools against the live API.
230
+ Prefer aureon_ping / aureon_me / aureon_sync_portfolio before mutations.
231
+ Use automationMode auto unless the user explicitly asks for manual.
232
+ Never claim on-chain settlement unless the restore receipt says settlement=vault.
233
+ Never ask the user for a private key; for deposits call prepare tools and tell them
234
+ to sign the returned steps in their wallet.
235
+ targetSymbol and automationMode are immutable after create — recreate instead of update.
236
+ Follow read → decide → act. Confirm with a second read after writes.
237
+ ```
238
+
239
+ ### Operator prompts that work well
240
+
241
+ > Ping AUREON and show which wallet my issued key is bound to.
242
+
243
+ > Sync my portfolio, check vault status, and summarize whether Automatic restores can run.
244
+
245
+ > Create an Automatic objective to keep about 20% WETH with 2% tolerance. Confirm locks.
246
+
247
+ > Health looks off — show the restore plan for objective `<id>`, then restore if the plan is sensible. Report settlement type.
248
+
249
+ > Prepare a 0.05 ETH vault deposit. Do not try to broadcast. Tell me exactly what I must sign.
250
+
251
+ > Rehearse a −10% TSLA mark event, refresh watchdog, and report which objectives breached.
252
+
253
+ ### Operator prompts to clarify before acting
254
+
255
+ > “Fix my portfolio.” → Ask which objective, whether to restore vs recreate, and whether the vault is funded.
256
+
257
+ > “Make it manual.” → Confirm they want Manual Approve (human UI). Prefer staying Automatic for agent loops.
258
+
259
+ > “Deposit 1 ETH.” → Clarify prepare-only vs they will sign; never imply MCP will broadcast.
260
+
261
+ ---
262
+
263
+ ## Anti-patterns
264
+
265
+ Avoid these failure modes.
266
+
267
+ | Anti-pattern | Why it hurts | Do this instead |
268
+ | --- | --- | --- |
269
+ | Write before read | Acts on stale identity / vault / health | Always ping / me / sync / vault status first |
270
+ | Creating Manual by default | Agents cannot Approve in the utility | Default `automationMode: auto` |
271
+ | Patching `targetSymbol` or mode | API rejects; wastes turns | Recreate the objective |
272
+ | Treating prepare as funded | Balances unchanged until broadcast | Tell host to sign; then sync |
273
+ | Spamming restore | Flapping health, noisy timeline | Re-read health; restore once; confirm |
274
+ | Calling market events “live prices” | Misleads capital decisions | Label as rehearsal |
275
+ | Claiming `staged` as on-chain | Breaks trust | Quote `settlement` literally |
276
+ | Asking for private keys | Violates the trust model | Prepare tools + host wallet only |
277
+ | Clearing portfolio casually | Destructive book wipe | Confirm; prefer sync |
278
+ | Rotating keys into chat | Secret leakage | Create key; instruct secure env storage |
279
+
280
+ ---
281
+
282
+ ## Automatic-only guidance for agents
283
+
284
+ Agents operate best as **keepers with Automatic objectives**:
285
+
286
+ 1. Ensure vault funding (prepare → host signs → sync).
287
+ 2. Create objectives with `automationMode: "auto"`.
288
+ 3. Watch health via `aureon_refresh_watchdog` / `aureon_get_health`.
289
+ 4. On breach: plan → `aureon_restore_objective` → confirm timeline / executions.
290
+
291
+ Manual mode remains available for humans who want Approve gates. If the operator insists on Manual, say clearly that agent-driven restores may be limited and the utility Approve surface is the control plane for those swaps.
292
+
293
+ ---
294
+
295
+ ## Error handling tips
296
+
297
+ | Symptom | Likely cause | Agent action |
298
+ | --- | --- | --- |
299
+ | 401 / invalid key | Bad or revoked issued key | Stop. Ask operator to rotate in Developers and update host env. |
300
+ | Wallet session required / env key cannot identify wallet | Non-issued gating key | Switch to an **issued** Developers key. |
301
+ | Vault empty / cannot restore | No funding for Automatic path | Prepare deposit; wait for broadcast; re-sync; re-check status. |
302
+ | Update rejects symbol / mode | Immutable create fields | Explain lock; offer recreate + pause old. |
303
+ | Restore flaps / healthy immediately | Marks shifted or race | Re-read health + vault; avoid spam restores. |
304
+ | Prepare succeeds, balances unchanged | Broadcast never happened | Remind: unsigned steps need host signature. |
305
+ | Invite / early-access errors on verify | Wallet not invited | Use issued key path or complete invite on first Bearer login. |
306
+ | Ambiguous settlement | Receipt missing or staged | Report exactly what the receipt says. |
307
+
308
+ ### Retry discipline
309
+
310
+ - Retry **reads** after transient network errors.
311
+ - Do not blindly retry **restores** or **clears**.
312
+ - After a failed write, re-read state before a second attempt.
313
+ - After prepare, do not call prepare in a loop hoping balances change — wait for the host.
314
+
315
+ ---
316
+
317
+ ## FAQ
318
+
319
+ ### Do I need a Bearer token every day?
320
+
321
+ No. An issued API key is enough for control-plane agent work. Bearer is optional.
322
+
323
+ ### Can the MCP server sign deposits?
324
+
325
+ No. Prepare tools return unsigned steps. Private keys stay outside MCP.
326
+
327
+ ### Why is my restore `staged`?
328
+
329
+ Staged means ledger-local settlement for that receipt. Fund the vault and use Automatic restore paths when you need `settlement: "vault"`. Always label honestly.
330
+
331
+ ### Can I change `targetSymbol` later?
332
+
333
+ No. Recreate the objective. Optionally pause the old one.
334
+
335
+ ### What is the default automation mode?
336
+
337
+ `auto`. Agents should keep it that way unless the human requests Manual.
338
+
339
+ ### Is market event a production price feed?
340
+
341
+ No. It is for integration rehearsal and demos.
342
+
343
+ ### How many tools are there?
344
+
345
+ **34.** See the [tool reference](./tools.md).
346
+
347
+ ### Where are the typed schemas?
348
+
349
+ In the **@buildaureon/sdk documentation** (client API, data contracts, error model).
350
+
351
+ ### What URL should agents use?
352
+
353
+ The live API: `https://api.aureonlabs.network`.
354
+
355
+ ### What if the operator asks me to “just send the transaction”?
356
+
357
+ Refuse to take a private key. Call `aureon_prepare_vault_deposit` or `aureon_prepare_vault_withdraw`, return the unsigned steps, and instruct the host wallet to sign and broadcast.
358
+
359
+ ---
360
+
361
+ ## Suggested turn templates
362
+
363
+ ### Template: status report
364
+
365
+ 1. Ping + me
366
+ 2. Sync portfolio + vault status
367
+ 3. Overview + health
368
+ 4. Three-bullet summary + one recommended action
369
+
370
+ ### Template: create policy
371
+
372
+ 1. Confirm wallet + vault readiness
373
+ 2. Create Automatic objective with explicit weight/tolerance/symbol
374
+ 3. Fetch objective + health
375
+ 4. State locks (`targetSymbol`, `automationMode`)
376
+
377
+ ### Template: heal breach
378
+
379
+ 1. Refresh watchdog + health
380
+ 2. Get restore plan; narrate steps briefly
381
+ 3. Restore
382
+ 4. List executions/timeline; quote `settlement`
383
+ 5. Re-check health
384
+
385
+ ### Template: fund vault
386
+
387
+ 1. Vault status
388
+ 2. Prepare deposit
389
+ 3. Hand unsigned steps to operator
390
+ 4. After they confirm broadcast: sync + vault status
391
+
392
+ ---
393
+
394
+ ## Coordination with humans
395
+
396
+ Agents should be explicit about what only a human can do:
397
+
398
+ - Sign and broadcast vault steps
399
+ - Approve Manual restores in the utility
400
+ - Create / rotate issued API keys in a secure secret store
401
+ - Decide risk appetite (weights, tolerances, which symbols)
402
+
403
+ Agents should be decisive about what they can do alone with an issued key:
404
+
405
+ - Sync and inspect book / vault / health
406
+ - Create Automatic objectives
407
+ - Fetch plans and run restores
408
+ - Rehearse market events
409
+ - Pause / resume / soft-update objectives
410
+
411
+ ---
412
+
413
+ ## Related reading
414
+
415
+ - [Tools](./tools.md) — purpose, args, when to use, caveats per tool
416
+ - [Auth](./auth.md) — issued key, optional Bearer, private-key boundary
417
+ - [Setup](./setup.md) — wiring Cursor / Claude Desktop to the live API
418
+ - [Security](./security.md) — stdio trust model and key hygiene
419
+ - **@buildaureon/sdk documentation** — deeper contracts for builders
420
+
421
+ ---
422
+
423
+ ## Quick reference card
424
+
425
+ ```text
426
+ READ: ping → me → sync_portfolio → vault_status → health
427
+ DECIDE: fund? create auto? restore? rehearse only?
428
+ ACT: prepare_* (host signs) | create_objective(auto) | restore_objective
429
+ CHECK: timeline / executions / health — quote settlement=vault|staged
430
+ ```
431
+
432
+ Keep the loop short. Prefer Automatic. Never invent settlement. Never touch private keys inside MCP.
433
+
434
+ ---
435
+
436
+ ## Appendix: decision matrix
437
+
438
+ | Situation | First tools | Then | Stop if |
439
+ | --- | --- | --- | --- |
440
+ | New session | `aureon_ping`, `aureon_me` | Sync + vault status | Key invalid |
441
+ | Want new policy | List objectives + vault status | `aureon_create_objective` (auto) | Vault empty and restores required |
442
+ | Health red | Watchdog + health + plan | `aureon_restore_objective` | Plan unclear / unfunded |
443
+ | Need capital in vault | `aureon_prepare_vault_deposit` | Host signs outside MCP | Operator cannot sign |
444
+ | Demo shock | List presets + apply event | Health / optional restore | Treating marks as production |
445
+ | Soft policy tweak | `aureon_get_objective` | `aureon_update_objective` | Trying to change symbol/mode |
446
+ | Change token or mode | Pause or leave old | Create new Automatic objective | Patching locked fields |
447
+ | Key rotation | `aureon_list_api_keys` | Create → store secret → revoke old | Echoing secret in public chat |
448
+
449
+ ### Narrative examples (short)
450
+
451
+ **Morning.** “API is up. Wallet `0x…`. Vault ready. Two Automatic objectives healthy. No action.”
452
+
453
+ **Create.** “Created Automatic balanced objective for 15% WETH (±3%). `targetSymbol` and `automationMode` are locked. Health is within band.”
454
+
455
+ **Restore.** “Objective breached after watchdog refresh. Plan was a vault-backed rebalance. Restore receipt `settlement: vault`. Post-health green.”
456
+
457
+ **Deposit.** “Prepared unsigned deposit for 0.1 ETH. Sign and broadcast in your wallet. After confirmation I will sync and re-check vault status.”
458
+
459
+ **Rehearsal.** “Applied −10% TSLA rehearsal event. Two objectives breached in marks. This is not a live oracle price.”
460
+
461
+ ### Closing reminders for agents
462
+
463
+ 1. Live API only — issued key (optional Bearer).
464
+ 2. Thirty-three tools — see the tool reference for args and caveats.
465
+ 3. Automatic by default — Manual is a human Approve surface.
466
+ 4. Prepare ≠ funded — host signs outside MCP.
467
+ 5. Quote `settlement` — `vault` or `staged`, never invent.
468
+ 6. Read → decide → act → read again.