MCP servers
metamask-mcp
The signing module. It connects your MetaMask wallet, reads chain data, and sends every state change to your wallet for approval.
Install#
Add it to your MCP client's config. Requires Node.js 20 or newer. See the quick start for where the config file lives.
{
"mcpServers": {
"metamask": { "command": "npx", "args": ["-y", "@roxi-os/metamask-mcp"] }
}
}From source
git clone https://github.com/ROXI-OS-SI/metamask-mcp.git
cd metamask-mcp
pnpm install
pnpm buildThen use "command": "node" with the absolute path to dist/index.js as the argument.
Networks#
Configured for Ethereum Mainnet (1) and Sepolia (11155111). Connect with MetaMask Mobile by QR code; see Connect a wallet.
Tools#
28 tools. The four marked “Wallet signature” open a MetaMask prompt and only proceed if you approve.
? are optional.Signing
send-transaction
Wallet signatureSend a transaction. Used to finish erc20-mcp's transfer, approve and mint.
| Parameter | Type | Description |
|---|---|---|
| to | string | Recipient or contract address. |
| data? | hex | Encoded contract call. |
| value? | integer | Value in wei sent with the transaction. |
| maxFeePerGas? | integer | Total fee per gas in wei, including the priority fee. |
| maxPriorityFeePerGas? | integer | Max priority fee per gas in wei. |
| chainId? | number | Chain ID to check against before sending. |
write-contract
Wallet signatureCall a state-changing function on a contract by name.
| Parameter | Type | Description |
|---|---|---|
| abi | array | The contract's ABI. |
| address | string | Contract address. |
| functionName | string | Function to call. |
| args? | array | Function arguments. |
| value? | integer | Value in wei sent with the transaction. |
| maxFeePerGas? | integer | Total fee per gas in wei, including the priority fee. |
| maxPriorityFeePerGas? | integer | Max priority fee per gas in wei. |
| chainId? | number | Chain ID to check against before sending. |
deploy-contract
Wallet signatureDeploy a contract from its ABI and bytecode.
| Parameter | Type | Description |
|---|---|---|
| abi | array | The contract's ABI. |
| bytecode | hex | Compiled bytecode, for example from solc-mcp. |
| args? | array | Constructor arguments. |
sign-message
Wallet signatureSign a plain-text message with the connected account.
| Parameter | Type | Description |
|---|---|---|
| message | string | Message to sign. |
Connection
get-connect-uri
Start a MetaMask connection and return its connect URI.
No parameters.
show-connect-qrcode
Render a connect URI as a QR code image to scan with MetaMask Mobile.
| Parameter | Type | Description |
|---|---|---|
| uri | string | The connect URI from get-connect-uri. |
get-account
Get the connected account's address, or nothing if no wallet is connected.
No parameters.
disconnect
Disconnect the wallet and end the session.
No parameters.
Network and gas
get-chain-id
Get the current chain ID.
No parameters.
get-chains
List the configured chains (Ethereum Mainnet and Sepolia).
No parameters.
get-chain-list
Get information on all chains from Chainlist.
No parameters.
switch-chain
Switch the wallet to another chain. MetaMask asks you to approve the switch.
| Parameter | Type | Description |
|---|---|---|
| chainId | number | ID of the chain to switch to. |
| addEthereumChainParameter? | object | Details for adding a chain the wallet doesn't have yet. |
get-block-number
Get the most recent block number.
| Parameter | Type | Description |
|---|---|---|
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
get-block
Get a block by number, hash or tag.
| Parameter | Type | Description |
|---|---|---|
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
| blockHash? | string | Block hash. |
| blockNumber? | integer | Block number. |
| blockTag? | latest | earliest | pending | safe | finalized | Block tag. Defaults to latest. |
estimate-fee-per-gas
Estimate fees per gas for a transaction to be included in the next block.
| Parameter | Type | Description |
|---|---|---|
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
| formatUnits? | ether | gwei | wei | Units for the result. |
estimate-gas
Estimate the gas a transaction needs, without sending it.
| Parameter | Type | Description |
|---|---|---|
| to | string | Recipient or contract address. |
| data? | hex | Encoded contract call. |
| value? | integer | Value in wei sent with the transaction. |
| maxFeePerGas? | integer | Total fee per gas in wei, including the priority fee. |
| maxPriorityFeePerGas? | integer | Max priority fee per gas in wei. |
| chainId? | number | Chain ID to check against before sending. |
wait-seconds
Pause for the given number of seconds.
| Parameter | Type | Description |
|---|---|---|
| seconds | number | Seconds to wait. |
Reading
get-native-currency-balance
Get an address's balance of the chain's native currency, such as ETH.
| Parameter | Type | Description |
|---|---|---|
| address | string | Address to check. |
get-token-balance
Get an address's balance of an ERC-20 token.
| Parameter | Type | Description |
|---|---|---|
| address | string | Address to check. |
| token | string | ERC-20 token contract address. |
get-token
Get an ERC-20 token's name, symbol, decimals and total supply.
| Parameter | Type | Description |
|---|---|---|
| address | string | Token contract address. |
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
get-transaction
Get a transaction by hash.
| Parameter | Type | Description |
|---|---|---|
| hash | string | Transaction hash. |
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
get-transaction-receipt
Get a transaction's receipt by hash.
| Parameter | Type | Description |
|---|---|---|
| hash | string | Transaction hash. |
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
wait-for-transaction-receipt
Wait until a transaction is included in a block, then return its receipt.
| Parameter | Type | Description |
|---|---|---|
| hash | string | Transaction hash. |
| confirmations? | number | Blocks to wait after inclusion. |
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
get-ens-address
Resolve an ENS name to an address.
| Parameter | Type | Description |
|---|---|---|
| name | string | ENS name, such as vitalik.eth. |
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
| blockNumber? | integer | Resolve at this block. |
get-ens-name
Get the primary ENS name for an address.
| Parameter | Type | Description |
|---|---|---|
| address | string | Address to look up. |
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
| blockNumber? | integer | Look up at this block. |
call
Run a contract call without sending a transaction. Used to finish erc20-mcp's prepare-* reads.
| Parameter | Type | Description |
|---|---|---|
| to | string | Contract address. |
| data | hex | Encoded contract call. |
| value? | integer | Value in wei. |
read-contract
Call a read-only function on a contract by name.
| Parameter | Type | Description |
|---|---|---|
| abi | array | The contract's ABI. |
| address | string | Contract address. |
| functionName | string | Function to call. |
| args? | array | Function arguments. |
| chainId? | number | Chain to use. Defaults to the wallet's current chain. |
verify-message
Check that a message was signed by an address.
| Parameter | Type | Description |
|---|---|---|
| address | string | The address that should have signed. |
| message | string | The original message. |
| signature | string | The signature to check. |
Prompts#
be-metamask-assistant sets the agent up with step-by-step routines for checking the connection, connecting, sending a transaction, calling a contract and deploying one.
Credits#
Built on the original MetaMask MCP prototype by xiawpohr, extended for ROXI OS.