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.

npm package

@roxi-os/metamask-mcp

License

MIT

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.

claude_desktop_config.json
{
  "mcpServers": {
    "metamask": { "command": "npx", "args": ["-y", "@roxi-os/metamask-mcp"] }
  }
}

From source

bash
git clone https://github.com/ROXI-OS-SI/metamask-mcp.git
cd metamask-mcp
pnpm install
pnpm build

Then 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.

Note. Parameters marked ? are optional.

Signing

send-transaction

Wallet signature

Send a transaction. Used to finish erc20-mcp's transfer, approve and mint.

ParameterTypeDescription
tostringRecipient or contract address.
data?hexEncoded contract call.
value?integerValue in wei sent with the transaction.
maxFeePerGas?integerTotal fee per gas in wei, including the priority fee.
maxPriorityFeePerGas?integerMax priority fee per gas in wei.
chainId?numberChain ID to check against before sending.

write-contract

Wallet signature

Call a state-changing function on a contract by name.

ParameterTypeDescription
abiarrayThe contract's ABI.
addressstringContract address.
functionNamestringFunction to call.
args?arrayFunction arguments.
value?integerValue in wei sent with the transaction.
maxFeePerGas?integerTotal fee per gas in wei, including the priority fee.
maxPriorityFeePerGas?integerMax priority fee per gas in wei.
chainId?numberChain ID to check against before sending.

deploy-contract

Wallet signature

Deploy a contract from its ABI and bytecode.

ParameterTypeDescription
abiarrayThe contract's ABI.
bytecodehexCompiled bytecode, for example from solc-mcp.
args?arrayConstructor arguments.

sign-message

Wallet signature

Sign a plain-text message with the connected account.

ParameterTypeDescription
messagestringMessage 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.

ParameterTypeDescription
uristringThe 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.

ParameterTypeDescription
chainIdnumberID of the chain to switch to.
addEthereumChainParameter?objectDetails for adding a chain the wallet doesn't have yet.

get-block-number

Get the most recent block number.

ParameterTypeDescription
chainId?numberChain to use. Defaults to the wallet's current chain.

get-block

Get a block by number, hash or tag.

ParameterTypeDescription
chainId?numberChain to use. Defaults to the wallet's current chain.
blockHash?stringBlock hash.
blockNumber?integerBlock number.
blockTag?latest | earliest | pending | safe | finalizedBlock tag. Defaults to latest.

estimate-fee-per-gas

Estimate fees per gas for a transaction to be included in the next block.

ParameterTypeDescription
chainId?numberChain to use. Defaults to the wallet's current chain.
formatUnits?ether | gwei | weiUnits for the result.

estimate-gas

Estimate the gas a transaction needs, without sending it.

ParameterTypeDescription
tostringRecipient or contract address.
data?hexEncoded contract call.
value?integerValue in wei sent with the transaction.
maxFeePerGas?integerTotal fee per gas in wei, including the priority fee.
maxPriorityFeePerGas?integerMax priority fee per gas in wei.
chainId?numberChain ID to check against before sending.

wait-seconds

Pause for the given number of seconds.

ParameterTypeDescription
secondsnumberSeconds to wait.

Reading

get-native-currency-balance

Get an address's balance of the chain's native currency, such as ETH.

ParameterTypeDescription
addressstringAddress to check.

get-token-balance

Get an address's balance of an ERC-20 token.

ParameterTypeDescription
addressstringAddress to check.
tokenstringERC-20 token contract address.

get-token

Get an ERC-20 token's name, symbol, decimals and total supply.

ParameterTypeDescription
addressstringToken contract address.
chainId?numberChain to use. Defaults to the wallet's current chain.

get-transaction

Get a transaction by hash.

ParameterTypeDescription
hashstringTransaction hash.
chainId?numberChain to use. Defaults to the wallet's current chain.

get-transaction-receipt

Get a transaction's receipt by hash.

ParameterTypeDescription
hashstringTransaction hash.
chainId?numberChain 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.

ParameterTypeDescription
hashstringTransaction hash.
confirmations?numberBlocks to wait after inclusion.
chainId?numberChain to use. Defaults to the wallet's current chain.

get-ens-address

Resolve an ENS name to an address.

ParameterTypeDescription
namestringENS name, such as vitalik.eth.
chainId?numberChain to use. Defaults to the wallet's current chain.
blockNumber?integerResolve at this block.

get-ens-name

Get the primary ENS name for an address.

ParameterTypeDescription
addressstringAddress to look up.
chainId?numberChain to use. Defaults to the wallet's current chain.
blockNumber?integerLook up at this block.

call

Run a contract call without sending a transaction. Used to finish erc20-mcp's prepare-* reads.

ParameterTypeDescription
tostringContract address.
datahexEncoded contract call.
value?integerValue in wei.

read-contract

Call a read-only function on a contract by name.

ParameterTypeDescription
abiarrayThe contract's ABI.
addressstringContract address.
functionNamestringFunction to call.
args?arrayFunction arguments.
chainId?numberChain to use. Defaults to the wallet's current chain.

verify-message

Check that a message was signed by an address.

ParameterTypeDescription
addressstringThe address that should have signed.
messagestringThe original message.
signaturestringThe 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.