@ardensh/mcp 0.1.0 → 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 +20 -28
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/fund.d.ts.map +1 -0
- package/dist/tools/fund.js.map +1 -0
- package/dist/tools/list.d.ts.map +1 -0
- package/dist/tools/list.js.map +1 -0
- package/dist/tools/provision.d.ts.map +1 -0
- package/dist/tools/provision.js.map +1 -0
- package/dist/tools/status.d.ts.map +1 -0
- package/dist/tools/status.js.map +1 -0
- package/dist/tools/update.d.ts.map +1 -0
- package/dist/tools/update.js.map +1 -0
- package/package.json +4 -3
- package/src/auth.ts +0 -14
- package/src/index.ts +0 -88
- package/src/tools/fund.ts +0 -42
- package/src/tools/list.ts +0 -53
- package/src/tools/provision.ts +0 -63
- package/src/tools/status.ts +0 -63
- package/src/tools/update.ts +0 -51
- package/tsconfig.json +0 -17
package/README.md
CHANGED
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
# @ardensh/mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Your AI agents can now pay for things — provision and manage them without leaving your AI assistant.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Arden gives each agent its own wallet and a budget. This MCP server lets you set that up via natural language in Claude Desktop, Cursor, Claude Code, or any MCP-compatible client. No CLI needed.
|
|
6
|
+
|
|
7
|
+
> "Provision a new agent called researcher with a $200 monthly budget, only allowed to call exa.ai and browserbase.io"
|
|
6
8
|
|
|
7
9
|
## Tools
|
|
8
10
|
|
|
9
11
|
| Tool | Description |
|
|
10
12
|
|---|---|
|
|
11
|
-
| `arden_provision_agent` | Create a new agent with budget limits and vendor restrictions |
|
|
12
|
-
| `arden_list_agents` | List all agents with budget usage |
|
|
13
|
+
| `arden_provision_agent` | Create a new agent with a wallet, budget limits, and vendor restrictions |
|
|
14
|
+
| `arden_list_agents` | List all agents with spend and budget usage |
|
|
13
15
|
| `arden_agent_status` | Detailed status and budget breakdown for a specific agent |
|
|
14
|
-
| `arden_update_agent` |
|
|
16
|
+
| `arden_update_agent` | Adjust an agent's budgets, allowed vendors, or pause it |
|
|
15
17
|
| `arden_fund_agent` | Get wallet address and USDC funding instructions |
|
|
16
18
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
Install the Arden CLI and log in to generate your API key:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm install -g @arden/cli
|
|
23
|
-
arden login
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
This writes your API key to `~/.arden/config.json`, which the MCP server reads automatically. You can skip the `ARDEN_API_KEY` env var if you've already done this.
|
|
19
|
+
## Setup
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
### 1. Add to Claude Desktop
|
|
29
22
|
|
|
30
|
-
Add this to
|
|
23
|
+
Add this to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
31
24
|
|
|
32
25
|
```json
|
|
33
26
|
{
|
|
@@ -43,23 +36,17 @@ Add this to your Claude Desktop config (`~/Library/Application Support/Claude/cl
|
|
|
43
36
|
}
|
|
44
37
|
```
|
|
45
38
|
|
|
46
|
-
`ARDEN_API_KEY`
|
|
39
|
+
Get your `ARDEN_API_KEY` by running `arden login` (see below), or find it at [arden.sh](https://arden.sh).
|
|
47
40
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
claude mcp add arden npx -y @ardensh/mcp
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
If you haven't run `arden login`, pass your key via env:
|
|
41
|
+
### 2. Add to Claude Code
|
|
55
42
|
|
|
56
43
|
```bash
|
|
57
44
|
claude mcp add arden -e ARDEN_API_KEY=arden_live_... npx -y @ardensh/mcp
|
|
58
45
|
```
|
|
59
46
|
|
|
60
|
-
|
|
47
|
+
### 3. Add to Cursor
|
|
61
48
|
|
|
62
|
-
Add the same block as the Claude Desktop config above to
|
|
49
|
+
Add the same block as the Claude Desktop config above to **Settings → MCP**.
|
|
63
50
|
|
|
64
51
|
## Authentication
|
|
65
52
|
|
|
@@ -68,7 +55,12 @@ The server looks for credentials in this order:
|
|
|
68
55
|
1. `ARDEN_API_KEY` environment variable
|
|
69
56
|
2. `~/.arden/config.json` (written by `arden login`)
|
|
70
57
|
|
|
71
|
-
If
|
|
58
|
+
If you've already installed the Arden CLI and run `arden login`, no env var is needed.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install -g @ardensh/cli
|
|
62
|
+
arden login
|
|
63
|
+
```
|
|
72
64
|
|
|
73
65
|
## Development
|
|
74
66
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAKA,wBAAgB,SAAS,IAAI,MAAM,CAMlC;AAED,eAAO,MAAM,QAAQ,gEAAgE,CAAA"}
|
package/dist/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,SAAS,EAAE,CAAC,CAAA;AAE/E,MAAM,UAAU,SAAS;IACvB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAA;IACzC,IAAI,OAAO;QAAE,OAAO,OAAO,CAAA;IAC3B,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAuB,CAAA;IAC5D,IAAI,UAAU;QAAE,OAAO,UAAU,CAAA;IACjC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAA;AAC/E,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,6DAA6D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,OAAO;CACjB,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,CACT,uBAAuB,EACvB,4EAA4E,EAC5E;IACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;IAChF,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC7E,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACzE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC3E,qBAAqB,EAAE,CAAC,CAAC,M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und.d.ts","sourceRoot":"","sources":["../../src/tools/fund.ts"],"names":[],"mappings":"AAQA,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fund.js","sourceRoot":"","sources":["../../src/tools/fund.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAOhD,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAc,GAAG,QAAQ,WAAW,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE;YAC9F,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE;SACjC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAA;QAClC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,UAAU,IAAI,uCAAuC,CAAA;QAC9D,CAAC;QAED,OAAO;YACL,mCAAmC,IAAI,IAAI;YAC3C,EAAE;YACF,mBAAmB,MAAM,EAAE;YAC3B,EAAE;YACF,qBAAqB;YACrB,6CAA6C;YAC7C,6CAA6C;YAC7C,sDAAsD;YACtD,EAAE;YACF,wFAAwF;YACxF,8EAA8E;SAC/E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAA;YACjF,OAAO,oCAAoC,IAAI,EAAE,CAAA;QACnD,CAAC;QACD,OAAO,oCAAoC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAA;IAC1D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AAYA,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAwClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAWhD,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAU,GAAG,QAAQ,SAAS,EAAE;YAC9D,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE;SACjC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAY,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE,IAA6B,CAAC,MAAM,IAAI,EAAE,CAAA;QAEhG,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,2DAA2D,CAAA;QACpE,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACjC,MAAM,KAAK,GAAG,KAAK,CAAC,gBAAgB,IAAI,CAAC,CAAA;YACzC,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,CAAA;YACnC,MAAM,SAAS,GA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 -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../src/tools/provision.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;CAOhC,CAAA;AAED,eAAO,MAAM,sBAAsB,sCAAuC,CAAA;AAE1E,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuC3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provision.js","sourceRoot":"","sources":["../../src/tools/provision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEhD,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,qDAAqD,EAAE;IACrG,cAAc,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,6BAA6B,EAAE;IACvF,YAAY,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,2BAA2B,EAAE;IACnF,aAAa,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,4BAA4B,EAAE;IACrF,qBAAqB,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,oCAAoC,EAAE;IACrG,eAAe,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,wDAAwD,EAAE;CACpH,CAAA;AAED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IAAI,CAAC,IAAI,CAAC,CAAA;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAA;YACjF,OAAO,8BAA8B,IAAI,EAAE,CAAA;QAC7C,CAAC;QACD,OAAO,8BAA8B,MAAM,CAAC,GAAG,CAAC,EAAE,CAAA;IACpD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/tools/status.ts"],"names":[],"mappings":"AAmCA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA2B/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/tools/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAmBhD,SAAS,kBAAkB,CAAC,KAAa,EAAE,MAAe;IACxD,IAAI,CAAC,MAAM;QAAE,OAAO,GAAG,KAAK,WAAW,CAAA;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;IACrE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IACpE,MAAM,SAAS,GACb,MAAM,CAAC,KA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QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;YAChD,4BAA4B,IAAI,CAAC,qBAAqB,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EAAE;SACtH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAA;YACjF,OAAO,+BAA+B,IAAI,EAAE,CAAA;QAC9C,CAAC;QACD,OAAO,+BAA+B,MAAM,CAAC,GAAG,CAAC,EAAE,CAAA;IACrD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/tools/update.ts"],"names":[],"mappings":"AAGA,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAsB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAqCrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/tools/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAA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AC,IAAI,CAAC,CAAA;QACb,OAAO,UAAU,IAAI,4BAA4B,OAAO,EAAE,CAAA;IAC5D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAA;YACnC,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAA;YAC/B,IAAI,MAAM,KAAK,GAAG;gBAAE,OAAO,UAAU,IAAI,cAAc,CAAA;YACvD,IAAI,MAAM,KAAK,GAAG;gBAAE,OAAO,gBAAgB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE,CAAA;YAClH,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG;gBAAE,OAAO,4DAA4D,CAAA;YACzG,OAAO,2BAA2B,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE,CAAA;QAC3G,CAAC;QACD,OAAO,2BAA2B,MAAM,CAAC,GAAG,CAAC,EAAE,CAAA;IACjD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ardensh/mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Give your AI agents a wallet and a budget from Claude, Cursor, or any MCP client. Provision agents, set spend limits, and manage vendor allowlists via natural language.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"files": ["dist"],
|
|
6
7
|
"bin": {
|
|
7
|
-
"
|
|
8
|
+
"ardensh-mcp": "./dist/index.js"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
11
|
"build": "tsc",
|
package/src/auth.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Conf from 'conf'
|
|
2
|
-
import os from 'os'
|
|
3
|
-
|
|
4
|
-
const store = new Conf({ projectName: 'arden', cwd: os.homedir() + '/.arden' })
|
|
5
|
-
|
|
6
|
-
export function getApiKey(): string {
|
|
7
|
-
const fromEnv = process.env.ARDEN_API_KEY
|
|
8
|
-
if (fromEnv) return fromEnv
|
|
9
|
-
const fromConfig = store.get('apiKey') as string | undefined
|
|
10
|
-
if (fromConfig) return fromConfig
|
|
11
|
-
throw new Error('Not authenticated. Set ARDEN_API_KEY or run `arden login`.')
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const API_BASE = 'https://ir7hdqp3ei.execute-api.us-east-1.amazonaws.com/prod'
|
package/src/index.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
3
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
4
|
-
import { z } from 'zod'
|
|
5
|
-
import { provisionAgent } from './tools/provision.js'
|
|
6
|
-
import { listAgents } from './tools/list.js'
|
|
7
|
-
import { agentStatus } from './tools/status.js'
|
|
8
|
-
import { fundAgent } from './tools/fund.js'
|
|
9
|
-
import { updateAgent } from './tools/update.js'
|
|
10
|
-
|
|
11
|
-
const server = new McpServer({
|
|
12
|
-
name: 'arden',
|
|
13
|
-
version: '0.1.0',
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
server.tool(
|
|
17
|
-
'arden_provision_agent',
|
|
18
|
-
'Provision a new Arden AI agent with spend controls and vendor restrictions',
|
|
19
|
-
{
|
|
20
|
-
name: z.string().describe('Agent name: 3-50 chars, alphanumeric + hyphens only'),
|
|
21
|
-
monthly_budget: z.number().optional().describe('Monthly spend budget in USD'),
|
|
22
|
-
daily_budget: z.number().optional().describe('Daily spend budget in USD'),
|
|
23
|
-
weekly_budget: z.number().optional().describe('Weekly spend budget in USD'),
|
|
24
|
-
per_transaction_limit: z.number().optional().describe('Per-transaction spend limit in USD'),
|
|
25
|
-
allowed_vendors: z
|
|
26
|
-
.string()
|
|
27
|
-
.describe('Comma-separated vendor domains, or "*" for all vendors'),
|
|
28
|
-
},
|
|
29
|
-
async (input) => {
|
|
30
|
-
const text = await provisionAgent(input)
|
|
31
|
-
return { content: [{ type: 'text', text }] }
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
server.tool(
|
|
36
|
-
'arden_list_agents',
|
|
37
|
-
'List all Arden agents with their status and budget usage',
|
|
38
|
-
{},
|
|
39
|
-
async () => {
|
|
40
|
-
const text = await listAgents()
|
|
41
|
-
return { content: [{ type: 'text', text }] }
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
server.tool(
|
|
46
|
-
'arden_agent_status',
|
|
47
|
-
'Get detailed status and budget breakdown for a specific Arden agent',
|
|
48
|
-
{
|
|
49
|
-
name: z.string().describe('Name of the agent to inspect'),
|
|
50
|
-
},
|
|
51
|
-
async ({ name }) => {
|
|
52
|
-
const text = await agentStatus(name)
|
|
53
|
-
return { content: [{ type: 'text', text }] }
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
server.tool(
|
|
58
|
-
'arden_fund_agent',
|
|
59
|
-
'Get wallet address and funding instructions for an Arden agent',
|
|
60
|
-
{
|
|
61
|
-
name: z.string().describe('Name of the agent to fund'),
|
|
62
|
-
},
|
|
63
|
-
async ({ name }) => {
|
|
64
|
-
const text = await fundAgent(name)
|
|
65
|
-
return { content: [{ type: 'text', text }] }
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
server.tool(
|
|
70
|
-
'arden_update_agent',
|
|
71
|
-
"Update an existing agent's budget limits, allowed vendors, or status",
|
|
72
|
-
{
|
|
73
|
-
name: z.string().describe('Name of the agent to update'),
|
|
74
|
-
monthly_budget: z.number().optional().describe('New monthly budget in USD'),
|
|
75
|
-
daily_budget: z.number().optional().describe('New daily budget in USD'),
|
|
76
|
-
weekly_budget: z.number().optional().describe('New weekly budget in USD'),
|
|
77
|
-
per_transaction_limit: z.number().optional().describe('New per-transaction limit in USD'),
|
|
78
|
-
allowed_vendors: z.string().optional().describe('Comma-separated vendor domains, or "*" for all'),
|
|
79
|
-
status: z.enum(['active', 'paused']).optional().describe('Set agent status to active or paused'),
|
|
80
|
-
},
|
|
81
|
-
async (input) => {
|
|
82
|
-
const text = await updateAgent(input)
|
|
83
|
-
return { content: [{ type: 'text', text }] }
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
const transport = new StdioServerTransport()
|
|
88
|
-
await server.connect(transport)
|
package/src/tools/fund.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import axios from 'axios'
|
|
2
|
-
import { getApiKey, API_BASE } from '../auth.js'
|
|
3
|
-
|
|
4
|
-
interface AgentDetail {
|
|
5
|
-
wallet_address?: string
|
|
6
|
-
[key: string]: unknown
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export async function fundAgent(name: string): Promise<string> {
|
|
10
|
-
const apiKey = getApiKey()
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
const { data } = await axios.get<AgentDetail>(`${API_BASE}/agents/${encodeURIComponent(name)}`, {
|
|
14
|
-
headers: { 'X-API-Key': apiKey },
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
const wallet = data.wallet_address
|
|
18
|
-
if (!wallet) {
|
|
19
|
-
return `Agent "${name}" does not have a wallet address yet.`
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return [
|
|
23
|
-
`Funding instructions for agent "${name}":`,
|
|
24
|
-
'',
|
|
25
|
-
`Wallet address: ${wallet}`,
|
|
26
|
-
'',
|
|
27
|
-
'To fund this agent:',
|
|
28
|
-
' 1. Send USDC to the wallet address above.',
|
|
29
|
-
' 2. Network: Base mainnet (chain ID 8453).',
|
|
30
|
-
' 3. Token: USDC (native USDC on Base, not bridged).',
|
|
31
|
-
'',
|
|
32
|
-
'The agent will use this wallet for x402 payments when making API calls on your behalf.',
|
|
33
|
-
'Funds are available immediately after the transaction is confirmed on-chain.',
|
|
34
|
-
].join('\n')
|
|
35
|
-
} catch (err) {
|
|
36
|
-
if (axios.isAxiosError(err)) {
|
|
37
|
-
const body = err.response?.data ? JSON.stringify(err.response.data) : err.message
|
|
38
|
-
return `Failed to retrieve agent wallet: ${body}`
|
|
39
|
-
}
|
|
40
|
-
return `Failed to retrieve agent wallet: ${String(err)}`
|
|
41
|
-
}
|
|
42
|
-
}
|
package/src/tools/list.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import axios from 'axios'
|
|
2
|
-
import { getApiKey, API_BASE } from '../auth.js'
|
|
3
|
-
|
|
4
|
-
interface Agent {
|
|
5
|
-
name: string
|
|
6
|
-
status: string
|
|
7
|
-
monthly_budget?: number
|
|
8
|
-
spent_this_month?: number
|
|
9
|
-
wallet_address?: string
|
|
10
|
-
[key: string]: unknown
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export async function listAgents(): Promise<string> {
|
|
14
|
-
const apiKey = getApiKey()
|
|
15
|
-
|
|
16
|
-
try {
|
|
17
|
-
const { data } = await axios.get<Agent[]>(`${API_BASE}/agents`, {
|
|
18
|
-
headers: { 'X-API-Key': apiKey },
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const agents: Agent[] = Array.isArray(data) ? data : (data as { agents?: Agent[] }).agents ?? []
|
|
22
|
-
|
|
23
|
-
if (agents.length === 0) {
|
|
24
|
-
return 'No agents found. Use arden_provision_agent to create one.'
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const lines = agents.map((agent) => {
|
|
28
|
-
const spent = agent.spent_this_month ?? 0
|
|
29
|
-
const budget = agent.monthly_budget
|
|
30
|
-
const remaining = budget !== undefined ? budget - spent : undefined
|
|
31
|
-
const pct =
|
|
32
|
-
budget !== undefined && budget > 0 ? ((spent / budget) * 100).toFixed(1) + '%' : 'N/A'
|
|
33
|
-
|
|
34
|
-
return [
|
|
35
|
-
`Name: ${agent.name}`,
|
|
36
|
-
`Status: ${agent.status}`,
|
|
37
|
-
`Monthly budget: ${budget !== undefined ? '$' + budget : 'N/A'}`,
|
|
38
|
-
`Spent this month: $${spent}`,
|
|
39
|
-
`Remaining: ${remaining !== undefined ? '$' + remaining : 'N/A'}`,
|
|
40
|
-
`% Used: ${pct}`,
|
|
41
|
-
`Wallet: ${agent.wallet_address ?? 'N/A'}`,
|
|
42
|
-
].join('\n')
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
return lines.join('\n\n---\n\n')
|
|
46
|
-
} catch (err) {
|
|
47
|
-
if (axios.isAxiosError(err)) {
|
|
48
|
-
const body = err.response?.data ? JSON.stringify(err.response.data) : err.message
|
|
49
|
-
return `Failed to list agents: ${body}`
|
|
50
|
-
}
|
|
51
|
-
return `Failed to list agents: ${String(err)}`
|
|
52
|
-
}
|
|
53
|
-
}
|
package/src/tools/provision.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import axios from 'axios'
|
|
2
|
-
import { getApiKey, API_BASE } from '../auth.js'
|
|
3
|
-
|
|
4
|
-
export const provisionAgentSchema = {
|
|
5
|
-
name: { type: 'string' as const, description: 'Agent name: 3-50 chars, alphanumeric + hyphens only' },
|
|
6
|
-
monthly_budget: { type: 'number' as const, description: 'Monthly spend budget in USD' },
|
|
7
|
-
daily_budget: { type: 'number' as const, description: 'Daily spend budget in USD' },
|
|
8
|
-
weekly_budget: { type: 'number' as const, description: 'Weekly spend budget in USD' },
|
|
9
|
-
per_transaction_limit: { type: 'number' as const, description: 'Per-transaction spend limit in USD' },
|
|
10
|
-
allowed_vendors: { type: 'string' as const, description: 'Comma-separated vendor domains, or "*" for all vendors' },
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const provisionAgentRequired = ['name', 'allowed_vendors'] as const
|
|
14
|
-
|
|
15
|
-
interface ProvisionInput {
|
|
16
|
-
name: string
|
|
17
|
-
monthly_budget?: number
|
|
18
|
-
daily_budget?: number
|
|
19
|
-
weekly_budget?: number
|
|
20
|
-
per_transaction_limit?: number
|
|
21
|
-
allowed_vendors: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export async function provisionAgent(input: ProvisionInput): Promise<string> {
|
|
25
|
-
const { name, monthly_budget, daily_budget, weekly_budget, per_transaction_limit, allowed_vendors } = input
|
|
26
|
-
|
|
27
|
-
if (!/^[a-zA-Z0-9-]{3,50}$/.test(name)) {
|
|
28
|
-
return 'Invalid agent name. Must be 3-50 characters, alphanumeric and hyphens only.'
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (!monthly_budget && !daily_budget && !weekly_budget) {
|
|
32
|
-
return 'At least one budget field is required: monthly_budget, daily_budget, or weekly_budget.'
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const apiKey = getApiKey()
|
|
36
|
-
|
|
37
|
-
const body: Record<string, unknown> = { name, allowed_vendors }
|
|
38
|
-
if (monthly_budget !== undefined) body.monthly_budget = monthly_budget
|
|
39
|
-
if (daily_budget !== undefined) body.daily_budget = daily_budget
|
|
40
|
-
if (weekly_budget !== undefined) body.weekly_budget = weekly_budget
|
|
41
|
-
if (per_transaction_limit !== undefined) body.per_transaction_limit = per_transaction_limit
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
const { data } = await axios.post(`${API_BASE}/agents`, body, {
|
|
45
|
-
headers: { 'X-API-Key': apiKey },
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const { wallet_address, agent_key } = data
|
|
49
|
-
return [
|
|
50
|
-
`Agent "${name}" provisioned successfully.`,
|
|
51
|
-
`Wallet address: ${wallet_address}`,
|
|
52
|
-
`Agent API key: ${agent_key}`,
|
|
53
|
-
'',
|
|
54
|
-
'IMPORTANT: Save the agent API key — it will not be shown again.',
|
|
55
|
-
].join('\n')
|
|
56
|
-
} catch (err) {
|
|
57
|
-
if (axios.isAxiosError(err)) {
|
|
58
|
-
const body = err.response?.data ? JSON.stringify(err.response.data) : err.message
|
|
59
|
-
return `Failed to provision agent: ${body}`
|
|
60
|
-
}
|
|
61
|
-
return `Failed to provision agent: ${String(err)}`
|
|
62
|
-
}
|
|
63
|
-
}
|
package/src/tools/status.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import axios from 'axios'
|
|
2
|
-
import { getApiKey, API_BASE } from '../auth.js'
|
|
3
|
-
|
|
4
|
-
interface Budget {
|
|
5
|
-
limit?: number
|
|
6
|
-
spent?: number
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface AgentDetail {
|
|
10
|
-
name: string
|
|
11
|
-
status: string
|
|
12
|
-
wallet_address?: string
|
|
13
|
-
allowed_vendors?: string
|
|
14
|
-
monthly?: Budget
|
|
15
|
-
daily?: Budget
|
|
16
|
-
weekly?: Budget
|
|
17
|
-
per_transaction_limit?: number
|
|
18
|
-
[key: string]: unknown
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function formatBudgetWindow(label: string, window?: Budget): string {
|
|
22
|
-
if (!window) return `${label}: not set`
|
|
23
|
-
const limit = window.limit !== undefined ? '$' + window.limit : 'N/A'
|
|
24
|
-
const spent = window.spent !== undefined ? '$' + window.spent : '$0'
|
|
25
|
-
const remaining =
|
|
26
|
-
window.limit !== undefined && window.spent !== undefined
|
|
27
|
-
? '$' + (window.limit - window.spent)
|
|
28
|
-
: 'N/A'
|
|
29
|
-
const pct =
|
|
30
|
-
window.limit !== undefined && window.limit > 0 && window.spent !== undefined
|
|
31
|
-
? ((window.spent / window.limit) * 100).toFixed(1) + '%'
|
|
32
|
-
: 'N/A'
|
|
33
|
-
return `${label}: limit=${limit}, spent=${spent}, remaining=${remaining}, used=${pct}`
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export async function agentStatus(name: string): Promise<string> {
|
|
37
|
-
const apiKey = getApiKey()
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
const { data } = await axios.get<AgentDetail>(`${API_BASE}/agents/${encodeURIComponent(name)}`, {
|
|
41
|
-
headers: { 'X-API-Key': apiKey },
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
return [
|
|
45
|
-
`Agent: ${data.name}`,
|
|
46
|
-
`Status: ${data.status}`,
|
|
47
|
-
`Wallet: ${data.wallet_address ?? 'N/A'}`,
|
|
48
|
-
`Allowed vendors: ${data.allowed_vendors ?? 'N/A'}`,
|
|
49
|
-
'',
|
|
50
|
-
'Budget windows:',
|
|
51
|
-
' ' + formatBudgetWindow('Monthly', data.monthly),
|
|
52
|
-
' ' + formatBudgetWindow('Daily', data.daily),
|
|
53
|
-
' ' + formatBudgetWindow('Weekly', data.weekly),
|
|
54
|
-
` Per-transaction limit: ${data.per_transaction_limit !== undefined ? '$' + data.per_transaction_limit : 'not set'}`,
|
|
55
|
-
].join('\n')
|
|
56
|
-
} catch (err) {
|
|
57
|
-
if (axios.isAxiosError(err)) {
|
|
58
|
-
const body = err.response?.data ? JSON.stringify(err.response.data) : err.message
|
|
59
|
-
return `Failed to get agent status: ${body}`
|
|
60
|
-
}
|
|
61
|
-
return `Failed to get agent status: ${String(err)}`
|
|
62
|
-
}
|
|
63
|
-
}
|
package/src/tools/update.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import axios from 'axios'
|
|
2
|
-
import { getApiKey, API_BASE } from '../auth.js'
|
|
3
|
-
|
|
4
|
-
interface UpdateInput {
|
|
5
|
-
name: string
|
|
6
|
-
monthly_budget?: number
|
|
7
|
-
daily_budget?: number
|
|
8
|
-
weekly_budget?: number
|
|
9
|
-
per_transaction_limit?: number
|
|
10
|
-
allowed_vendors?: string
|
|
11
|
-
status?: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export async function updateAgent(input: UpdateInput): Promise<string> {
|
|
15
|
-
const { name, monthly_budget, daily_budget, weekly_budget, per_transaction_limit, allowed_vendors, status } = input
|
|
16
|
-
|
|
17
|
-
const body: Record<string, unknown> = {}
|
|
18
|
-
if (monthly_budget !== undefined) body.monthly_budget = monthly_budget
|
|
19
|
-
if (daily_budget !== undefined) body.daily_budget = daily_budget
|
|
20
|
-
if (weekly_budget !== undefined) body.weekly_budget = weekly_budget
|
|
21
|
-
if (per_transaction_limit !== undefined) body.per_transaction_limit = per_transaction_limit
|
|
22
|
-
if (allowed_vendors !== undefined) body.allowed_vendors = allowed_vendors
|
|
23
|
-
if (status !== undefined) body.status = status
|
|
24
|
-
|
|
25
|
-
if (Object.keys(body).length === 0) {
|
|
26
|
-
return 'Provide at least one field to update.'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const apiKey = getApiKey()
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
await axios.patch(`${API_BASE}/agents/${encodeURIComponent(name)}`, body, {
|
|
33
|
-
headers: { 'X-API-Key': apiKey },
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
const changed = Object.entries(body)
|
|
37
|
-
.map(([k, v]) => ` ${k}: ${v}`)
|
|
38
|
-
.join('\n')
|
|
39
|
-
return `Agent "${name}" updated successfully:\n${changed}`
|
|
40
|
-
} catch (err) {
|
|
41
|
-
if (axios.isAxiosError(err)) {
|
|
42
|
-
const status = err.response?.status
|
|
43
|
-
const data = err.response?.data
|
|
44
|
-
if (status === 404) return `Agent '${name}' not found.`
|
|
45
|
-
if (status === 400) return `Bad request: ${typeof data === 'object' ? JSON.stringify(data) : data ?? err.message}`
|
|
46
|
-
if (status === 401 || status === 403) return 'Not authenticated. Set ARDEN_API_KEY or run `arden login`.'
|
|
47
|
-
return `Failed to update agent: ${typeof data === 'object' ? JSON.stringify(data) : data ?? err.message}`
|
|
48
|
-
}
|
|
49
|
-
return `Failed to update agent: ${String(err)}`
|
|
50
|
-
}
|
|
51
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"declarationMap": true,
|
|
13
|
-
"sourceMap": true
|
|
14
|
-
},
|
|
15
|
-
"include": ["src/**/*"],
|
|
16
|
-
"exclude": ["node_modules", "dist"]
|
|
17
|
-
}
|