@buildaureon/mcp 0.1.1 → 0.1.2
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.
- package/README.md +399 -399
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,399 +1,399 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# Aureon MCP
|
|
4
|
-
|
|
5
|
-
**The Financial Intelligence Layer for Onchain AI Agents**
|
|
6
|
-
|
|
7
|
-
Official [Model Context Protocol](https://modelcontextprotocol.io) server for the AUREON Financial Compass.
|
|
8
|
-
Exposes the full `@buildaureon/sdk` surface as tools for Cursor, Claude Desktop, and any MCP host on the Robinhood Chain.
|
|
9
|
-
|
|
10
|
-
<br />
|
|
11
|
-
|
|
12
|
-
[](https://www.typescriptlang.org/)
|
|
13
|
-
[](https://modelcontextprotocol.io)
|
|
14
|
-
[](https://github.com/buildaureon)
|
|
15
|
-
[](LICENSE)
|
|
16
|
-
[](#requirements--installation)
|
|
17
|
-
|
|
18
|
-
<br />
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npx -y @buildaureon/mcp
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
[Quickstart](#quickstart) · [Architecture](#architecture) · [Authentication](#authentication) · [Tool Surface](#tool-surface) · [Agent Workflows](#agent-workflows) · [Docs](#documentation-registry)
|
|
25
|
-
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Table of Contents
|
|
31
|
-
|
|
32
|
-
1. [What is AUREON MCP?](#what-is-aureon-mcp)
|
|
33
|
-
2. [Why AUREON MCP?](#why-aureon-mcp)
|
|
34
|
-
3. [Requirements & Installation](#requirements--installation)
|
|
35
|
-
4. [Architecture](#architecture)
|
|
36
|
-
5. [Quickstart](#quickstart)
|
|
37
|
-
6. [Authentication](#authentication)
|
|
38
|
-
7. [Tool Surface](#tool-surface)
|
|
39
|
-
8. [Agent Workflows](#agent-workflows)
|
|
40
|
-
9. [Sample Agent Prompts](#sample-agent-prompts)
|
|
41
|
-
10. [Security Model](#security-model)
|
|
42
|
-
11. [Development](#development)
|
|
43
|
-
12. [Documentation Registry](#documentation-registry)
|
|
44
|
-
13. [FAQ](#faq)
|
|
45
|
-
14. [Community & License](#community)
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## What is AUREON MCP?
|
|
50
|
-
|
|
51
|
-
**AUREON** is a policy and execution layer for capital on **Robinhood Chain**. Agents register continuous financial rules (Financial Compass Objectives), monitor health, and restore allocations with honest settlement receipts rather than one-off swaps that forget intent.
|
|
52
|
-
|
|
53
|
-
**`@buildaureon/mcp`** is the agent adapter. It runs as a local **stdio** MCP server and maps every public `@buildaureon/sdk` client method to a named tool (`aureon_ping`, `aureon_create_objective`, `aureon_restore_objective`, …).
|
|
54
|
-
|
|
55
|
-
| You can | Through |
|
|
56
|
-
| --- | --- |
|
|
57
|
-
| Authenticate with an issued developer API key | `AUREON_API_KEY` env (recommended) |
|
|
58
|
-
| Optionally complete a wallet Bearer handshake | `aureon_get_auth_nonce` → sign → `aureon_verify_wallet` |
|
|
59
|
-
| Sync and manage the Capital Book | `aureon_sync_portfolio`, `aureon_set_portfolio`, `aureon_clear_portfolio` |
|
|
60
|
-
| Create and query Financial Compass objectives | `aureon_create_objective`, `aureon_list_objectives`, … |
|
|
61
|
-
| Read health, timeline, vault, executions | `aureon_get_health`, `aureon_list_timeline`, `aureon_get_vault`, … |
|
|
62
|
-
| Prepare non-custodial vault deposit / withdraw steps | `aureon_prepare_vault_deposit`, `aureon_prepare_vault_withdraw` |
|
|
63
|
-
| Fetch and execute restore plans | `aureon_get_restore_plan`, `aureon_restore_objective` |
|
|
64
|
-
| Rehearse market shocks | `aureon_apply_market_event`, `aureon_refresh_watchdog` |
|
|
65
|
-
| Manage developer API keys | `aureon_list_api_keys`, `aureon_create_api_key`, … |
|
|
66
|
-
|
|
67
|
-
**34 tools**: one per public `AureonClient` method. Full schemas: [docs/tools.md](docs/tools.md).
|
|
68
|
-
|
|
69
|
-
For scripts without MCP, use [`@buildaureon/sdk`](https://github.com/buildaureon/aureon-sdk). The operator app at [app.aureonlabs.network](https://app.aureonlabs.network) stays wallet-Bearer only.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Why AUREON MCP?
|
|
74
|
-
|
|
75
|
-
Traditional AI trading scripts execute isolated market orders without context, forgetting target allocations as soon as a prompt ends. **AUREON MCP** provides a persistent financial compass for your AI agents:
|
|
76
|
-
|
|
77
|
-
* **Continuous Rules vs. One-off Swaps**: Instead of telling an agent to "buy 0.5 WETH," you register a Financial Compass Objective like *"Maintain 20% WETH weight with 3% tolerance."* The watchdog automatically monitors drift and plans restores when needed.
|
|
78
|
-
* **Non-Custodial Architecture**: Your private keys stay safely in your local wallet host. The MCP server generates unsigned transaction payloads that you review and sign.
|
|
79
|
-
* **Zero Infrastructure Overhead**: Standard I/O transport (`stdio`) means no local database, Docker containers, or background services to manage.
|
|
80
|
-
* **Honest Settlement Receipts**: Clearly distinguishes between on-chain smart vault settlements (`vault`) and ledger-staged simulation updates (`staged`).
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
## Requirements & Installation
|
|
85
|
-
|
|
86
|
-
### Requirements
|
|
87
|
-
|
|
88
|
-
- **Node.js**: 20 or higher (ESM compatible)
|
|
89
|
-
- **Developer API Key**: An issued key from [app.aureonlabs.network](https://app.aureonlabs.network) → **Developers**
|
|
90
|
-
- **Network Access**: Outbound connectivity to `https://api.aureonlabs.network`
|
|
91
|
-
|
|
92
|
-
### Installation
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
# Using pnpm
|
|
96
|
-
pnpm add @buildaureon/mcp
|
|
97
|
-
|
|
98
|
-
# Using npm
|
|
99
|
-
npm install @buildaureon/mcp
|
|
100
|
-
|
|
101
|
-
# Or run instantly via npx without installing
|
|
102
|
-
npx -y @buildaureon/mcp
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
You do not need to clone the AUREON monorepo: only the package, the live API URL, and your issued key.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Architecture
|
|
110
|
-
|
|
111
|
-
```mermaid
|
|
112
|
-
flowchart LR
|
|
113
|
-
Agent[Cursor / Claude] -->|stdio MCP| MCP["@buildaureon/mcp"]
|
|
114
|
-
MCP --> SDK["@buildaureon/sdk"]
|
|
115
|
-
SDK -->|HTTPS| API[api.aureonlabs.network]
|
|
116
|
-
Utility[Operator utility] -->|wallet Bearer| API
|
|
117
|
-
API --> Vault[Smart Vault · Robinhood Chain]
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Surface & Ownership Breakdown
|
|
121
|
-
|
|
122
|
-
| Surface | Auth | Role |
|
|
123
|
-
| --- | --- | --- |
|
|
124
|
-
| Operator utility | Wallet sign-in (Bearer) | Human operators managing vaults and approving manual restores |
|
|
125
|
-
| `@buildaureon/sdk` | Issued API key (+ optional Bearer) | Automated scripts, bots, serverless routines, and products |
|
|
126
|
-
| `@buildaureon/mcp` | Same as SDK via host `env` | AI agents operating inside Cursor, Claude Desktop, or custom MCP hosts |
|
|
127
|
-
|
|
128
|
-
### Layer Responsibilities
|
|
129
|
-
|
|
130
|
-
| Concern | Owner | Description |
|
|
131
|
-
| --- | --- | --- |
|
|
132
|
-
| HTTP, retries, types, validation, errors | `@buildaureon/sdk` | Core underlying SDK client managing network communications |
|
|
133
|
-
| Tool names, zod schemas, agent formatting | `@buildaureon/mcp` | MCP server mapping SDK methods to AI-friendly tools |
|
|
134
|
-
| stdio / JSON-RPC protocol | `@modelcontextprotocol/sdk` | Official MCP protocol framework for inter-process communication |
|
|
135
|
-
|
|
136
|
-
**Trust boundary**: The API monitors objectives and generates restore plans; private keys stay strictly on the host machine. MCP never signs chain transactions.
|
|
137
|
-
|
|
138
|
-
Deep dive: [docs/architecture.md](docs/architecture.md).
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## Quickstart
|
|
143
|
-
|
|
144
|
-
Get your AI agent running with AUREON MCP in 4 easy steps:
|
|
145
|
-
|
|
146
|
-
### 1. Create an issued API key
|
|
147
|
-
|
|
148
|
-
1. Open https://app.aureonlabs.network
|
|
149
|
-
2. Connect your wallet (invite early access)
|
|
150
|
-
3. Navigate to **Developers** → click **Create API Key** → copy your key once
|
|
151
|
-
|
|
152
|
-
That key identifies your wallet for control-plane tools. **No Bearer token required.**
|
|
153
|
-
|
|
154
|
-
### 2. Configure Cursor IDE
|
|
155
|
-
|
|
156
|
-
Copy [`examples/cursor.mcp.json`](examples/cursor.mcp.json) into `.cursor/mcp.json` (or merge into your global Cursor MCP config):
|
|
157
|
-
|
|
158
|
-
```json
|
|
159
|
-
{
|
|
160
|
-
"mcpServers": {
|
|
161
|
-
"aureon": {
|
|
162
|
-
"command": "npx",
|
|
163
|
-
"args": ["-y", "@buildaureon/mcp"],
|
|
164
|
-
"env": {
|
|
165
|
-
"AUREON_API_URL": "https://api.aureonlabs.network",
|
|
166
|
-
"AUREON_API_KEY": "<issued-developer-api-key>"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Restart Cursor. Open the AI chat panel and ask: *“Ping AUREON and show my wallet with aureon_me.”*
|
|
174
|
-
|
|
175
|
-
### 3. Configure Claude Desktop
|
|
176
|
-
|
|
177
|
-
Merge [`examples/claude-desktop.json`](examples/claude-desktop.json) into Claude Desktop's configuration file:
|
|
178
|
-
|
|
179
|
-
* **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
180
|
-
* **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
181
|
-
|
|
182
|
-
```json
|
|
183
|
-
{
|
|
184
|
-
"mcpServers": {
|
|
185
|
-
"aureon": {
|
|
186
|
-
"command": "npx",
|
|
187
|
-
"args": ["-y", "@buildaureon/mcp"],
|
|
188
|
-
"env": {
|
|
189
|
-
"AUREON_API_URL": "https://api.aureonlabs.network",
|
|
190
|
-
"AUREON_API_KEY": "<issued-developer-api-key>"
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Restart Claude Desktop and test the connection.
|
|
198
|
-
|
|
199
|
-
### 4. From a local clone (maintainers)
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
pnpm install
|
|
203
|
-
pnpm --filter @buildaureon/mcp build
|
|
204
|
-
pnpm --filter @buildaureon/mcp start
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
Point the host `command` / `args` at the built `dist/index.js`. See [docs/setup.md](docs/setup.md).
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
## Authentication
|
|
212
|
-
|
|
213
|
-
### Recommended: Issued API key
|
|
214
|
-
|
|
215
|
-
| Variable | Required | Role |
|
|
216
|
-
| --- | --- | --- |
|
|
217
|
-
| `AUREON_API_KEY` | Yes (recommended) | Issued developer key for product access **and** wallet identity |
|
|
218
|
-
| `AUREON_API_URL` | No | Defaults to `https://api.aureonlabs.network` |
|
|
219
|
-
| `AUREON_AUTH_TOKEN` | No | Optional wallet Bearer (**wins** if both key and Bearer are sent) |
|
|
220
|
-
|
|
221
|
-
**Private Key Boundary**: Private keys are only needed outside MCP when signing and broadcasting deposit or withdrawal transactions. Prepare tools return unsigned transaction steps; the MCP server never signs.
|
|
222
|
-
|
|
223
|
-
### Optional: Wallet Bearer session
|
|
224
|
-
|
|
225
|
-
Use `aureon_get_auth_nonce` → host wallet signs challenge → `aureon_verify_wallet`. Prefer issued keys for always-on agents.
|
|
226
|
-
|
|
227
|
-
### Preview / Dev Mode only
|
|
228
|
-
|
|
229
|
-
`aureon_dev_login` works only when the API backend has `AUREON_ALLOW_DEV_LOGIN=1` (it does not function on production).
|
|
230
|
-
|
|
231
|
-
Deep dive: [docs/auth.md](docs/auth.md).
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
## Tool Surface
|
|
236
|
-
|
|
237
|
-
AUREON MCP exposes **34 tools** covering 100% of the `AureonClient` SDK surface:
|
|
238
|
-
|
|
239
|
-
| Category | Count | Tools Included | Primary Purpose |
|
|
240
|
-
| --- | --- | --- | --- |
|
|
241
|
-
| **Health** | 1 | `aureon_ping` | Check API connectivity & backend watchdog state |
|
|
242
|
-
| **Auth** | 5 | `aureon_get_auth_nonce`, `aureon_verify_wallet`, `aureon_dev_login`, `aureon_logout`, `aureon_me` | Manage wallet sessions, challenges, and identity |
|
|
243
|
-
| **Read** | 11 | `aureon_get_overview`, `aureon_get_portfolio`, `aureon_list_objectives`, `aureon_get_objective`, `aureon_get_health`, `aureon_list_timeline`, `aureon_list_market_presets`, `aureon_get_restore_plan`, `aureon_list_executions`, `aureon_get_vault`, `aureon_get_vault_status` | Inspect portfolio allocations, health scores, timelines, and vault state |
|
|
244
|
-
| **Objectives** | 4 | `aureon_create_objective`, `aureon_update_objective`, `aureon_pause_objective`, `aureon_resume_objective` | Create, modify, pause, and resume Financial Compass Objectives |
|
|
245
|
-
| **Portfolio** | 3 | `aureon_set_portfolio`, `aureon_clear_portfolio`, `aureon_sync_portfolio` | Synchronize and manage live Capital Book asset marks |
|
|
246
|
-
| **Execution** | 2 | `aureon_run_execution`, `aureon_restore_objective` | Trigger policy rebalancing and execute objective restore plans |
|
|
247
|
-
| **Market** | 2 | `aureon_apply_market_event`, `aureon_refresh_watchdog` | Rehearse market shocks (e.g. price shifts) against active policy |
|
|
248
|
-
| **Vault** | 2 | `aureon_prepare_vault_deposit`, `aureon_prepare_vault_withdraw` | Generate unsigned steps for non-custodial smart vault deposits/withdrawals |
|
|
249
|
-
| **Developer** | 4 | `aureon_list_api_keys`, `aureon_create_api_key`, `aureon_revoke_api_key`, `aureon_toggle_api_key` | Create, pause, and revoke developer API access keys |
|
|
250
|
-
|
|
251
|
-
Full argument schemas: [docs/tools.md](docs/tools.md) · Playbooks: [docs/agent-guide.md](docs/agent-guide.md).
|
|
252
|
-
|
|
253
|
-
### Locked fields
|
|
254
|
-
|
|
255
|
-
- `targetSymbol` and `automationMode` are set at **create** time and cannot be modified via `aureon_update_objective`: recreate the objective instead.
|
|
256
|
-
- Default `automationMode` is `"auto"`. Use `"manual"` only when a human must Approve changes inside the utility web app.
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
## Agent Workflows
|
|
261
|
-
|
|
262
|
-
Agents perform best when following the **Read → Decide → Act** execution pattern:
|
|
263
|
-
|
|
264
|
-
```mermaid
|
|
265
|
-
flowchart TD
|
|
266
|
-
subgraph Read Phase
|
|
267
|
-
R1[1. aureon_ping] --> R2[2. aureon_me]
|
|
268
|
-
R2 --> R3[3. aureon_sync_portfolio]
|
|
269
|
-
R3 --> R4[4. aureon_get_health]
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
subgraph Decide Phase
|
|
273
|
-
R4 --> D1{Policy Breached?}
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
subgraph Act Phase
|
|
277
|
-
D1 -- Yes --> A1[aureon_get_restore_plan]
|
|
278
|
-
A1 --> A2[aureon_restore_objective]
|
|
279
|
-
A2 --> A3[aureon_list_timeline]
|
|
280
|
-
D1 -- No --> A4[Maintain current positions]
|
|
281
|
-
end
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### 1. Control-Plane Routine (API Key Only)
|
|
285
|
-
|
|
286
|
-
1. `aureon_ping` → `aureon_me` (Verify connection and wallet identity)
|
|
287
|
-
2. `aureon_sync_portfolio` → `aureon_get_vault_status` (Fetch marks and check vault readiness)
|
|
288
|
-
3. `aureon_create_objective` (`auto`) (Register continuous financial objective)
|
|
289
|
-
4. `aureon_refresh_watchdog` / `aureon_get_health` (Check health score and drift)
|
|
290
|
-
5. On violation → `aureon_get_restore_plan` → `aureon_restore_objective` (Fetch plan and restore allocation)
|
|
291
|
-
6. Confirm with `aureon_list_timeline` (Verify settlement receipts)
|
|
292
|
-
|
|
293
|
-
### 2. Vault Deposit Path (API Key + External Signer)
|
|
294
|
-
|
|
295
|
-
1. `aureon_prepare_vault_deposit` → returns unsigned steps
|
|
296
|
-
2. Host wallet signs and broadcasts transaction on Robinhood Chain
|
|
297
|
-
3. `aureon_sync_portfolio` / `aureon_get_vault` (Re-sync marks to reflect new deposit)
|
|
298
|
-
|
|
299
|
-
More playbooks: [docs/agent-guide.md](docs/agent-guide.md).
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
## Sample Agent Prompts
|
|
304
|
-
|
|
305
|
-
Copy and paste these example prompts into Cursor or Claude Desktop:
|
|
306
|
-
|
|
307
|
-
### Portfolio Audit
|
|
308
|
-
> *"Ping AUREON, verify my wallet address with aureon_me, sync my portfolio, and give me a summary of total AUM and active objective health."*
|
|
309
|
-
|
|
310
|
-
### Setting a Compass Objective
|
|
311
|
-
> *"Create an automatic Financial Compass Objective named 'Maintain 20% WETH' targeting symbol WETH with weight 0.20 and tolerance 0.03."*
|
|
312
|
-
|
|
313
|
-
### Monitoring & Drift Restoration
|
|
314
|
-
> *"Refresh the watchdog and inspect my AUREON health. If any objective is in breach, show me the restore plan and run aureon_restore_objective."*
|
|
315
|
-
|
|
316
|
-
### Deposit Preparation
|
|
317
|
-
> *"Prepare an unsigned vault deposit for 0.1 ETH. Return the exact step payload so I can review and sign it in my wallet."*
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
|
-
## Security Model
|
|
322
|
-
|
|
323
|
-
* **Local stdio Isolation**: Run MCP **locally over stdio** only; do not expose standard I/O sockets on the public internet.
|
|
324
|
-
* **API Key Protection**: Treat `AUREON_API_KEY` like a password. Pause, revoke, or rotate keys in the Developer dashboard if compromised.
|
|
325
|
-
* **Environment Hygiene**: Never commit keys to version control. Never put wallet private keys into MCP environment variables.
|
|
326
|
-
* **Prompt Safety**: Review agent prompts before enabling write tools in untrusted or multi-user chat channels.
|
|
327
|
-
|
|
328
|
-
Deep dive details: [docs/security.md](docs/security.md).
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
## Development
|
|
333
|
-
|
|
334
|
-
To build and test `@buildaureon/mcp` locally:
|
|
335
|
-
|
|
336
|
-
```bash
|
|
337
|
-
pnpm install
|
|
338
|
-
pnpm --filter @buildaureon/mcp build
|
|
339
|
-
pnpm --filter @buildaureon/mcp test
|
|
340
|
-
pnpm --filter @buildaureon/mcp typecheck
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
### Script Reference
|
|
344
|
-
|
|
345
|
-
| Script | Purpose | Description |
|
|
346
|
-
| --- | --- | --- |
|
|
347
|
-
| `build` | `tsup` → `dist/` | Bundles TypeScript source into distribution ESM output |
|
|
348
|
-
| `dev` | `tsx src/index.ts` | Runs server directly from source for local development |
|
|
349
|
-
| `start` | `node dist/index.js` | Runs compiled distribution binary |
|
|
350
|
-
| `test` | `tsx --test ...` | Runs unit, smoke, and integration test suites |
|
|
351
|
-
| `typecheck` | `tsc --noEmit` | Validates TypeScript types across source files |
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
|
-
## Documentation Registry
|
|
356
|
-
|
|
357
|
-
| Document | Description & Contents |
|
|
358
|
-
| --- | --- |
|
|
359
|
-
| **[Setup Guide](docs/setup.md)** | Step-by-step setup for Cursor, Claude Desktop, npx, building from source, and troubleshooting |
|
|
360
|
-
| **[Authentication Guide](docs/auth.md)** | Issued API key vs. Wallet Bearer vs. private key boundaries |
|
|
361
|
-
| **[Tools Reference](docs/tools.md)** | Full 34-tool reference with arguments, schemas, and caveats |
|
|
362
|
-
| **[Agent Playbooks](docs/agent-guide.md)** | End-to-end agent decision playbooks, turn templates, and anti-patterns |
|
|
363
|
-
| **[Architecture Deep Dive](docs/architecture.md)** | Module boundaries, file maps, and end-to-end request data flows |
|
|
364
|
-
| **[Security Model](docs/security.md)** | Credential management, threat modeling, and operational safety |
|
|
365
|
-
| **[`@buildaureon/sdk`](https://github.com/buildaureon/aureon-sdk)** | Core TypeScript SDK documentation, types, and error definitions |
|
|
366
|
-
|
|
367
|
-
---
|
|
368
|
-
|
|
369
|
-
## FAQ
|
|
370
|
-
|
|
371
|
-
**Do I need a private key in Cursor or Claude env?**
|
|
372
|
-
No. You only need an issued `AUREON_API_KEY`. Private keys stay in your host wallet when signing prepare steps.
|
|
373
|
-
|
|
374
|
-
**Does MCP talk to a local backend server?**
|
|
375
|
-
No. By default, it connects to the live production API at `https://api.aureonlabs.network`. Override `AUREON_API_URL` only if targeting a custom gateway.
|
|
376
|
-
|
|
377
|
-
**Why did my restore receipt say `staged`?**
|
|
378
|
-
`staged` indicates a ledger-local simulation receipt rather than an on-chain vault settlement. Always describe settlement receipts accurately in agent responses.
|
|
379
|
-
|
|
380
|
-
**Can agents use Manual automation mode?**
|
|
381
|
-
Prefer Automatic (`auto`). Manual mode requires human Approval inside the operator utility app.
|
|
382
|
-
|
|
383
|
-
**What happens if an objective breaches its drift tolerance?**
|
|
384
|
-
The watchdog marks health as breached. Agents call `aureon_get_restore_plan` to inspect the rebalancing steps, then `aureon_restore_objective` to execute the restore.
|
|
385
|
-
|
|
386
|
-
**How does MCP handle network errors or disconnects?**
|
|
387
|
-
The underlying `@buildaureon/sdk` handles HTTP retries and reports structured error objects with stable error codes back to the MCP host.
|
|
388
|
-
|
|
389
|
-
---
|
|
390
|
-
|
|
391
|
-
## Community
|
|
392
|
-
|
|
393
|
-
- **Website**: https://www.aureonlabs.network
|
|
394
|
-
- **X (Twitter)**: https://x.com/buildaureon
|
|
395
|
-
- **App Utility**: https://app.aureonlabs.network
|
|
396
|
-
|
|
397
|
-
## License
|
|
398
|
-
|
|
399
|
-
MIT (see [LICENSE](LICENSE)).
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# Aureon MCP
|
|
4
|
+
|
|
5
|
+
**The Financial Intelligence Layer for Onchain AI Agents**
|
|
6
|
+
|
|
7
|
+
Official [Model Context Protocol](https://modelcontextprotocol.io) server for the AUREON Financial Compass.
|
|
8
|
+
Exposes the full `@buildaureon/sdk` surface as tools for Cursor, Claude Desktop, and any MCP host on the Robinhood Chain.
|
|
9
|
+
|
|
10
|
+
<br />
|
|
11
|
+
|
|
12
|
+
[](https://www.typescriptlang.org/)
|
|
13
|
+
[](https://modelcontextprotocol.io)
|
|
14
|
+
[](https://github.com/buildaureon)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
[](#requirements--installation)
|
|
17
|
+
|
|
18
|
+
<br />
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx -y @buildaureon/mcp
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
[Quickstart](#quickstart) · [Architecture](#architecture) · [Authentication](#authentication) · [Tool Surface](#tool-surface) · [Agent Workflows](#agent-workflows) · [Docs](#documentation-registry)
|
|
25
|
+
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Table of Contents
|
|
31
|
+
|
|
32
|
+
1. [What is AUREON MCP?](#what-is-aureon-mcp)
|
|
33
|
+
2. [Why AUREON MCP?](#why-aureon-mcp)
|
|
34
|
+
3. [Requirements & Installation](#requirements--installation)
|
|
35
|
+
4. [Architecture](#architecture)
|
|
36
|
+
5. [Quickstart](#quickstart)
|
|
37
|
+
6. [Authentication](#authentication)
|
|
38
|
+
7. [Tool Surface](#tool-surface)
|
|
39
|
+
8. [Agent Workflows](#agent-workflows)
|
|
40
|
+
9. [Sample Agent Prompts](#sample-agent-prompts)
|
|
41
|
+
10. [Security Model](#security-model)
|
|
42
|
+
11. [Development](#development)
|
|
43
|
+
12. [Documentation Registry](#documentation-registry)
|
|
44
|
+
13. [FAQ](#faq)
|
|
45
|
+
14. [Community & License](#community)
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## What is AUREON MCP?
|
|
50
|
+
|
|
51
|
+
**AUREON** is a policy and execution layer for capital on **Robinhood Chain**. Agents register continuous financial rules (Financial Compass Objectives), monitor health, and restore allocations with honest settlement receipts rather than one-off swaps that forget intent.
|
|
52
|
+
|
|
53
|
+
**`@buildaureon/mcp`** is the agent adapter. It runs as a local **stdio** MCP server and maps every public `@buildaureon/sdk` client method to a named tool (`aureon_ping`, `aureon_create_objective`, `aureon_restore_objective`, …).
|
|
54
|
+
|
|
55
|
+
| You can | Through |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| Authenticate with an issued developer API key | `AUREON_API_KEY` env (recommended) |
|
|
58
|
+
| Optionally complete a wallet Bearer handshake | `aureon_get_auth_nonce` → sign → `aureon_verify_wallet` |
|
|
59
|
+
| Sync and manage the Capital Book | `aureon_sync_portfolio`, `aureon_set_portfolio`, `aureon_clear_portfolio` |
|
|
60
|
+
| Create and query Financial Compass objectives | `aureon_create_objective`, `aureon_list_objectives`, … |
|
|
61
|
+
| Read health, timeline, vault, executions | `aureon_get_health`, `aureon_list_timeline`, `aureon_get_vault`, … |
|
|
62
|
+
| Prepare non-custodial vault deposit / withdraw steps | `aureon_prepare_vault_deposit`, `aureon_prepare_vault_withdraw` |
|
|
63
|
+
| Fetch and execute restore plans | `aureon_get_restore_plan`, `aureon_restore_objective` |
|
|
64
|
+
| Rehearse market shocks | `aureon_apply_market_event`, `aureon_refresh_watchdog` |
|
|
65
|
+
| Manage developer API keys | `aureon_list_api_keys`, `aureon_create_api_key`, … |
|
|
66
|
+
|
|
67
|
+
**34 tools**: one per public `AureonClient` method. Full schemas: [docs/tools.md](docs/tools.md).
|
|
68
|
+
|
|
69
|
+
For scripts without MCP, use [`@buildaureon/sdk`](https://github.com/buildaureon/aureon-sdk). The operator app at [app.aureonlabs.network](https://app.aureonlabs.network) stays wallet-Bearer only.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Why AUREON MCP?
|
|
74
|
+
|
|
75
|
+
Traditional AI trading scripts execute isolated market orders without context, forgetting target allocations as soon as a prompt ends. **AUREON MCP** provides a persistent financial compass for your AI agents:
|
|
76
|
+
|
|
77
|
+
* **Continuous Rules vs. One-off Swaps**: Instead of telling an agent to "buy 0.5 WETH," you register a Financial Compass Objective like *"Maintain 20% WETH weight with 3% tolerance."* The watchdog automatically monitors drift and plans restores when needed.
|
|
78
|
+
* **Non-Custodial Architecture**: Your private keys stay safely in your local wallet host. The MCP server generates unsigned transaction payloads that you review and sign.
|
|
79
|
+
* **Zero Infrastructure Overhead**: Standard I/O transport (`stdio`) means no local database, Docker containers, or background services to manage.
|
|
80
|
+
* **Honest Settlement Receipts**: Clearly distinguishes between on-chain smart vault settlements (`vault`) and ledger-staged simulation updates (`staged`).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Requirements & Installation
|
|
85
|
+
|
|
86
|
+
### Requirements
|
|
87
|
+
|
|
88
|
+
- **Node.js**: 20 or higher (ESM compatible)
|
|
89
|
+
- **Developer API Key**: An issued key from [app.aureonlabs.network](https://app.aureonlabs.network) → **Developers**
|
|
90
|
+
- **Network Access**: Outbound connectivity to `https://api.aureonlabs.network`
|
|
91
|
+
|
|
92
|
+
### Installation
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Using pnpm
|
|
96
|
+
pnpm add @buildaureon/mcp
|
|
97
|
+
|
|
98
|
+
# Using npm
|
|
99
|
+
npm install @buildaureon/mcp
|
|
100
|
+
|
|
101
|
+
# Or run instantly via npx without installing
|
|
102
|
+
npx -y @buildaureon/mcp
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
You do not need to clone the AUREON monorepo: only the package, the live API URL, and your issued key.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Architecture
|
|
110
|
+
|
|
111
|
+
```mermaid
|
|
112
|
+
flowchart LR
|
|
113
|
+
Agent[Cursor / Claude] -->|stdio MCP| MCP["@buildaureon/mcp"]
|
|
114
|
+
MCP --> SDK["@buildaureon/sdk"]
|
|
115
|
+
SDK -->|HTTPS| API[api.aureonlabs.network]
|
|
116
|
+
Utility[Operator utility] -->|wallet Bearer| API
|
|
117
|
+
API --> Vault[Smart Vault · Robinhood Chain]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Surface & Ownership Breakdown
|
|
121
|
+
|
|
122
|
+
| Surface | Auth | Role |
|
|
123
|
+
| --- | --- | --- |
|
|
124
|
+
| Operator utility | Wallet sign-in (Bearer) | Human operators managing vaults and approving manual restores |
|
|
125
|
+
| `@buildaureon/sdk` | Issued API key (+ optional Bearer) | Automated scripts, bots, serverless routines, and products |
|
|
126
|
+
| `@buildaureon/mcp` | Same as SDK via host `env` | AI agents operating inside Cursor, Claude Desktop, or custom MCP hosts |
|
|
127
|
+
|
|
128
|
+
### Layer Responsibilities
|
|
129
|
+
|
|
130
|
+
| Concern | Owner | Description |
|
|
131
|
+
| --- | --- | --- |
|
|
132
|
+
| HTTP, retries, types, validation, errors | `@buildaureon/sdk` | Core underlying SDK client managing network communications |
|
|
133
|
+
| Tool names, zod schemas, agent formatting | `@buildaureon/mcp` | MCP server mapping SDK methods to AI-friendly tools |
|
|
134
|
+
| stdio / JSON-RPC protocol | `@modelcontextprotocol/sdk` | Official MCP protocol framework for inter-process communication |
|
|
135
|
+
|
|
136
|
+
**Trust boundary**: The API monitors objectives and generates restore plans; private keys stay strictly on the host machine. MCP never signs chain transactions.
|
|
137
|
+
|
|
138
|
+
Deep dive: [docs/architecture.md](docs/architecture.md).
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Quickstart
|
|
143
|
+
|
|
144
|
+
Get your AI agent running with AUREON MCP in 4 easy steps:
|
|
145
|
+
|
|
146
|
+
### 1. Create an issued API key
|
|
147
|
+
|
|
148
|
+
1. Open https://app.aureonlabs.network
|
|
149
|
+
2. Connect your wallet (invite early access)
|
|
150
|
+
3. Navigate to **Developers** → click **Create API Key** → copy your key once
|
|
151
|
+
|
|
152
|
+
That key identifies your wallet for control-plane tools. **No Bearer token required.**
|
|
153
|
+
|
|
154
|
+
### 2. Configure Cursor IDE
|
|
155
|
+
|
|
156
|
+
Copy [`examples/cursor.mcp.json`](examples/cursor.mcp.json) into `.cursor/mcp.json` (or merge into your global Cursor MCP config):
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"mcpServers": {
|
|
161
|
+
"aureon": {
|
|
162
|
+
"command": "npx",
|
|
163
|
+
"args": ["-y", "@buildaureon/mcp"],
|
|
164
|
+
"env": {
|
|
165
|
+
"AUREON_API_URL": "https://api.aureonlabs.network",
|
|
166
|
+
"AUREON_API_KEY": "<issued-developer-api-key>"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Restart Cursor. Open the AI chat panel and ask: *“Ping AUREON and show my wallet with aureon_me.”*
|
|
174
|
+
|
|
175
|
+
### 3. Configure Claude Desktop
|
|
176
|
+
|
|
177
|
+
Merge [`examples/claude-desktop.json`](examples/claude-desktop.json) into Claude Desktop's configuration file:
|
|
178
|
+
|
|
179
|
+
* **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
180
|
+
* **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"mcpServers": {
|
|
185
|
+
"aureon": {
|
|
186
|
+
"command": "npx",
|
|
187
|
+
"args": ["-y", "@buildaureon/mcp"],
|
|
188
|
+
"env": {
|
|
189
|
+
"AUREON_API_URL": "https://api.aureonlabs.network",
|
|
190
|
+
"AUREON_API_KEY": "<issued-developer-api-key>"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Restart Claude Desktop and test the connection.
|
|
198
|
+
|
|
199
|
+
### 4. From a local clone (maintainers)
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
pnpm install
|
|
203
|
+
pnpm --filter @buildaureon/mcp build
|
|
204
|
+
pnpm --filter @buildaureon/mcp start
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Point the host `command` / `args` at the built `dist/index.js`. See [docs/setup.md](docs/setup.md).
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Authentication
|
|
212
|
+
|
|
213
|
+
### Recommended: Issued API key
|
|
214
|
+
|
|
215
|
+
| Variable | Required | Role |
|
|
216
|
+
| --- | --- | --- |
|
|
217
|
+
| `AUREON_API_KEY` | Yes (recommended) | Issued developer key for product access **and** wallet identity |
|
|
218
|
+
| `AUREON_API_URL` | No | Defaults to `https://api.aureonlabs.network` |
|
|
219
|
+
| `AUREON_AUTH_TOKEN` | No | Optional wallet Bearer (**wins** if both key and Bearer are sent) |
|
|
220
|
+
|
|
221
|
+
**Private Key Boundary**: Private keys are only needed outside MCP when signing and broadcasting deposit or withdrawal transactions. Prepare tools return unsigned transaction steps; the MCP server never signs.
|
|
222
|
+
|
|
223
|
+
### Optional: Wallet Bearer session
|
|
224
|
+
|
|
225
|
+
Use `aureon_get_auth_nonce` → host wallet signs challenge → `aureon_verify_wallet`. Prefer issued keys for always-on agents.
|
|
226
|
+
|
|
227
|
+
### Preview / Dev Mode only
|
|
228
|
+
|
|
229
|
+
`aureon_dev_login` works only when the API backend has `AUREON_ALLOW_DEV_LOGIN=1` (it does not function on production).
|
|
230
|
+
|
|
231
|
+
Deep dive: [docs/auth.md](docs/auth.md).
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Tool Surface
|
|
236
|
+
|
|
237
|
+
AUREON MCP exposes **34 tools** covering 100% of the `AureonClient` SDK surface:
|
|
238
|
+
|
|
239
|
+
| Category | Count | Tools Included | Primary Purpose |
|
|
240
|
+
| --- | --- | --- | --- |
|
|
241
|
+
| **Health** | 1 | `aureon_ping` | Check API connectivity & backend watchdog state |
|
|
242
|
+
| **Auth** | 5 | `aureon_get_auth_nonce`, `aureon_verify_wallet`, `aureon_dev_login`, `aureon_logout`, `aureon_me` | Manage wallet sessions, challenges, and identity |
|
|
243
|
+
| **Read** | 11 | `aureon_get_overview`, `aureon_get_portfolio`, `aureon_list_objectives`, `aureon_get_objective`, `aureon_get_health`, `aureon_list_timeline`, `aureon_list_market_presets`, `aureon_get_restore_plan`, `aureon_list_executions`, `aureon_get_vault`, `aureon_get_vault_status` | Inspect portfolio allocations, health scores, timelines, and vault state |
|
|
244
|
+
| **Objectives** | 4 | `aureon_create_objective`, `aureon_update_objective`, `aureon_pause_objective`, `aureon_resume_objective` | Create, modify, pause, and resume Financial Compass Objectives |
|
|
245
|
+
| **Portfolio** | 3 | `aureon_set_portfolio`, `aureon_clear_portfolio`, `aureon_sync_portfolio` | Synchronize and manage live Capital Book asset marks |
|
|
246
|
+
| **Execution** | 2 | `aureon_run_execution`, `aureon_restore_objective` | Trigger policy rebalancing and execute objective restore plans |
|
|
247
|
+
| **Market** | 2 | `aureon_apply_market_event`, `aureon_refresh_watchdog` | Rehearse market shocks (e.g. price shifts) against active policy |
|
|
248
|
+
| **Vault** | 2 | `aureon_prepare_vault_deposit`, `aureon_prepare_vault_withdraw` | Generate unsigned steps for non-custodial smart vault deposits/withdrawals |
|
|
249
|
+
| **Developer** | 4 | `aureon_list_api_keys`, `aureon_create_api_key`, `aureon_revoke_api_key`, `aureon_toggle_api_key` | Create, pause, and revoke developer API access keys |
|
|
250
|
+
|
|
251
|
+
Full argument schemas: [docs/tools.md](docs/tools.md) · Playbooks: [docs/agent-guide.md](docs/agent-guide.md).
|
|
252
|
+
|
|
253
|
+
### Locked fields
|
|
254
|
+
|
|
255
|
+
- `targetSymbol` and `automationMode` are set at **create** time and cannot be modified via `aureon_update_objective`: recreate the objective instead.
|
|
256
|
+
- Default `automationMode` is `"auto"`. Use `"manual"` only when a human must Approve changes inside the utility web app.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Agent Workflows
|
|
261
|
+
|
|
262
|
+
Agents perform best when following the **Read → Decide → Act** execution pattern:
|
|
263
|
+
|
|
264
|
+
```mermaid
|
|
265
|
+
flowchart TD
|
|
266
|
+
subgraph Read Phase
|
|
267
|
+
R1[1. aureon_ping] --> R2[2. aureon_me]
|
|
268
|
+
R2 --> R3[3. aureon_sync_portfolio]
|
|
269
|
+
R3 --> R4[4. aureon_get_health]
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
subgraph Decide Phase
|
|
273
|
+
R4 --> D1{Policy Breached?}
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
subgraph Act Phase
|
|
277
|
+
D1 -- Yes --> A1[aureon_get_restore_plan]
|
|
278
|
+
A1 --> A2[aureon_restore_objective]
|
|
279
|
+
A2 --> A3[aureon_list_timeline]
|
|
280
|
+
D1 -- No --> A4[Maintain current positions]
|
|
281
|
+
end
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### 1. Control-Plane Routine (API Key Only)
|
|
285
|
+
|
|
286
|
+
1. `aureon_ping` → `aureon_me` (Verify connection and wallet identity)
|
|
287
|
+
2. `aureon_sync_portfolio` → `aureon_get_vault_status` (Fetch marks and check vault readiness)
|
|
288
|
+
3. `aureon_create_objective` (`auto`) (Register continuous financial objective)
|
|
289
|
+
4. `aureon_refresh_watchdog` / `aureon_get_health` (Check health score and drift)
|
|
290
|
+
5. On violation → `aureon_get_restore_plan` → `aureon_restore_objective` (Fetch plan and restore allocation)
|
|
291
|
+
6. Confirm with `aureon_list_timeline` (Verify settlement receipts)
|
|
292
|
+
|
|
293
|
+
### 2. Vault Deposit Path (API Key + External Signer)
|
|
294
|
+
|
|
295
|
+
1. `aureon_prepare_vault_deposit` → returns unsigned steps
|
|
296
|
+
2. Host wallet signs and broadcasts transaction on Robinhood Chain
|
|
297
|
+
3. `aureon_sync_portfolio` / `aureon_get_vault` (Re-sync marks to reflect new deposit)
|
|
298
|
+
|
|
299
|
+
More playbooks: [docs/agent-guide.md](docs/agent-guide.md).
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Sample Agent Prompts
|
|
304
|
+
|
|
305
|
+
Copy and paste these example prompts into Cursor or Claude Desktop:
|
|
306
|
+
|
|
307
|
+
### Portfolio Audit
|
|
308
|
+
> *"Ping AUREON, verify my wallet address with aureon_me, sync my portfolio, and give me a summary of total AUM and active objective health."*
|
|
309
|
+
|
|
310
|
+
### Setting a Compass Objective
|
|
311
|
+
> *"Create an automatic Financial Compass Objective named 'Maintain 20% WETH' targeting symbol WETH with weight 0.20 and tolerance 0.03."*
|
|
312
|
+
|
|
313
|
+
### Monitoring & Drift Restoration
|
|
314
|
+
> *"Refresh the watchdog and inspect my AUREON health. If any objective is in breach, show me the restore plan and run aureon_restore_objective."*
|
|
315
|
+
|
|
316
|
+
### Deposit Preparation
|
|
317
|
+
> *"Prepare an unsigned vault deposit for 0.1 ETH. Return the exact step payload so I can review and sign it in my wallet."*
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Security Model
|
|
322
|
+
|
|
323
|
+
* **Local stdio Isolation**: Run MCP **locally over stdio** only; do not expose standard I/O sockets on the public internet.
|
|
324
|
+
* **API Key Protection**: Treat `AUREON_API_KEY` like a password. Pause, revoke, or rotate keys in the Developer dashboard if compromised.
|
|
325
|
+
* **Environment Hygiene**: Never commit keys to version control. Never put wallet private keys into MCP environment variables.
|
|
326
|
+
* **Prompt Safety**: Review agent prompts before enabling write tools in untrusted or multi-user chat channels.
|
|
327
|
+
|
|
328
|
+
Deep dive details: [docs/security.md](docs/security.md).
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Development
|
|
333
|
+
|
|
334
|
+
To build and test `@buildaureon/mcp` locally:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
pnpm install
|
|
338
|
+
pnpm --filter @buildaureon/mcp build
|
|
339
|
+
pnpm --filter @buildaureon/mcp test
|
|
340
|
+
pnpm --filter @buildaureon/mcp typecheck
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Script Reference
|
|
344
|
+
|
|
345
|
+
| Script | Purpose | Description |
|
|
346
|
+
| --- | --- | --- |
|
|
347
|
+
| `build` | `tsup` → `dist/` | Bundles TypeScript source into distribution ESM output |
|
|
348
|
+
| `dev` | `tsx src/index.ts` | Runs server directly from source for local development |
|
|
349
|
+
| `start` | `node dist/index.js` | Runs compiled distribution binary |
|
|
350
|
+
| `test` | `tsx --test ...` | Runs unit, smoke, and integration test suites |
|
|
351
|
+
| `typecheck` | `tsc --noEmit` | Validates TypeScript types across source files |
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Documentation Registry
|
|
356
|
+
|
|
357
|
+
| Document | Description & Contents |
|
|
358
|
+
| --- | --- |
|
|
359
|
+
| **[Setup Guide](docs/setup.md)** | Step-by-step setup for Cursor, Claude Desktop, npx, building from source, and troubleshooting |
|
|
360
|
+
| **[Authentication Guide](docs/auth.md)** | Issued API key vs. Wallet Bearer vs. private key boundaries |
|
|
361
|
+
| **[Tools Reference](docs/tools.md)** | Full 34-tool reference with arguments, schemas, and caveats |
|
|
362
|
+
| **[Agent Playbooks](docs/agent-guide.md)** | End-to-end agent decision playbooks, turn templates, and anti-patterns |
|
|
363
|
+
| **[Architecture Deep Dive](docs/architecture.md)** | Module boundaries, file maps, and end-to-end request data flows |
|
|
364
|
+
| **[Security Model](docs/security.md)** | Credential management, threat modeling, and operational safety |
|
|
365
|
+
| **[`@buildaureon/sdk`](https://github.com/buildaureon/aureon-sdk)** | Core TypeScript SDK documentation, types, and error definitions |
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## FAQ
|
|
370
|
+
|
|
371
|
+
**Do I need a private key in Cursor or Claude env?**
|
|
372
|
+
No. You only need an issued `AUREON_API_KEY`. Private keys stay in your host wallet when signing prepare steps.
|
|
373
|
+
|
|
374
|
+
**Does MCP talk to a local backend server?**
|
|
375
|
+
No. By default, it connects to the live production API at `https://api.aureonlabs.network`. Override `AUREON_API_URL` only if targeting a custom gateway.
|
|
376
|
+
|
|
377
|
+
**Why did my restore receipt say `staged`?**
|
|
378
|
+
`staged` indicates a ledger-local simulation receipt rather than an on-chain vault settlement. Always describe settlement receipts accurately in agent responses.
|
|
379
|
+
|
|
380
|
+
**Can agents use Manual automation mode?**
|
|
381
|
+
Prefer Automatic (`auto`). Manual mode requires human Approval inside the operator utility app.
|
|
382
|
+
|
|
383
|
+
**What happens if an objective breaches its drift tolerance?**
|
|
384
|
+
The watchdog marks health as breached. Agents call `aureon_get_restore_plan` to inspect the rebalancing steps, then `aureon_restore_objective` to execute the restore.
|
|
385
|
+
|
|
386
|
+
**How does MCP handle network errors or disconnects?**
|
|
387
|
+
The underlying `@buildaureon/sdk` handles HTTP retries and reports structured error objects with stable error codes back to the MCP host.
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## Community
|
|
392
|
+
|
|
393
|
+
- **Website**: https://www.aureonlabs.network
|
|
394
|
+
- **X (Twitter)**: https://x.com/buildaureon
|
|
395
|
+
- **App Utility**: https://app.aureonlabs.network
|
|
396
|
+
|
|
397
|
+
## License
|
|
398
|
+
|
|
399
|
+
MIT (see [LICENSE](LICENSE)).
|
package/dist/index.js
CHANGED
|
@@ -520,6 +520,48 @@ function registerDeveloperTools(server, client) {
|
|
|
520
520
|
}
|
|
521
521
|
);
|
|
522
522
|
}
|
|
523
|
+
function registerRegistryTools(server, client) {
|
|
524
|
+
server.tool(
|
|
525
|
+
"aureon_registry_status",
|
|
526
|
+
"Returns Phase 2 ObjectiveRegistry deployment status (testnet contract address when configured).",
|
|
527
|
+
{},
|
|
528
|
+
async () => {
|
|
529
|
+
try {
|
|
530
|
+
return ok(await client.getRegistryStatus());
|
|
531
|
+
} catch (err) {
|
|
532
|
+
return fail(err);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
server.tool(
|
|
537
|
+
"aureon_get_objective_registry",
|
|
538
|
+
"Returns the on-chain registry record for an objective when registered.",
|
|
539
|
+
{
|
|
540
|
+
objectiveId: z.string().describe("Objective id")
|
|
541
|
+
},
|
|
542
|
+
async ({ objectiveId }) => {
|
|
543
|
+
try {
|
|
544
|
+
return ok(await client.getObjectiveRegistry(objectiveId));
|
|
545
|
+
} catch (err) {
|
|
546
|
+
return fail(err);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
server.tool(
|
|
551
|
+
"aureon_prepare_objective_registry",
|
|
552
|
+
"Prepares wallet-signed calldata to register an objective on ObjectiveRegistry. The host wallet must broadcast the tx, then call confirm via SDK.",
|
|
553
|
+
{
|
|
554
|
+
objectiveId: z.string().describe("Objective id to register on-chain")
|
|
555
|
+
},
|
|
556
|
+
async ({ objectiveId }) => {
|
|
557
|
+
try {
|
|
558
|
+
return ok(await client.prepareObjectiveRegistry(objectiveId));
|
|
559
|
+
} catch (err) {
|
|
560
|
+
return fail(err);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
);
|
|
564
|
+
}
|
|
523
565
|
|
|
524
566
|
// src/tools/index.ts
|
|
525
567
|
function registerTools(server, client, session) {
|
|
@@ -531,6 +573,7 @@ function registerTools(server, client, session) {
|
|
|
531
573
|
registerPortfolioTools(server, client);
|
|
532
574
|
registerMarketTools(server, client);
|
|
533
575
|
registerDeveloperTools(server, client);
|
|
576
|
+
registerRegistryTools(server, client);
|
|
534
577
|
}
|
|
535
578
|
|
|
536
579
|
// src/server.ts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts","../src/client.ts","../src/format.ts","../src/errors.ts","../src/tools/handler.ts","../src/tools/read.ts","../src/tools/compass.ts","../src/tools/vault.ts","../src/tools/auth.ts","../src/tools/objectives.ts","../src/tools/portfolio.ts","../src/tools/market.ts","../src/tools/developer.ts","../src/tools/index.ts","../src/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Aa,MAAM,CAAA;AAE/C,EAAA,MAAM,MAAA,GAAS,IAAI,SAAA,CAAU;AAAA,IAC3B,IAAA,EAAM,QAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV,CAAA;AAED,EAAA,aAAA,CAAc,MAAA,EAAQ,QAAQ,OAAO,CAAA;AAErC,EAAA,MAAM,SAAA,GAAY,IAAI,oBAAA,EAAqB;AAC3C,EAAA,MAAM,MAAA,CAAO,QAAQ,SAAS,CAAA;AAChC;;;ACfA,WAAA,EAAY,CAAE,KAAA,CAAM,CAAC,GAAA,KAAiB;AACpC,EAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,kBAAA,EAAqB,GAAG;AAAA,CAAI,CAAA;AACjD,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA","file":"index.js","sourcesContent":["/**\r\n * @fileoverview MCP process configuration from environment.\r\n *\r\n * Prefer an **issued** developer API key from the Operator Console (Developers page).\r\n * That key identifies the bound wallet for control-plane tools — no Bearer required.\r\n * `AUREON_AUTH_TOKEN` is optional (utility-style session, or when using env bootstrap keys).\r\n */\r\n\r\nimport { DEFAULT_API_BASE_URL } from \"@buildaureon/sdk\";\r\n\r\nexport interface McpConfig {\r\n apiUrl: string;\r\n apiKey: string | undefined;\r\n authToken: string | undefined;\r\n}\r\n\r\nexport function loadConfig(): McpConfig {\r\n const apiUrl = process.env.AUREON_API_URL || DEFAULT_API_BASE_URL;\r\n const apiKey = process.env.AUREON_API_KEY || undefined;\r\n const authToken = process.env.AUREON_AUTH_TOKEN || undefined;\r\n\r\n if (!apiKey && !authToken) {\r\n throw new Error(\r\n \"Set AUREON_API_KEY (issued developer key from app.aureonlabs.network Developers) \" +\r\n \"or AUREON_AUTH_TOKEN (wallet Bearer). \" +\r\n \"See https://github.com/buildaureon/aureon-mcp#authentication\"\r\n );\r\n }\r\n\r\n return { apiUrl, apiKey, authToken };\r\n}\r\n","/**\r\n * @fileoverview Builds the shared AureonClient for MCP tool handlers.\r\n */\r\n\r\nimport {\r\n createAureonClient,\r\n createSessionTokenProvider,\r\n type AureonClient,\r\n type SessionTokenProvider,\r\n} from \"@buildaureon/sdk\";\r\nimport type { McpConfig } from \"./config.js\";\r\n\r\nexport type McpClientBundle = {\r\n client: AureonClient;\r\n session: SessionTokenProvider;\r\n};\r\n\r\nexport function createClient(config: McpConfig): McpClientBundle {\r\n const session = createSessionTokenProvider(config.authToken ?? null);\r\n const client = createAureonClient({\r\n baseUrl: config.apiUrl,\r\n apiKey: config.apiKey ?? null,\r\n getAccessToken: session.getAccessToken,\r\n });\r\n return { client, session };\r\n}\r\n","export function formatJson(data: unknown): string {\r\n return JSON.stringify(data, null, 2);\r\n}\r\n","import { isAureonError } from \"@buildaureon/sdk\";\r\n\r\nexport function errorText(err: unknown): string {\r\n if (isAureonError(err)) {\r\n return `[${err.code}] ${err.message}`;\r\n }\r\n if (err instanceof Error) {\r\n return err.message;\r\n }\r\n return String(err);\r\n}\r\n","import { formatJson } from \"../format.js\";\r\nimport { errorText } from \"../errors.js\";\r\n\r\nexport function ok(data: unknown) {\r\n return { content: [{ type: \"text\" as const, text: formatJson(data) }] };\r\n}\r\n\r\nexport function fail(err: unknown) {\r\n return { content: [{ type: \"text\" as const, text: errorText(err) }], isError: true };\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerReadTools(server: McpServer, client: AureonClient) {\r\n server.tool(\"aureon_ping\", \"Health probe — confirms API connectivity\", {}, async () => {\r\n try {\r\n return ok(await client.ping());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n });\r\n\r\n server.tool(\r\n \"aureon_get_overview\",\r\n \"Dashboard overview — total AUM, objective count, aggregate health\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getOverview());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_get_portfolio\",\r\n \"Current capital book snapshot — positions, marks, weights\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getPortfolio());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\"aureon_list_objectives\", \"List all Financial Compass Objectives\", {}, async () => {\r\n try {\r\n return ok(await client.listObjectives());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n });\r\n\r\n server.tool(\r\n \"aureon_get_objective\",\r\n \"Get a single objective by ID\",\r\n { objectiveId: z.string().describe(\"The objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getObjective(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_get_health\",\r\n \"Health state for objectives — drift, breach status, policy compliance\",\r\n { objectiveId: z.string().optional().describe(\"Filter by objective ID (omit for all)\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getHealth(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_list_timeline\",\r\n \"Timeline of events — objective changes, executions, health transitions\",\r\n { objectiveId: z.string().optional().describe(\"Filter by objective ID (omit for all)\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getTimeline(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_list_market_presets\",\r\n \"Available market event simulation presets\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.listMarketPresets());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerCompassTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_get_restore_plan\",\r\n \"Restore plan for an objective — proposed rebalance steps to return to policy\",\r\n { objectiveId: z.string().describe(\"The objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getRestorePlan(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_run_execution\",\r\n \"Run restorative execution for an objective currently outside policy\",\r\n { objectiveId: z.string().describe(\"The objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.runExecution(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_restore_objective\",\r\n \"Run vault-backed restorative execution for an objective outside policy\",\r\n { objectiveId: z.string().describe(\"The objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.restoreObjective(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_list_executions\",\r\n \"Recent execution receipts — past restorative actions taken\",\r\n { objectiveId: z.string().optional().describe(\"Filter by objective ID (omit for all)\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.listExecutions(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerVaultTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_get_vault\",\r\n \"Vault overview — balances, tokens, deposit history\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getVault());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_get_vault_status\",\r\n \"Compact vault funding status — ready state before restore\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getVaultStatus());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_prepare_vault_deposit\",\r\n \"Prepare unsigned vault deposit steps. Returns calldata only — the host must sign/broadcast with a wallet private key. API key alone cannot move funds.\",\r\n {\r\n symbol: z.string().describe(\"Deposit symbol (ETH or allowlisted ERC-20)\"),\r\n amount: z.string().describe(\"Human-readable amount\"),\r\n },\r\n async ({ symbol, amount }) => {\r\n try {\r\n return ok(await client.prepareVaultDeposit({ symbol, amount }));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_prepare_vault_withdraw\",\r\n \"Prepare unsigned vault withdraw steps. Returns calldata only — host must sign/broadcast. API key alone cannot move funds.\",\r\n {\r\n symbol: z.string().optional().describe(\"Withdraw symbol (default WETH; not ETH)\"),\r\n amount: z.string().describe(\"Human-readable amount\"),\r\n },\r\n async ({ symbol, amount }) => {\r\n try {\r\n return ok(await client.prepareVaultWithdraw({ symbol, amount }));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","/**\r\n * @fileoverview Auth tools — wallet handshake is optional for MCP.\r\n *\r\n * Recommended path: issued AUREON_API_KEY identifies the wallet.\r\n * verify_wallet / dev_login update the in-process session provider when used.\r\n */\r\n\r\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient, SessionTokenProvider } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerAuthTools(\r\n server: McpServer,\r\n client: AureonClient,\r\n session: SessionTokenProvider\r\n) {\r\n server.tool(\r\n \"aureon_get_auth_nonce\",\r\n \"Request a wallet auth nonce/message for EIP-191 signing (optional — issued API keys usually skip this)\",\r\n { address: z.string().describe(\"Wallet address (0x…)\") },\r\n async ({ address }) => {\r\n try {\r\n return ok(await client.getAuthNonce(address));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_verify_wallet\",\r\n \"Verify a wallet signature and store the Bearer session for later tools in this MCP process\",\r\n {\r\n address: z.string().describe(\"Wallet address\"),\r\n message: z.string().describe(\"Signed message from get_auth_nonce\"),\r\n signature: z.string().describe(\"Wallet signature hex\"),\r\n inviteCode: z.string().optional().describe(\"Invite code if required on first login\"),\r\n },\r\n async ({ address, message, signature, inviteCode }) => {\r\n try {\r\n const login = await client.verifyWallet({\r\n address,\r\n message,\r\n signature,\r\n inviteCode,\r\n });\r\n session.setToken(login.token);\r\n return ok(login);\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_dev_login\",\r\n \"Local preview login without wallet signature (requires AUREON_ALLOW_DEV_LOGIN=1 on API — not production)\",\r\n {},\r\n async () => {\r\n try {\r\n const login = await client.devLogin();\r\n session.setToken(login.token);\r\n return ok(login);\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_logout\",\r\n \"Revoke the current Bearer session and clear the in-process token\",\r\n {},\r\n async () => {\r\n try {\r\n const result = await client.logout();\r\n session.clear();\r\n return ok(result);\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_me\",\r\n \"Return the wallet bound to the issued API key or current Bearer session\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.me());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nconst objectiveKind = z.enum([\r\n \"stable_allocation\",\r\n \"balanced_portfolio\",\r\n \"risk_ceiling\",\r\n \"reward_reinvestment\",\r\n]);\r\n\r\nconst objectivePriority = z.enum([\"low\", \"medium\", \"high\", \"critical\"]);\r\n\r\nconst automationMode = z.enum([\"auto\", \"manual\"]);\r\n\r\nexport function registerObjectiveTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_create_objective\",\r\n \"Create a Financial Compass Objective. targetSymbol and automationMode are locked after create — recreate to change them. Defaults to automationMode auto.\",\r\n {\r\n name: z.string().describe(\"Objective display name\"),\r\n kind: objectiveKind.describe(\"Objective kind\"),\r\n targetWeight: z.number().describe(\"Target portfolio weight (0–1)\"),\r\n tolerance: z.number().describe(\"Allowed drift band (0–1)\"),\r\n priority: objectivePriority.optional().describe(\"Evaluation priority\"),\r\n maxRiskScore: z.number().optional().describe(\"Max risk score ceiling\"),\r\n reinvestRatio: z\r\n .number()\r\n .optional()\r\n .describe(\"Reinvest ratio for reward objectives\"),\r\n targetSymbol: z\r\n .string()\r\n .nullable()\r\n .optional()\r\n .describe(\"Asset symbol to track (locked after create)\"),\r\n automationMode: automationMode\r\n .optional()\r\n .describe(\"auto = keeper vault restore; manual = operator Approve (locked after create)\"),\r\n },\r\n async (input) => {\r\n try {\r\n return ok(await client.createObjective(input));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_update_objective\",\r\n \"Partial update (name, weight, tolerance, priority). Cannot change targetSymbol or automationMode — recreate instead.\",\r\n {\r\n objectiveId: z.string().describe(\"Objective ID\"),\r\n name: z.string().optional(),\r\n priority: objectivePriority.optional(),\r\n targetWeight: z.number().optional(),\r\n tolerance: z.number().optional(),\r\n maxRiskScore: z.number().optional(),\r\n reinvestRatio: z.number().optional(),\r\n },\r\n async ({ objectiveId, ...input }) => {\r\n try {\r\n return ok(await client.updateObjective(objectiveId, input));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_pause_objective\",\r\n \"Pause continuous evaluation for an objective\",\r\n { objectiveId: z.string().describe(\"Objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.pauseObjective(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_resume_objective\",\r\n \"Resume evaluation for a paused objective\",\r\n { objectiveId: z.string().describe(\"Objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.resumeObjective(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nconst positionInput = z.object({\r\n symbol: z.string(),\r\n name: z.string(),\r\n category: z.enum([\"stable\", \"stock_token\", \"gas\", \"other\"]),\r\n quantity: z.number(),\r\n markPriceUsd: z.number(),\r\n});\r\n\r\nexport function registerPortfolioTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_set_portfolio\",\r\n \"Replace the wallet capital book with provided positions\",\r\n {\r\n positions: z.array(positionInput).min(1).describe(\"Portfolio position rows\"),\r\n },\r\n async ({ positions }) => {\r\n try {\r\n return ok(await client.setPortfolio(positions));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_clear_portfolio\",\r\n \"Clear all capital-book positions for the authenticated wallet\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.clearPortfolio());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_sync_portfolio\",\r\n \"Replace the capital book with on-chain balances for the session wallet\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.syncPortfolio());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerMarketTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_apply_market_event\",\r\n \"Apply a controlled market event to portfolio marks; optionally auto-restore\",\r\n {\r\n symbol: z.string().describe(\"Asset symbol to shock\"),\r\n priceChangeRatio: z.number().describe(\"Fractional price change (e.g. -0.15 = -15%)\"),\r\n name: z.string().optional().describe(\"Event label\"),\r\n description: z.string().optional().describe(\"Event description\"),\r\n autoRestore: z.boolean().optional().describe(\"Run restorative execution if objectives breach\"),\r\n },\r\n async (input) => {\r\n try {\r\n return ok(await client.applyMarketEvent(input));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_refresh_watchdog\",\r\n \"Refresh portfolio marks from live data and re-evaluate objectives\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.refreshWatchdog());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerDeveloperTools(server: McpServer, client: AureonClient) {\r\n server.tool(\"aureon_list_api_keys\", \"List SDK API keys for the authenticated wallet\", {}, async () => {\r\n try {\r\n return ok(await client.listApiKeys());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n });\r\n\r\n server.tool(\r\n \"aureon_create_api_key\",\r\n \"Create an SDK API key (secret returned once — store immediately)\",\r\n { name: z.string().min(2).describe(\"Key display name\") },\r\n async ({ name }) => {\r\n try {\r\n return ok(await client.createApiKey(name));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_revoke_api_key\",\r\n \"Revoke (delete) an SDK API key\",\r\n { keyId: z.string().describe(\"API key ID\") },\r\n async ({ keyId }) => {\r\n try {\r\n return ok(await client.revokeApiKey(keyId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_toggle_api_key\",\r\n \"Toggle active/paused status of an SDK API key\",\r\n { keyId: z.string().describe(\"API key ID\") },\r\n async ({ keyId }) => {\r\n try {\r\n return ok(await client.toggleApiKey(keyId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient, SessionTokenProvider } from \"@buildaureon/sdk\";\r\nimport { registerReadTools } from \"./read.js\";\r\nimport { registerCompassTools } from \"./compass.js\";\r\nimport { registerVaultTools } from \"./vault.js\";\r\nimport { registerAuthTools } from \"./auth.js\";\r\nimport { registerObjectiveTools } from \"./objectives.js\";\r\nimport { registerPortfolioTools } from \"./portfolio.js\";\r\nimport { registerMarketTools } from \"./market.js\";\r\nimport { registerDeveloperTools } from \"./developer.js\";\r\nimport { SDK_TOOL_NAMES, TOOL_COUNT } from \"./catalog.js\";\r\n\r\nexport { SDK_TOOL_NAMES, TOOL_COUNT };\r\n\r\n/** All AureonClient SDK methods exposed as MCP tools. */\r\nexport function registerTools(\r\n server: McpServer,\r\n client: AureonClient,\r\n session: SessionTokenProvider\r\n) {\r\n registerReadTools(server, client);\r\n registerCompassTools(server, client);\r\n registerVaultTools(server, client);\r\n registerAuthTools(server, client, session);\r\n registerObjectiveTools(server, client);\r\n registerPortfolioTools(server, client);\r\n registerMarketTools(server, client);\r\n registerDeveloperTools(server, client);\r\n}\r\n","import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\r\nimport { loadConfig } from \"./config.js\";\r\nimport { createClient } from \"./client.js\";\r\nimport { registerTools } from \"./tools/index.js\";\r\n\r\nexport async function startServer() {\r\n const config = loadConfig();\r\n const { client, session } = createClient(config);\r\n\r\n const server = new McpServer({\r\n name: \"aureon\",\r\n version: \"0.1.1\",\r\n });\r\n\r\n registerTools(server, client, session);\r\n\r\n const transport = new StdioServerTransport();\r\n await server.connect(transport);\r\n}\r\n","import { startServer } from \"./server.js\";\r\n\r\nexport { startServer } from \"./server.js\";\r\n\r\nstartServer().catch((err: unknown) => {\r\n process.stderr.write(`aureon-mcp fatal: ${err}\\n`);\r\n process.exit(1);\r\n});\r\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/config.ts","../src/client.ts","../src/format.ts","../src/errors.ts","../src/tools/handler.ts","../src/tools/read.ts","../src/tools/compass.ts","../src/tools/vault.ts","../src/tools/auth.ts","../src/tools/objectives.ts","../src/tools/portfolio.ts","../src/tools/market.ts","../src/tools/developer.ts","../src/tools/registry.ts","../src/tools/index.ts","../src/server.ts","../src/index.ts"],"names":["z"],"mappings":";;;;;;AAgBO,SAAS,UAAA,GAAwB;AACtC,EAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,GAAA,CAAI,cAAA,IAAkB,oBAAA;AAC7C,EAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,GAAA,CAAI,cAAA,IAAkB,MAAA;AAC7C,EAAA,MAAM,SAAA,GAAY,OAAA,CAAQ,GAAA,CAAI,iBAAA,IAAqB,MAAA;AAEnD,EAAA,IAAI,CAAC,MAAA,IAAU,CAAC,SAAA,EAAW;AACzB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KAGF;AAAA,EACF;AAEA,EAAA,OAAO,EAAE,MAAA,EAAQ,MAAA,EAAQ,SAAA,EAAU;AACrC;ACbO,SAAS,aAAa,MAAA,EAAoC;AAC/D,EAAA,MAAM,OAAA,GAAU,0BAAA,CAA2B,MAAA,CAAO,SAAA,IAAa,IAAI,CAAA;AACnE,EAAA,MAAM,SAAS,kBAAA,CAAmB;AAAA,IAChC,SAAS,MAAA,CAAO,MAAA;AAAA,IAChB,MAAA,EAAQ,OAAO,MAAA,IAAU,IAAA;AAAA,IACzB,gB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CAAmB,QAAQ,MAAM,CAAA;AACjC,EAAA,iBAAA,CAAkB,MAAA,EAAQ,QAAQ,OAAO,CAAA;AACzC,EAAA,sBAAA,CAAuB,QAAQ,MAAM,CAAA;AACrC,EAAA,sBAAA,CAAuB,QAAQ,MAAM,CAAA;AACrC,EAAA,mBAAA,CAAoB,QAAQ,MAAM,CAAA;AAClC,EAAA,sBAAA,CAAuB,QAAQ,MAAM,CAAA;AACrC,EAAA,qBAAA,CAAsB,QAAQ,MAAM,CAAA;AACtC;;;ACxBA,eAAsB,WAAA,GAAc;AAClC,EAAA,MAAM,SAAS,UAAA,EAAW;AAC1B,EAAA,MAAM,EAAE,MAAA,EAAQ,OAAA,EAAQ,GAAI,aAAa,MAAM,CAAA;AAE/C,EAAA,MAAM,MAAA,GAAS,IAAI,SAAA,CAAU;AAAA,IAC3B,IAAA,EAAM,QAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACV,CAAA;AAED,EAAA,aAAA,CAAc,MAAA,EAAQ,QAAQ,OAAO,CAAA;AAErC,EAAA,MAAM,SAAA,GAAY,IAAI,oBAAA,EAAqB;AAC3C,EAAA,MAAM,MAAA,CAAO,QAAQ,SAAS,CAAA;AAChC;;;ACfA,WAAA,EAAY,CAAE,KAAA,CAAM,CAAC,GAAA,KAAiB;AACpC,EAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,kBAAA,EAAqB,GAAG;AAAA,CAAI,CAAA;AACjD,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA","file":"index.js","sourcesContent":["/**\r\n * @fileoverview MCP process configuration from environment.\r\n *\r\n * Prefer an **issued** developer API key from the Operator Console (Developers page).\r\n * That key identifies the bound wallet for control-plane tools — no Bearer required.\r\n * `AUREON_AUTH_TOKEN` is optional (utility-style session, or when using env bootstrap keys).\r\n */\r\n\r\nimport { DEFAULT_API_BASE_URL } from \"@buildaureon/sdk\";\r\n\r\nexport interface McpConfig {\r\n apiUrl: string;\r\n apiKey: string | undefined;\r\n authToken: string | undefined;\r\n}\r\n\r\nexport function loadConfig(): McpConfig {\r\n const apiUrl = process.env.AUREON_API_URL || DEFAULT_API_BASE_URL;\r\n const apiKey = process.env.AUREON_API_KEY || undefined;\r\n const authToken = process.env.AUREON_AUTH_TOKEN || undefined;\r\n\r\n if (!apiKey && !authToken) {\r\n throw new Error(\r\n \"Set AUREON_API_KEY (issued developer key from app.aureonlabs.network Developers) \" +\r\n \"or AUREON_AUTH_TOKEN (wallet Bearer). \" +\r\n \"See https://github.com/buildaureon/aureon-mcp#authentication\"\r\n );\r\n }\r\n\r\n return { apiUrl, apiKey, authToken };\r\n}\r\n","/**\r\n * @fileoverview Builds the shared AureonClient for MCP tool handlers.\r\n */\r\n\r\nimport {\r\n createAureonClient,\r\n createSessionTokenProvider,\r\n type AureonClient,\r\n type SessionTokenProvider,\r\n} from \"@buildaureon/sdk\";\r\nimport type { McpConfig } from \"./config.js\";\r\n\r\nexport type McpClientBundle = {\r\n client: AureonClient;\r\n session: SessionTokenProvider;\r\n};\r\n\r\nexport function createClient(config: McpConfig): McpClientBundle {\r\n const session = createSessionTokenProvider(config.authToken ?? null);\r\n const client = createAureonClient({\r\n baseUrl: config.apiUrl,\r\n apiKey: config.apiKey ?? null,\r\n getAccessToken: session.getAccessToken,\r\n });\r\n return { client, session };\r\n}\r\n","export function formatJson(data: unknown): string {\r\n return JSON.stringify(data, null, 2);\r\n}\r\n","import { isAureonError } from \"@buildaureon/sdk\";\r\n\r\nexport function errorText(err: unknown): string {\r\n if (isAureonError(err)) {\r\n return `[${err.code}] ${err.message}`;\r\n }\r\n if (err instanceof Error) {\r\n return err.message;\r\n }\r\n return String(err);\r\n}\r\n","import { formatJson } from \"../format.js\";\r\nimport { errorText } from \"../errors.js\";\r\n\r\nexport function ok(data: unknown) {\r\n return { content: [{ type: \"text\" as const, text: formatJson(data) }] };\r\n}\r\n\r\nexport function fail(err: unknown) {\r\n return { content: [{ type: \"text\" as const, text: errorText(err) }], isError: true };\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerReadTools(server: McpServer, client: AureonClient) {\r\n server.tool(\"aureon_ping\", \"Health probe — confirms API connectivity\", {}, async () => {\r\n try {\r\n return ok(await client.ping());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n });\r\n\r\n server.tool(\r\n \"aureon_get_overview\",\r\n \"Dashboard overview — total AUM, objective count, aggregate health\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getOverview());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_get_portfolio\",\r\n \"Current capital book snapshot — positions, marks, weights\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getPortfolio());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\"aureon_list_objectives\", \"List all Financial Compass Objectives\", {}, async () => {\r\n try {\r\n return ok(await client.listObjectives());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n });\r\n\r\n server.tool(\r\n \"aureon_get_objective\",\r\n \"Get a single objective by ID\",\r\n { objectiveId: z.string().describe(\"The objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getObjective(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_get_health\",\r\n \"Health state for objectives — drift, breach status, policy compliance\",\r\n { objectiveId: z.string().optional().describe(\"Filter by objective ID (omit for all)\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getHealth(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_list_timeline\",\r\n \"Timeline of events — objective changes, executions, health transitions\",\r\n { objectiveId: z.string().optional().describe(\"Filter by objective ID (omit for all)\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getTimeline(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_list_market_presets\",\r\n \"Available market event simulation presets\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.listMarketPresets());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerCompassTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_get_restore_plan\",\r\n \"Restore plan for an objective — proposed rebalance steps to return to policy\",\r\n { objectiveId: z.string().describe(\"The objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getRestorePlan(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_run_execution\",\r\n \"Run restorative execution for an objective currently outside policy\",\r\n { objectiveId: z.string().describe(\"The objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.runExecution(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_restore_objective\",\r\n \"Run vault-backed restorative execution for an objective outside policy\",\r\n { objectiveId: z.string().describe(\"The objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.restoreObjective(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_list_executions\",\r\n \"Recent execution receipts — past restorative actions taken\",\r\n { objectiveId: z.string().optional().describe(\"Filter by objective ID (omit for all)\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.listExecutions(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerVaultTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_get_vault\",\r\n \"Vault overview — balances, tokens, deposit history\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getVault());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_get_vault_status\",\r\n \"Compact vault funding status — ready state before restore\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getVaultStatus());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_prepare_vault_deposit\",\r\n \"Prepare unsigned vault deposit steps. Returns calldata only — the host must sign/broadcast with a wallet private key. API key alone cannot move funds.\",\r\n {\r\n symbol: z.string().describe(\"Deposit symbol (ETH or allowlisted ERC-20)\"),\r\n amount: z.string().describe(\"Human-readable amount\"),\r\n },\r\n async ({ symbol, amount }) => {\r\n try {\r\n return ok(await client.prepareVaultDeposit({ symbol, amount }));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_prepare_vault_withdraw\",\r\n \"Prepare unsigned vault withdraw steps. Returns calldata only — host must sign/broadcast. API key alone cannot move funds.\",\r\n {\r\n symbol: z.string().optional().describe(\"Withdraw symbol (default WETH; not ETH)\"),\r\n amount: z.string().describe(\"Human-readable amount\"),\r\n },\r\n async ({ symbol, amount }) => {\r\n try {\r\n return ok(await client.prepareVaultWithdraw({ symbol, amount }));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","/**\r\n * @fileoverview Auth tools — wallet handshake is optional for MCP.\r\n *\r\n * Recommended path: issued AUREON_API_KEY identifies the wallet.\r\n * verify_wallet / dev_login update the in-process session provider when used.\r\n */\r\n\r\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient, SessionTokenProvider } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerAuthTools(\r\n server: McpServer,\r\n client: AureonClient,\r\n session: SessionTokenProvider\r\n) {\r\n server.tool(\r\n \"aureon_get_auth_nonce\",\r\n \"Request a wallet auth nonce/message for EIP-191 signing (optional — issued API keys usually skip this)\",\r\n { address: z.string().describe(\"Wallet address (0x…)\") },\r\n async ({ address }) => {\r\n try {\r\n return ok(await client.getAuthNonce(address));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_verify_wallet\",\r\n \"Verify a wallet signature and store the Bearer session for later tools in this MCP process\",\r\n {\r\n address: z.string().describe(\"Wallet address\"),\r\n message: z.string().describe(\"Signed message from get_auth_nonce\"),\r\n signature: z.string().describe(\"Wallet signature hex\"),\r\n inviteCode: z.string().optional().describe(\"Invite code if required on first login\"),\r\n },\r\n async ({ address, message, signature, inviteCode }) => {\r\n try {\r\n const login = await client.verifyWallet({\r\n address,\r\n message,\r\n signature,\r\n inviteCode,\r\n });\r\n session.setToken(login.token);\r\n return ok(login);\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_dev_login\",\r\n \"Local preview login without wallet signature (requires AUREON_ALLOW_DEV_LOGIN=1 on API — not production)\",\r\n {},\r\n async () => {\r\n try {\r\n const login = await client.devLogin();\r\n session.setToken(login.token);\r\n return ok(login);\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_logout\",\r\n \"Revoke the current Bearer session and clear the in-process token\",\r\n {},\r\n async () => {\r\n try {\r\n const result = await client.logout();\r\n session.clear();\r\n return ok(result);\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_me\",\r\n \"Return the wallet bound to the issued API key or current Bearer session\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.me());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nconst objectiveKind = z.enum([\r\n \"stable_allocation\",\r\n \"balanced_portfolio\",\r\n \"risk_ceiling\",\r\n \"reward_reinvestment\",\r\n]);\r\n\r\nconst objectivePriority = z.enum([\"low\", \"medium\", \"high\", \"critical\"]);\r\n\r\nconst automationMode = z.enum([\"auto\", \"manual\"]);\r\n\r\nexport function registerObjectiveTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_create_objective\",\r\n \"Create a Financial Compass Objective. targetSymbol and automationMode are locked after create — recreate to change them. Defaults to automationMode auto.\",\r\n {\r\n name: z.string().describe(\"Objective display name\"),\r\n kind: objectiveKind.describe(\"Objective kind\"),\r\n targetWeight: z.number().describe(\"Target portfolio weight (0–1)\"),\r\n tolerance: z.number().describe(\"Allowed drift band (0–1)\"),\r\n priority: objectivePriority.optional().describe(\"Evaluation priority\"),\r\n maxRiskScore: z.number().optional().describe(\"Max risk score ceiling\"),\r\n reinvestRatio: z\r\n .number()\r\n .optional()\r\n .describe(\"Reinvest ratio for reward objectives\"),\r\n targetSymbol: z\r\n .string()\r\n .nullable()\r\n .optional()\r\n .describe(\"Asset symbol to track (locked after create)\"),\r\n automationMode: automationMode\r\n .optional()\r\n .describe(\"auto = keeper vault restore; manual = operator Approve (locked after create)\"),\r\n },\r\n async (input) => {\r\n try {\r\n return ok(await client.createObjective(input));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_update_objective\",\r\n \"Partial update (name, weight, tolerance, priority). Cannot change targetSymbol or automationMode — recreate instead.\",\r\n {\r\n objectiveId: z.string().describe(\"Objective ID\"),\r\n name: z.string().optional(),\r\n priority: objectivePriority.optional(),\r\n targetWeight: z.number().optional(),\r\n tolerance: z.number().optional(),\r\n maxRiskScore: z.number().optional(),\r\n reinvestRatio: z.number().optional(),\r\n },\r\n async ({ objectiveId, ...input }) => {\r\n try {\r\n return ok(await client.updateObjective(objectiveId, input));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_pause_objective\",\r\n \"Pause continuous evaluation for an objective\",\r\n { objectiveId: z.string().describe(\"Objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.pauseObjective(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_resume_objective\",\r\n \"Resume evaluation for a paused objective\",\r\n { objectiveId: z.string().describe(\"Objective ID\") },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.resumeObjective(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nconst positionInput = z.object({\r\n symbol: z.string(),\r\n name: z.string(),\r\n category: z.enum([\"stable\", \"stock_token\", \"gas\", \"other\"]),\r\n quantity: z.number(),\r\n markPriceUsd: z.number(),\r\n});\r\n\r\nexport function registerPortfolioTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_set_portfolio\",\r\n \"Replace the wallet capital book with provided positions\",\r\n {\r\n positions: z.array(positionInput).min(1).describe(\"Portfolio position rows\"),\r\n },\r\n async ({ positions }) => {\r\n try {\r\n return ok(await client.setPortfolio(positions));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_clear_portfolio\",\r\n \"Clear all capital-book positions for the authenticated wallet\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.clearPortfolio());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_sync_portfolio\",\r\n \"Replace the capital book with on-chain balances for the session wallet\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.syncPortfolio());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerMarketTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_apply_market_event\",\r\n \"Apply a controlled market event to portfolio marks; optionally auto-restore\",\r\n {\r\n symbol: z.string().describe(\"Asset symbol to shock\"),\r\n priceChangeRatio: z.number().describe(\"Fractional price change (e.g. -0.15 = -15%)\"),\r\n name: z.string().optional().describe(\"Event label\"),\r\n description: z.string().optional().describe(\"Event description\"),\r\n autoRestore: z.boolean().optional().describe(\"Run restorative execution if objectives breach\"),\r\n },\r\n async (input) => {\r\n try {\r\n return ok(await client.applyMarketEvent(input));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_refresh_watchdog\",\r\n \"Refresh portfolio marks from live data and re-evaluate objectives\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.refreshWatchdog());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerDeveloperTools(server: McpServer, client: AureonClient) {\r\n server.tool(\"aureon_list_api_keys\", \"List SDK API keys for the authenticated wallet\", {}, async () => {\r\n try {\r\n return ok(await client.listApiKeys());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n });\r\n\r\n server.tool(\r\n \"aureon_create_api_key\",\r\n \"Create an SDK API key (secret returned once — store immediately)\",\r\n { name: z.string().min(2).describe(\"Key display name\") },\r\n async ({ name }) => {\r\n try {\r\n return ok(await client.createApiKey(name));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_revoke_api_key\",\r\n \"Revoke (delete) an SDK API key\",\r\n { keyId: z.string().describe(\"API key ID\") },\r\n async ({ keyId }) => {\r\n try {\r\n return ok(await client.revokeApiKey(keyId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_toggle_api_key\",\r\n \"Toggle active/paused status of an SDK API key\",\r\n { keyId: z.string().describe(\"API key ID\") },\r\n async ({ keyId }) => {\r\n try {\r\n return ok(await client.toggleApiKey(keyId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient } from \"@buildaureon/sdk\";\r\nimport { z } from \"zod\";\r\nimport { fail, ok } from \"./handler.js\";\r\n\r\nexport function registerRegistryTools(server: McpServer, client: AureonClient) {\r\n server.tool(\r\n \"aureon_registry_status\",\r\n \"Returns Phase 2 ObjectiveRegistry deployment status (testnet contract address when configured).\",\r\n {},\r\n async () => {\r\n try {\r\n return ok(await client.getRegistryStatus());\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_get_objective_registry\",\r\n \"Returns the on-chain registry record for an objective when registered.\",\r\n {\r\n objectiveId: z.string().describe(\"Objective id\"),\r\n },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.getObjectiveRegistry(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n\r\n server.tool(\r\n \"aureon_prepare_objective_registry\",\r\n \"Prepares wallet-signed calldata to register an objective on ObjectiveRegistry. The host wallet must broadcast the tx, then call confirm via SDK.\",\r\n {\r\n objectiveId: z.string().describe(\"Objective id to register on-chain\"),\r\n },\r\n async ({ objectiveId }) => {\r\n try {\r\n return ok(await client.prepareObjectiveRegistry(objectiveId));\r\n } catch (err) {\r\n return fail(err);\r\n }\r\n }\r\n );\r\n}\r\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport type { AureonClient, SessionTokenProvider } from \"@buildaureon/sdk\";\r\nimport { registerReadTools } from \"./read.js\";\r\nimport { registerCompassTools } from \"./compass.js\";\r\nimport { registerVaultTools } from \"./vault.js\";\r\nimport { registerAuthTools } from \"./auth.js\";\r\nimport { registerObjectiveTools } from \"./objectives.js\";\r\nimport { registerPortfolioTools } from \"./portfolio.js\";\r\nimport { registerMarketTools } from \"./market.js\";\r\nimport { registerDeveloperTools } from \"./developer.js\";\r\nimport { registerRegistryTools } from \"./registry.js\";\r\nimport { SDK_TOOL_NAMES, TOOL_COUNT } from \"./catalog.js\";\r\n\r\nexport { SDK_TOOL_NAMES, TOOL_COUNT };\r\n\r\n/** All AureonClient SDK methods exposed as MCP tools. */\r\nexport function registerTools(\r\n server: McpServer,\r\n client: AureonClient,\r\n session: SessionTokenProvider\r\n) {\r\n registerReadTools(server, client);\r\n registerCompassTools(server, client);\r\n registerVaultTools(server, client);\r\n registerAuthTools(server, client, session);\r\n registerObjectiveTools(server, client);\r\n registerPortfolioTools(server, client);\r\n registerMarketTools(server, client);\r\n registerDeveloperTools(server, client);\r\n registerRegistryTools(server, client);\r\n}\r\n","import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\r\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\r\nimport { loadConfig } from \"./config.js\";\r\nimport { createClient } from \"./client.js\";\r\nimport { registerTools } from \"./tools/index.js\";\r\n\r\nexport async function startServer() {\r\n const config = loadConfig();\r\n const { client, session } = createClient(config);\r\n\r\n const server = new McpServer({\r\n name: \"aureon\",\r\n version: \"0.1.1\",\r\n });\r\n\r\n registerTools(server, client, session);\r\n\r\n const transport = new StdioServerTransport();\r\n await server.connect(transport);\r\n}\r\n","import { startServer } from \"./server.js\";\r\n\r\nexport { startServer } from \"./server.js\";\r\n\r\nstartServer().catch((err: unknown) => {\r\n process.stderr.write(`aureon-mcp fatal: ${err}\\n`);\r\n process.exit(1);\r\n});\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildaureon/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "MCP server for AUREON Financial Compass: Financial Compass capital context for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"node": ">=20"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@buildaureon/sdk": "
|
|
51
|
+
"@buildaureon/sdk": "^0.1.2",
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
53
53
|
"zod": "^3.25.67"
|
|
54
54
|
},
|