@goplausible/algorand-mcp 4.2.8 → 4.2.9

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.
Files changed (2) hide show
  1. package/README.md +41 -40
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -13,7 +13,7 @@ Algorand is a carbon-negative, pure proof-of-stake Layer 1 blockchain with insta
13
13
 
14
14
  ## Features
15
15
 
16
- - Secure wallet management via OS keychain private keys never exposed to agents or LLMs
16
+ - Agent wallet mnemonics stored in a local SQLite database, used by the MCP server to sign on the agent's behalf (mnemonics never returned in tool responses)
17
17
  - Wallet accounts with human-readable nicknames
18
18
  - Account creation, key management, and rekeying
19
19
  - Transaction building, signing, and submission (payments, assets, applications, key registration)
@@ -268,57 +268,58 @@ If no `network` is provided, tools default to **mainnet**.
268
268
 
269
269
  API responses are automatically paginated. Every tool accepts an optional `itemsPerPage` parameter (default: 10). Pass the `pageToken` from a previous response to fetch the next page.
270
270
 
271
- ## Secure Wallet
271
+ ## Agent Wallet
272
272
 
273
273
  ### Architecture
274
274
 
275
- The wallet system has two layers of storage, each with a distinct security role:
275
+ The agent wallet is a local SQLite database that the MCP server controls on the agent's behalf. The server holds the mnemonics and signs transactions for the agent — the agent never sees the mnemonics in any tool response.
276
276
 
277
- | Layer | What it stores | Where | Encryption |
278
- |---|---|---|---|
279
- | **OS Keychain** | Mnemonics (secret keys) | macOS Keychain / Linux libsecret / Windows Credential Manager | OS-managed, hardware-backed where available |
280
- | **Embedded SQLite** | Account metadata (nicknames, active-account index) | `~/.algorand-mcp/wallet.db` | Plaintext (no secrets) |
277
+ | Layer | What it stores | Where |
278
+ |---|---|---|
279
+ | **SQLite (`wallet.db`)** | Account rows (`address`, `public_key`, `nickname`, `mnemonic`, `created_at`) and the active-account index | `~/.algorand-mcp/wallet.db` (mode `0600`) |
281
280
 
282
- **Private key material never appears in tool responses, MCP config files, environment variables, or logs.** The agent only sees addresses, public keys, and signed transaction blobs.
281
+ **Threat model.** The wallet.db file is the secret. Anyone with read access to it can recover every mnemonic stored in the wallet. The mitigations are filesystem permissions (`0600`, owner-only), keeping the data directory off shared/world-readable volumes, and treating the data directory like any other secret store (snapshot it carefully, restrict backups, encrypt the host disk for at-rest protection). For Docker deployments, mount `~/.algorand-mcp` as a named volume and restrict access to it like you would any secret material.
283
282
 
284
283
  ### How it works
285
284
 
