crypto-mcp
A read-only MCP server for managing multichain crypto wallet accounts and deriving public addresses across Bitcoin, Ethereum, Solana, TRON, and more. It provides secure local storage with encrypted mnemonics and only exposes account listing and address lookup tools.
README
mcp-wallet
Chain-agnostic MCP wallet interface for durable AI agents with autonomous transfers.
The durable agent runtime is the wallet principal: it can create wallets and independently simulate, inspect, revalidate, sign, and broadcast supported transactions. Mnemonics and private keys remain inside encrypted local custody rather than crossing the model context.
Supported addresses
| Chain | Derivation path | Address type |
|---|---|---|
| Bitcoin | m/84'/0'/0'/0/0 |
Mainnet P2WPKH (Bech32) |
| Ethereum | m/44'/60'/0'/0/0 |
EIP-55 EVM address |
| BNB Smart Chain | m/44'/60'/0'/0/0 |
Same EVM address |
| Solana | m/44'/501'/0'/0' |
Base58 ed25519 public key |
| TRON | m/44'/195'/0'/0/0 |
Base58Check account address |
| HyperEVM | m/44'/60'/0'/0/0 |
Same EVM address |
| HyperCore | m/44'/60'/0'/0/0 |
Same EVM account identity |
Current scope
- Create and import accounts
- List accounts and derived addresses
- Show or delete an account
- AES-256-GCM encrypted mnemonic storage
- Agent-owned wallet creation through local MCP without exposing the mnemonic
- Native balance reads and two-step native Ethereum, BNB Smart Chain, and HyperEVM transactions to ordinary code-less recipients outside reserved precompile/system address space; successful simulation must return empty call data
- Mandatory exact-transaction preflight with deterministic outflow reports and execution-time revalidation
- CAIP-2 chain identifiers and runtime capability discovery through a typed transaction interface
- Optional agent-configured policy safeguards; no mandatory human approval
- Local stdio MCP transport with no listening network port
- Chain-adapter boundary for future extensions
Not implemented: tokens, calldata, contract calls, swaps, bridges, Bitcoin/Solana/TRON transfers, HyperCore actions, indexed history, or automatic testnet selection.
Setup
Requirements: Linux with the util-linux flock command, and Node.js 22 or newer. Wallet and transfer state use kernel-managed advisory locks so crashes cannot leave stale ownership metadata or permit PID-reuse/ABA lock races.
npm install
npm run build
Generate a development master key without printing it:
export CRYPTO_MCP_MASTER_KEY="$(node -e "process.stdout.write(require('node:crypto').randomBytes(32).toString('base64'))")"
Optional wallet-file override:
export CRYPTO_MCP_WALLET_FILE="$HOME/.crypto-mcp/wallet.json"
The default wallet file is $HOME/.crypto-mcp/wallet.json and is written with mode 0600.
Maintenance CLI
Create an account:
npm run wallet -- account create --label primary
The generated mnemonic is printed exactly once. Transfer it immediately to an appropriate offline backup or password manager; do not place it in shell history, logs, chat, source control, or MCP requests.
Import from stdin:
password-manager-command | npm run wallet -- account import --label imported
Manage public account data:
npm run wallet -- account list
npm run wallet -- account show <account-id>
npm run wallet -- account delete <account-id>
The CLI retains explicit lifecycle commands for debugging, recovery, and manual maintenance, but it is not part of the agent's authorization path:
npm run wallet -- transfer status <request-id>
npm run wallet -- transfer approve <request-id> --digest sha256:<digest>
npm run wallet -- transfer sign <request-id>
npm run wallet -- transfer broadcast <request-id>
Approval is bound to the account, chain ID, recipient, raw amount, nonce, fee fields, expiry, idempotency key, pinned simulation block, canonical outflows, completeness, and deterministic summary. Execution rechecks the pending nonce before and after exact re-simulation, then custody authenticates fresh evidence before signing. Signing and first submission reject stale, forged, or incomplete authorization.
Agent wallet MCP server
The local stdio server exposes exactly nine tools:
create_walletlist_accountsget_accountget_addressesget_wallet_capabilitiesget_balancesimulate_transactionexecute_transactionget_transaction_status
Start it with process-local wallet configuration:
npm run build
npm run mcp
An MCP client should launch node /absolute/path/to/mcp-wallet/dist/src/mcp/stdio.js and provide CRYPTO_MCP_MASTER_KEY and, optionally, CRYPTO_MCP_WALLET_FILE to that subprocess through external secret injection. Never put the master key in tool arguments, prompts, chat, source control, or ordinary configuration files.
create_wallet generates an encrypted wallet without returning its mnemonic. get_wallet_capabilities advertises the exact configured chains, assets, and operations. get_balance and simulate_transaction use CAIP-2 chain identifiers such as eip155:1 plus an explicit typed operation; the current adapter supports only native transfers. simulate_transaction reserves the exact nonce, prepares exact fee and gas fields, pins an RPC block, runs eth_call, and returns canonical wallet outflows plus a bounded deterministic summary. execute_transaction accepts only that simulation ID and digest, rechecks the configured chain and policy, re-simulates the exact transaction at fresh chain state, and signs and broadcasts only if the preflight remains valid. Generic tool names do not imply unsupported-chain support: unadvertised chains, assets, and operations fail closed. MCP cannot supply RPC URLs, policy overrides, nonces, calldata, raw signing payloads, mnemonics, or private keys, and sanitized results never expose raw signed transactions.
Transfer configuration
Each configured network defaults to full agent authority. Configure the owner-only transfer journal and RPC details in the MCP process environment—not tool arguments:
export CRYPTO_MCP_TRANSFER_FILE="$HOME/.crypto-mcp/transfers.json"
export CRYPTO_MCP_ETHEREUM_RPC_URL="https://your-rpc.example"
export CRYPTO_MCP_ETHEREUM_CHAIN_ID="1"
export CRYPTO_MCP_ETHEREUM_FEE_MODE="eip1559"
Equivalent BSC and HYPEREVM variables are supported. Fee mode must be eip1559 or legacy; chain ID is verified against eth_chainId before preparation. Use disposable accounts, test networks, bounded policy values, and non-production funds for initial validation.
An agent may opt into self-imposed safeguards by setting CRYPTO_MCP_TRANSFER_POLICY. Providing it switches to explicit policy configuration; omitted chains are disabled. Policies can set amount, fee, rolling 24-hour value, account, and recipient bounds. These are optional wallet-owner controls, not human approval requirements.
MCP usage examples
These are MCP tool arguments and structured results, not shell commands. Start the stdio server with process-local custody and network configuration before invoking transfer tools.
Create an agent-owned wallet
Tool: create_wallet
{
"label": "primary-agent-wallet"
}
The result contains the account ID, label, creation time, and public addresses. It never contains the generated mnemonic or private keys.
Discover supported chains and assets
Tool: get_wallet_capabilities
{}
Example result for a configured Ethereum network:
{
"chains": [
{
"chain": "eip155:1",
"family": "evm",
"assets": [{ "asset": "native", "decimals": 18 }],
"operations": ["get_balance", "simulate_transaction", "execute_transaction", "get_transaction_status"],
"transactionTypes": ["transfer"],
"contractRecipients": false,
"preflight": {
"required": true,
"completeness": "complete",
"executionRevalidation": true
}
}
]
}
Only advertised chain and asset combinations are supported. For example, a configured Sepolia network is identified as eip155:11155111.
Read a balance
Tool: get_balance
{
"accountId": "0190f4f6-7f08-7000-8000-000000000001",
"chain": "eip155:1",
"asset": "native"
}
Example result:
{
"accountId": "0190f4f6-7f08-7000-8000-000000000001",
"chain": "eip155:1",
"asset": "native",
"address": "0x9858EfFD232B4033E47d90003D41EC34EcaEda94",
"balance": "1.25",
"balanceBaseUnits": "1250000000000000000",
"decimals": 18
}
All amounts are decimal strings. Base-unit values are exact integer strings and are never converted through JavaScript floating point.
Simulate a transaction
Tool: simulate_transaction
{
"accountId": "0190f4f6-7f08-7000-8000-000000000001",
"chain": "eip155:1",
"operation": {
"type": "transfer",
"asset": "native",
"to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"amount": "0.001"
},
"maxFee": "0.0002",
"idempotencyKey": "pay-invoice-2026-08-07-001"
}
The wallet validates policy and balances, reserves the nonce, constructs the exact unsigned transaction, and simulates it at a pinned block. Reusing the same idempotency key with the same request converges on the existing transaction; changing any request field fails closed.
Example result:
{
"requestId": "0190f502-f56d-7000-8000-000000000001",
"state": "simulated",
"accountId": "0190f4f6-7f08-7000-8000-000000000001",
"chain": "eip155:1",
"operation": {
"type": "transfer",
"asset": "native",
"to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"amount": "0.001",
"amountBaseUnits": "1000000000000000"
},
"maxFeeBaseUnits": "200000000000000",
"createdAt": "2026-08-07T00:00:00.000Z",
"expiresAt": "2026-08-07T00:05:00.000Z",
"preflight": {
"simulationId": "0190f502-f56d-7000-8000-000000000001",
"intentDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
"status": "succeeded",
"simulatedAt": "2026-08-07T00:00:00.000Z",
"blockReference": "21900421",
"blockHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"blockTimestamp": "1786060800",
"simulationCompleteness": "complete",
"summary": "Send 0.001 native asset units from 0x9858EfFD232B4033E47d90003D41EC34EcaEda94 to 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on eip155:1. Maximum network fee: 0.000105 native asset units.",
"outflows": [
{
"kind": "transfer",
"from": "0x9858EfFD232B4033E47d90003D41EC34EcaEda94",
"to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"asset": "native",
"amount": "0.001",
"amountBaseUnits": "1000000000000000",
"certainty": "exact"
},
{
"kind": "network_fee",
"from": "0x9858EfFD232B4033E47d90003D41EC34EcaEda94",
"to": "network",
"asset": "native",
"amount": "0.000105",
"amountBaseUnits": "105000000000000",
"certainty": "maximum"
}
],
"warnings": []
}
}
The summary is generated deterministically from the same canonical fields as outflows. simulationCompleteness: "complete" applies only to the currently supported native-transfer operation; it is not a claim that arbitrary contract effects can be inferred from eth_call.
Execute the reviewed simulation
Tool: execute_transaction
{
"simulationId": "0190f502-f56d-7000-8000-000000000001",
"intentDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
}
The digest binds the exact prepared transaction and preflight report, including the pinned block number, hash, and timestamp. Before signing, the wallet checks expiry, account and chain configuration, policy, and RPC chain ID, rejects block metadata more than 120 seconds old or more than 15 seconds in the future, then re-simulates the exact transaction at fresh pinned state. A missing, stale, reverted, malformed, incomplete, or digest-mismatched preflight fails closed. A successful result preserves the preflight, adds revalidatedAt, revalidationBlockReference, revalidationBlockHash, and revalidationBlockTimestamp, and eventually includes transactionId after signing and broadcast.
Check transaction status
Tool: get_transaction_status
{
"requestId": "0190f502-f56d-7000-8000-000000000001"
}
The result uses the same transaction shape. A prepared report is exposed as state: "simulated"; a confirmed transaction may also include blockReference; a terminal failure may include a bounded failureCode.
Development
npm run typecheck
npm test
The test suite derives its public BIP-39 vector from fixed entropy rather than storing a mnemonic phrase in repository fixtures.
Library API
import { JsonAccountStore, WalletAccountService } from "crypto-mcp";
const service = new WalletAccountService(
new JsonAccountStore(walletFile),
masterKey,
);
const accounts = await service.listAccounts();
MCP wallet creation and execution are autonomous: an agent can inspect the deterministic preflight and submit its digest without routine human approval. Secret import/export remains outside model-visible tools; MCP never accepts or returns mnemonics, seeds, private keys, master keys, or raw signed transactions.
See docs/security.md for the custody boundary and current limitations.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。