@abstract-foundation/agw-mcp 0.1.0-beta.8 → 0.1.0
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 +29 -108
- package/dist/index.mjs +948 -2461
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -4,45 +4,17 @@
|
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://github.com/Abstract-Foundation/agw-mcp/actions/workflows/ci.yml)
|
|
6
6
|
|
|
7
|
-
MCP server for
|
|
7
|
+
MCP server for Abstract wallet, chain, and Portal API data.
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
11
|
-
```bash
|
|
12
|
-
npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Or add it to Claude Code directly:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
claude mcp add agw -- npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Setup
|
|
22
|
-
|
|
23
|
-
### 1. Bootstrap a session
|
|
24
|
-
|
|
25
11
|
```bash
|
|
26
12
|
npx -y @abstract-foundation/agw-mcp init --chain-id 2741
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
This opens the hosted onboarding app (`https://mcp.abs.xyz` by default) where you:
|
|
30
|
-
|
|
31
|
-
1. Choose a policy preset (or provide custom policy JSON)
|
|
32
|
-
2. Connect your Abstract Global Wallet
|
|
33
|
-
3. Approve the session key
|
|
34
|
-
|
|
35
|
-
Session data is saved to `~/.agw-mcp/session.json` with `0o600` file permissions. The session signer key is stored separately in `~/.agw-mcp/session-signer.key`.
|
|
36
|
-
If a previous active session exists locally, the CLI attempts to revoke it on-chain after creating the new one.
|
|
37
|
-
Bootstrap is single-process per storage directory (lockfile: `~/.agw-mcp/.bootstrap-init.lock`) to prevent concurrent `init` races.
|
|
38
|
-
When local sessions are revoked/cleared, the signer keyfile is deleted as part of local cleanup.
|
|
39
|
-
|
|
40
|
-
### 2. Start the MCP server
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
13
|
npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
|
|
44
14
|
```
|
|
45
15
|
|
|
16
|
+
`init` opens the hosted onboarding app (`https://mcp.abs.xyz` by default), links your wallet address for local context, and writes `~/.agw-mcp/session.json`.
|
|
17
|
+
|
|
46
18
|
## Client Configuration
|
|
47
19
|
|
|
48
20
|
### Claude Code
|
|
@@ -51,46 +23,6 @@ npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
|
|
|
51
23
|
claude mcp add agw -- npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
|
|
52
24
|
```
|
|
53
25
|
|
|
54
|
-
### Claude Desktop
|
|
55
|
-
|
|
56
|
-
Add to your `claude_desktop_config.json`:
|
|
57
|
-
|
|
58
|
-
<details>
|
|
59
|
-
<summary>macOS: ~/Library/Application Support/Claude/claude_desktop_config.json</summary>
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"mcpServers": {
|
|
64
|
-
"agw-mcp": {
|
|
65
|
-
"command": "npx",
|
|
66
|
-
"args": ["-y", "@abstract-foundation/agw-mcp", "serve", "--chain-id", "2741"]
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
</details>
|
|
73
|
-
|
|
74
|
-
<details>
|
|
75
|
-
<summary>Windows: %APPDATA%\Claude\claude_desktop_config.json</summary>
|
|
76
|
-
|
|
77
|
-
```json
|
|
78
|
-
{
|
|
79
|
-
"mcpServers": {
|
|
80
|
-
"agw-mcp": {
|
|
81
|
-
"command": "npx",
|
|
82
|
-
"args": ["-y", "@abstract-foundation/agw-mcp", "serve", "--chain-id", "2741"]
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
</details>
|
|
89
|
-
|
|
90
|
-
### Cursor / Windsurf
|
|
91
|
-
|
|
92
|
-
Use the same JSON block as Claude Desktop in your editor's MCP configuration file.
|
|
93
|
-
|
|
94
26
|
### Generate config snippet
|
|
95
27
|
|
|
96
28
|
```bash
|
|
@@ -101,24 +33,27 @@ npx -y @abstract-foundation/agw-mcp config --npx --chain-id 2741
|
|
|
101
33
|
|
|
102
34
|
| Tool | Description |
|
|
103
35
|
|------|-------------|
|
|
104
|
-
| `get_wallet_address` | Returns AGW account address from local session |
|
|
105
|
-
| `get_balances` |
|
|
106
|
-
| `get_token_list` |
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
36
|
+
| `get_wallet_address` | Returns the linked AGW account address from local session storage |
|
|
37
|
+
| `get_balances` | Returns native and ERC-20 balances |
|
|
38
|
+
| `get_token_list` | Returns wallet ERC-20 holdings |
|
|
39
|
+
| `portal_list_apps` | Lists Portal apps (`/api/v1/app/`) |
|
|
40
|
+
| `portal_get_app` | Fetches Portal app detail (`/api/v1/app/{id}/`) |
|
|
41
|
+
| `portal_list_streams` | Lists streams for a Portal app (`/api/v1/streams/{app}/`) |
|
|
42
|
+
| `portal_get_user_profile` | Fetches Portal user profile (`/api/v1/user/profile/{address}/`) |
|
|
43
|
+
| `abstract_rpc_call` | Calls supported Abstract JSON-RPC methods |
|
|
44
|
+
|
|
45
|
+
### `abstract_rpc_call` constraints
|
|
46
|
+
|
|
47
|
+
Blocked by design in v0:
|
|
48
|
+
- `eth_sendRawTransaction`
|
|
49
|
+
- `zks_sendRawTransactionWithDetailedOutput`
|
|
50
|
+
- `debug_*`
|
|
51
|
+
- `eth_subscribe`, `eth_unsubscribe`
|
|
52
|
+
- filter lifecycle methods (`eth_newFilter`, `eth_getFilterChanges`, etc.)
|
|
118
53
|
|
|
119
54
|
## Network Configuration
|
|
120
55
|
|
|
121
|
-
Defaults to Abstract mainnet (
|
|
56
|
+
Defaults to Abstract mainnet (`2741`).
|
|
122
57
|
|
|
123
58
|
```bash
|
|
124
59
|
# Mainnet
|
|
@@ -126,22 +61,17 @@ npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
|
|
|
126
61
|
|
|
127
62
|
# Custom RPC
|
|
128
63
|
npx -y @abstract-foundation/agw-mcp serve --chain-id 2741 --rpc-url https://api.mainnet.abs.xyz
|
|
129
|
-
|
|
130
|
-
# 0x API key override (for swap_tokens quote requests)
|
|
131
|
-
npx -y @abstract-foundation/agw-mcp serve --chain-id 2741 --zeroex-api-key YOUR_0X_API_KEY
|
|
132
64
|
```
|
|
133
65
|
|
|
134
|
-
Environment variables
|
|
66
|
+
Environment variables:
|
|
135
67
|
|
|
136
68
|
```bash
|
|
137
69
|
AGW_MCP_CHAIN_ID=2741 npx -y @abstract-foundation/agw-mcp serve
|
|
138
70
|
AGW_MCP_RPC_URL=https://api.mainnet.abs.xyz npx -y @abstract-foundation/agw-mcp serve
|
|
139
|
-
AGW_MCP_ZEROEX_API_KEY=YOUR_0X_API_KEY npx -y @abstract-foundation/agw-mcp serve
|
|
140
71
|
AGW_MCP_APP_URL=https://mcp.abs.xyz npx -y @abstract-foundation/agw-mcp init --chain-id 2741
|
|
141
72
|
```
|
|
142
73
|
|
|
143
|
-
`init` requires `https://` app URLs except
|
|
144
|
-
`init` defaults to `https://mcp.abs.xyz` if no app URL is configured via `--app-url` or `AGW_MCP_APP_URL`.
|
|
74
|
+
`init` requires `https://` app URLs except loopback (`http://localhost`, `http://127.0.0.1`, `http://[::1]`).
|
|
145
75
|
|
|
146
76
|
For local hosted-app development:
|
|
147
77
|
|
|
@@ -149,22 +79,13 @@ For local hosted-app development:
|
|
|
149
79
|
npx -y @abstract-foundation/agw-mcp init --chain-id 2741 --app-url http://localhost:3001
|
|
150
80
|
```
|
|
151
81
|
|
|
152
|
-
## Security Model
|
|
153
|
-
|
|
154
|
-
- **Non-custodial**: Session keys are scoped and time-limited. No full wallet access.
|
|
155
|
-
- **Default-deny policies**: Write tools fail unless a matching policy explicitly allows the target address, function selector, or transfer amount.
|
|
156
|
-
- **Local-only transport**: stdio MCP — no network exposure. Session signer keys never leave the machine.
|
|
157
|
-
- **Restrictive file permissions**: Session storage directory `0o700`, files `0o600`.
|
|
158
|
-
- **Stderr-only logging**: stdout is reserved for MCP stdio transport. All operational logs go to stderr.
|
|
159
|
-
|
|
160
|
-
### Real Funds Checklist
|
|
161
|
-
|
|
162
|
-
For production usage with real money:
|
|
82
|
+
## Security Model (v0)
|
|
163
83
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
84
|
+
- **Scoped MCP surface**: no signing, transfers, swaps, deploys, or session-key actions exposed.
|
|
85
|
+
- **No delegated signer provisioning in onboarding**: local context stores wallet address + chain only.
|
|
86
|
+
- **Local-only transport**: stdio MCP (no network listener).
|
|
87
|
+
- **Restrictive file permissions**: storage dir `0o700`, files `0o600`.
|
|
88
|
+
- **Stderr-only logging**: stdout is reserved for MCP transport.
|
|
168
89
|
|
|
169
90
|
## Development
|
|
170
91
|
|