> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

# Develop with the wallet CLI and MCP

How scripts, CI, and AI agents hold and move funds on Midnight without a browser extension, using the wallet CLI and its MCP server. To choose a wallet first, see the [overview](https://docs.midnight.network/sdks/community/wallets/community-wallets-overview.md). For browser DApp integration, see the [integration guide](https://docs.midnight.network/sdks/community/wallets/community-wallets-integration.md).

## Develop and test without a wallet[​](#develop-and-test-without-a-wallet "Direct link to Develop and test without a wallet")

The wallet CLI exposes the same `ConnectedAPI` over a local WebSocket, so your DApp code paths run unchanged, and users later connect with any browser wallet. The CLI is self-custody (keys in `~/.midnight`, BIP-39/44, Lace-compatible) and network-agnostic, so one seed serves `undeployed`, `preprod`, and `preview`.

| Group              | Commands                                                                     |
| ------------------ | ---------------------------------------------------------------------------- |
| Wallet             | `wallet generate/list/use/info/remove`, `info`, `address`, `genesis-address` |
| Transactions       | `balance`, `transfer`, `airdrop`, `inspect-cost`                             |
| DUST               | `dust register`, `dust status`                                               |
| Local network      | `localnet up/status/stop/down/clean`                                         |
| Config / connector | `config get/set/unset`, `cache clear`, `serve`                               |

`midnight localnet up` orchestrates the full stack in Docker (node on `9944`, indexer on `8088`, proof server on `6300`), so you can deploy and transact with no faucet:

```
midnight localnet up                          # node + indexer + proof server (Docker)

midnight wallet generate alice                # self-custody key in ~/.midnight

midnight config set network undeployed

midnight airdrop 1000                          # fund the active wallet (undeployed-only)

midnight airdrop 1000 mn_addr_undeployed1...   # ...or fund ANY address directly (v0.4.1, no seed import)

midnight dust register                         # REQUIRED before transfers; wait ~5 min locally for DUST (else error 138)

midnight balance

midnight transfer mn_addr_undeployed1... 100   # positional: <recipient> <amount>



midnight serve --network preview               # headless DApp Connector on ws://localhost:9932

midnight serve --network preview --approve-all # dev only: auto-approve every request
```

\#1 beginner gotcha

Run `dust register` before transferring, or the transfer fails with `BalanceCheckOverspend` (138). DUST regenerates in about 5 minutes locally (see [Fees and DUST](https://docs.midnight.network/sdks/community/wallets/community-wallets-integration.md#fees-and-dust) and [Troubleshooting](https://docs.midnight.network/sdks/community/wallets/community-wallets-reference.md#troubleshooting-and-error-reference)).

```
// A DApp connects to the CLI connector exactly like a browser wallet:

import { createWalletClient } from "midnight-wallet-connector";

const wallet = await createWalletClient({ url: "ws://localhost:9932", networkId: "Preview" });

const balances = await wallet.getUnshieldedBalances(); // same ConnectedAPI surface
```

Build and test against `midnight serve` (scriptable, no pop-ups), then deploy and let users connect with Lace or 1AM, with no code changes.

Freshness (v0.4.1)

`midnight airdrop` can now fund any address directly: paste the recipient's address, with no seed import needed. You no longer have to import a seed to fund browser wallets on a local network. The indexer connection also moved to the v4 API, which fixes connection errors on the test networks. ([repo](https://github.com/nel349/midnight-wallet-cli))

([CLI README](https://www.npmjs.com/package/midnight-wallet-cli), [connector](https://www.npmjs.com/package/midnight-wallet-connector), [local playground](https://forum.midnight.network/t/local-playground-for-midnight-compact-contracts-run-a-full-node-indexer-and-proof-server-via-docker-fund-your-lace-wallet-and-deploy-without-testnets-or-faucets/1002))

## AI and agent tooling (the MCP column)[​](#ai-and-agent-tooling-the-mcp-column "Direct link to AI and agent tooling (the MCP column)")

The MCP column is agents calling tools, and it comes in two flavors.

**Wallet-control MCP.** The midnight-wallet-cli ships an MCP server (`midnight-wallet-mcp`) that exposes the CLI commands as tools, so an AI agent can operate a self-custody wallet:

| Group           | MCP tools                                                                                                                        |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Wallet and info | `midnight_wallet_generate`, `_list`, `_use`, `_info`, `_remove`, `midnight_info`, `midnight_address`, `midnight_genesis_address` |
| Transactions    | `midnight_balance`, `_transfer`, `_airdrop`, `midnight_inspect_cost`                                                             |
| DUST            | `midnight_dust_register`, `_status`                                                                                              |
| Local network   | `midnight_localnet_up`, `_stop`, `_down`, `_status`, `_clean`                                                                    |
| Config          | `midnight_config_get`, `_set`, `_unset`, `midnight_cache_clear`                                                                  |

The newest tools are the consequential ones. Beyond moving tokens, an agent can now drive the full contract lifecycle: deploy, call, and read state. A two-step confirmation tool also shows the human what the agent is about to spend before anything executes. Point any MCP client at the binary, such as Claude Code (`.mcp.json`), Claude Desktop, Cursor, VS Code (Copilot), or Windsurf:

```
{ "mcpServers": { "midnight-wallet": { "command": "midnight-wallet-mcp" } } }
```

This is the highest-risk cell. Scope the agent's tools, cap spend, allowlist destinations, and keep a human in the loop (see [Security checklist](https://docs.midnight.network/sdks/community/wallets/community-wallets-reference.md#security-checklist)). Walkthrough: "Multi-Language Dev Session #22: midnight-wallet-cli" ([YouTube](https://www.youtube.com/watch?v=zgt27WFzQHk), [CLI README](https://www.npmjs.com/package/midnight-wallet-cli)).

**Dev-assistant MCP.** This is tooling that helps you build: write Compact, wire the connector, and verify claims. See the talk "Midnight for Developers: Midnight MCP, The AI Tool That Finally Understands Compact" ([YouTube](https://www.youtube.com/watch?v=oGDSMDejUkE)). Two marketplaces:

* **Midnight Expert** has 13 plugins (87 skills, 17 agents) across the dev lifecycle. The most relevant here are `midnight-tooling` (CLI, devnet, proof server), `midnight-dapp-dev` (frontend and connector), `midnight-wallet` (wallet SDK), `midnight-verify` (check SDK and connector claims), and `midnight-status-codes`. Install via `/plugin`, then add `https://midnightntwrk.expert`. ([midnightntwrk.expert](https://midnightntwrk.expert/))
* **Edda Labs** ships the `midnight` plugin: `/midnight-docs`, `/midnight-docs-repos`, `/midnight-examples`, `/midnight-contracts`, and `/midnight-starter` (the same [`eddalabs/midnight-starter-template`](https://github.com/eddalabs/midnight-starter-template) used in the [React pattern](https://docs.midnight.network/sdks/community/wallets/community-wallets-integration.md#react-the-production-pattern)). Install with `/plugin marketplace add eddalabs/edda-marketplace`, then `/plugin install midnight`.
