44[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-blue.svg )] ( LICENSE )
55[ ![ CI] ( https://github.com/Abstract-Foundation/agw-mcp/actions/workflows/ci.yml/badge.svg )] ( https://github.com/Abstract-Foundation/agw-mcp/actions/workflows/ci.yml )
66
7- MCP server for [ Abstract Global Wallet ] ( https://abs.xyz ) session-key workflows — scoped wallet actions without custodial signing .
7+ MCP server for Abstract wallet, chain, and Portal API data .
88
99## Quick Start
1010
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-
2511``` bash
2612npx -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
4313npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
4414```
4515
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+
4618## Client Configuration
4719
4820### Claude Code
@@ -51,46 +23,6 @@ npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
5123claude mcp add agw -- npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
5224```
5325
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-
9426### Generate config snippet
9527
9628``` bash
@@ -101,70 +33,59 @@ npx -y @abstract-foundation/agw-mcp config --npx --chain-id 2741
10133
10234| Tool | Description |
10335| ------| -------------|
104- | ` get_wallet_address ` | Returns AGW account address from local session |
105- | ` get_balances ` | Native + ERC-20 balances with formatted amounts |
106- | ` get_token_list ` | Wallet ERC-20 holdings via network discovery |
107- | ` get_session_status ` | On-chain session state + local expiry metadata |
108- | ` sign_message ` | Signs UTF-8 message via session signer |
109- | ` sign_transaction ` | Signs EVM transaction, returns signed payload (no broadcast) |
110- | ` preview_transaction ` | Impact/risk preview without signing |
111- | ` send_transaction ` | Preview by default, broadcast on ` execute: true ` |
112- | ` send_calls ` | EIP-5792 batch call execution |
113- | ` transfer_token ` | Native/ERC-20 transfer with policy checks |
114- | ` swap_tokens ` | 0x quote + execute via session key |
115- | ` write_contract ` | Contract write with target/selector policy validation |
116- | ` deploy_contract ` | Contract deployment with ABI/bytecode validation |
117- | ` revoke_session ` | Revoke session key, invalidate local session |
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.)
11853
11954## Network Configuration
12055
121- Defaults to Abstract mainnet (chain ID ` 2741 ` ). Override RPC or switch to testnet when needed:
56+ Defaults to Abstract mainnet (` 2741 ` ).
12257
12358``` bash
12459# Mainnet
12560npx -y @abstract-foundation/agw-mcp serve --chain-id 2741
12661
12762# Custom RPC
12863npx -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
13264```
13365
134- Environment variables are also supported :
66+ Environment variables:
13567
13668``` bash
13769AGW_MCP_CHAIN_ID=2741 npx -y @abstract-foundation/agw-mcp serve
13870AGW_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
14071AGW_MCP_APP_URL=https://mcp.abs.xyz npx -y @abstract-foundation/agw-mcp init --chain-id 2741
14172```
14273
143- ` init ` requires ` https:// ` app URLs except for loopback local development URLs (` http://localhost ` , ` http://127.0.0.1 ` , ` http://[::1] ` ).
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] ` ).
14575
14676For local hosted-app development:
14777
14878``` bash
14979npx -y @abstract-foundation/agw-mcp init --chain-id 2741 --app-url http://localhost:3001
15080```
15181
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)
16383
164- 1 . Use a trusted onboarding host (` --app-url ` or ` AGW_MCP_APP_URL ` ) and pin it in deployment config.
165- 2 . Start with minimal intent scope (prefer payments-only) and shortest practical expiry.
166- 3 . Keep ` execute ` off by default and run preview-first workflows where possible.
167- 4 . Revoke sessions after task completion (` revoke_session ` ) and confirm status with ` get_session_status ` .
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.
16889
16990## Development
17091
0 commit comments