286
285
  ```
287
- Agent (LLM) MCP Server Storage
288
- ────────── ────────── ───────
289
- │ │
290
- │ wallet_add_account │
291
- │ { nickname: "main" } │
292
- │ ──────────────────────────► │ generate keypair
293
- │ │ store mnemonic ──────────► OS Keychain (encrypted)
294
- │ │ store metadata ──────────► │ SQLite (nickname)
295
- │ ◄─ { address, publicKey }
296
-
297
- wallet_sign_transaction │
298
- { transaction: {...} }
299
- ──────────────────────────► │ retrieve mnemonic ◄────── OS Keychain
300
- sign in memory │
301
- ◄─ { txID, blob } (key discarded)
302
- │ │
303
- ```
304
-
305
- 1. **Account creation** (`wallet_add_account`) — Generates a keypair, stores the mnemonic in the OS keychain, and stores the nickname in SQLite. Returns **only** address and public key.
286
+ Agent (LLM) MCP Server Storage
287
+ ────────── ────────── ───────
288
+ │ │
289
+ │ wallet_add_account │
290
+ │ { nickname: "main" } │
291
+ │ ──────────────────────────► │ generate keypair
292
+ │ │ INSERT (address, public_key,
293
+ │ │ nickname, mnemonic) ──►│ wallet.db
294
+ │ ◄─ { address, publicKey,
295
+ nickname, index }
296
+ │ │
297
+ wallet_sign_transaction
298
+ { transaction: {...} }
299
+ ──────────────────────────► SELECT mnemonic FROM accounts ◄─│
300
+ WHERE address=<active>
301
+ │ │ sign in memory
302
+ │ ◄─ { txID, blob } │ (key discarded after sign) │
303
+ │ │ │
304
+ ```
305
+
306
+ 1. **Account creation** (`wallet_add_account`) — Generates a keypair and inserts a row containing the mnemonic into `accounts`. Returns address, public key, nickname, and index. The mnemonic is never returned.
306
307
  2. **Active account** — One account is active at a time. `wallet_switch_account` changes it by nickname or index. All signing and query tools operate on the active account.
307
- 3. **Transaction signing** (`wallet_sign_transaction`) — Retrieves the key from the keychain, signs in memory, discards the key. Returns only the signed blob.
308
+ 3. **Transaction signing** (`wallet_sign_transaction`) — Reads the mnemonic from the DB, signs in memory, returns only the signed blob.
308
309
  4. **Data signing** (`wallet_sign_data`) — Signs arbitrary hex data using raw Ed25519 via the [`@noble/curves`](https://github.com/paulmillr/noble-curves) library (no Algorand SDK prefix). Useful for off-chain authentication.
309
310
  5. **Asset opt-in** (`wallet_optin_asset`) — Creates, signs, and submits an opt-in transaction for the active account in one step.
310
311
 
311
- ### Platform keychain support
312
+ ### Backward compatibility (silent migration from OS keychain)
312
313
 
313
- The keychain backend is provided by [`@napi-rs/keyring`](https://github.com/nicolo-ribaudo/napi-keyring) (Rust-based, prebuilt binaries):
314
+ Older installs of this MCP stored mnemonics in the OS keychain (`@napi-rs/keyring`). On first startup after upgrading, the server runs a one-shot, silent migration:
314
315
 
315
- | Platform | Backend |
316
- |---|---|
317
- | macOS | Keychain Services (the system Keychain app) |
318
- | Linux | libsecret (GNOME Keyring) or KWallet |
319
- | Windows | Windows Credential Manager |
316
+ - For every `accounts` row whose `mnemonic` column is `NULL` or empty, it attempts to read the mnemonic from the OS keychain under the service name `algorand-mcp` keyed by the address.
317
+ - If found, the mnemonic is copied into the DB column.
318
+ - The original keychain entry is left in place as a redundant backup; nothing is deleted.
319
+
320
+ After this completes, the DB is the sole source of truth. The keychain is consulted only as a fallback if the DB still has a `NULL` mnemonic for an address (e.g., the keychain was unavailable during startup and became available later). All new accounts created after the upgrade are written directly to the DB and never touch the keychain.
320
321
 
321
- All credentials are stored under the service name `algorand-mcp`. You can inspect them with your OS keychain app (e.g. Keychain Access on macOS).
322
+ No user action is required. No prompts, no env vars, no migration logs.
322
323
 
323
324
  ## x402 HTTP Payments
324
325
 
@@ -343,7 +344,7 @@ This MCP implements the Algorand flavor of x402, where payments are USDC (or nat
343
344
  │ │ build fee-payer + payment │ │
344
345
  │ │ (atomic group of 2) │ │
345
346
  │ │ sign payment leg │ │
346
- │ │ via OS keychain │ │
347
+ │ │ via agent wallet DB │ │
347
348
  │ │ encode unsigned fee-payer │ │
348
349
  │ │ base64 PAYMENT-SIGNATURE │ │
349
350
  │ │ ─────────────────────────► │ │
@@ -452,7 +453,7 @@ See [Secure Wallet](#secure-wallet) for full architecture details.
452
453
  | `wallet_remove_account` | Remove an account from the wallet by nickname or index |
453
454
  | `wallet_list_accounts` | List all accounts with nicknames and addresses |
454
455
  | `wallet_switch_account` | Switch the active account by nickname or index |
455
- | `wallet_get_info` | Get info for the **active account this MCP server owns** (keychain-backed): address, public key, balance, opted-in counts. For arbitrary on-chain accounts use `api_algod_get_account_info`. |
456
+ | `wallet_get_info` | Get info for the **active account this MCP server owns** (DB-backed): address, public key, balance, opted-in counts. For arbitrary on-chain accounts use `api_algod_get_account_info`. |
456
457
  | `wallet_get_assets` | Get all ASA holdings for the **active account this MCP server owns**. For arbitrary on-chain accounts use `api_algod_get_account_info` or `api_algod_get_account_asset_info`. |
457
458
  | `wallet_sign_transaction` | Sign a single transaction with the active account |
458
459
  | `wallet_sign_transaction_group` | Sign a group of transactions with the active account (auto-assigns group ID) |
@@ -687,7 +688,7 @@ algorand-mcp/
687
688
  │ │ └── wallet/ # Wallet resources
688
689
  │ ├── tools/ # MCP Tools
689
690
  │ │ ├── commonParams.ts # Network + pagination schema fragments
690
- │ │ ├── walletManager.ts # Secure wallet (keychain + SQLite)
691
+ │ │ ├── walletManager.ts # Agent wallet (SQLite-backed)
691
692
  │ │ ├── accountManager.ts # Account operations
692
693
  │ │ ├── utilityManager.ts # Utility functions
693
694
  │ │ ├── algodManager.ts # TEAL compile, simulate, submit
@@ -967,7 +968,7 @@ describeIf(testConfig.isCategoryEnabled('your-category'))('Your Tools (E2E)', ()
967
968
 
968
969
  - [algosdk](https://github.com/algorand/js-algorand-sdk) v3 — Algorand JavaScript SDK
969
970
  - [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) — MCP TypeScript SDK
970
- - [@napi-rs/keyring](https://github.com/nicolo-ribaudo/napi-keyring) — Native OS keychain access (macOS Keychain, Linux libsecret, Windows Credential Manager)
971
+ - [@napi-rs/keyring](https://github.com/nicolo-ribaudo/napi-keyring) — Native OS keychain access (macOS Keychain, Linux libsecret, Windows Credential Manager). Used as a backward-compatibility read fallback for accounts created by pre-DB-migration installs; new mnemonics are written only to `wallet.db`.
971
972
  - [sql.js](https://github.com/sql-js/sql.js) — Embedded SQLite (WASM) for wallet metadata persistence
972
973
  - [@noble/curves](https://github.com/paulmillr/noble-curves) — Pure JS Ed25519 for raw data signing (`wallet_sign_data`)
973
974
  - [@tinymanorg/tinyman-js-sdk](https://github.com/tinymanorg/tinyman-js-sdk) — Tinyman AMM SDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goplausible/algorand-mcp",
3
- "version": "4.2.8",
3
+ "version": "4.2.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },