MetaMask MCP server

Integrates with MetaMask wallet to enable secure blockchain operations including transaction sending, smart contract deployment and interaction, ENS resolution, and chain switching across Ethereum networks while keeping private keys protected within the user's wallet.
Back to servers
Setup instructions
Provider
Xiawpohr
Release date
Jul 30, 2025
Stats
6 stars

MetaMask MCP is a server implementation of the Model Context Protocol that enables LLMs to interact with blockchain networks through MetaMask wallet. It provides a secure way to perform blockchain operations while keeping your private keys safely stored in your wallet, never exposing them to the AI agent.

Requirements

  • Node.js (v20 or higher)
  • pnpm

Installation

Step 1: Clone the repository

git clone https://github.com/Xiawpohr/metamask-mcp.git
cd metamask-mcp

Step 2: Install dependencies

pnpm install

Step 3: Build the project

pnpm build

Usage with Claude Desktop

Configuration

Follow the MCP setup guide on ModelContextProtocol.io and add the following configuration:

{
  "mcpServers": {
    "metamask": {
      "command": "node",
      "args": [
        "/PATH/TO/YOUR_PROJECT/dist/index.ts"
      ]
    }
  }
}

Be sure to replace /PATH/TO/YOUR_PROJECT with the actual path to your local installation.

Available Tools

MetaMask MCP provides numerous blockchain interaction tools:

Chain Information

  • get-chain-list: Retrieve information about all available chains
  • get-chain-id: Get the current chain ID
  • get-chains: Get the configured chains
  • switch-chain: Change the target blockchain network

Wallet Connection

  • get-connect-uri: Get the connection URI for a MetaMask wallet
  • show-connect-qrcode: Display the QR code for a given connection URI
  • disconnect: End the connection to the wallet
  • get-account: Retrieve the current account information

Balance & Token Operations

  • get-native-currency-balance: Check the native currency balance of an address
  • get-token-balance: Check the token balance of an address
  • get-token: Fetch information about a token

Transaction Operations

  • send-transaction: Send transactions to blockchain networks
  • wait-for-transaction-receipt: Wait for a transaction to be included in a block
  • get-transaction: Retrieve transaction details by hash or block identifiers
  • get-transaction-reeceipt: Get a transaction receipt by hash

Smart Contract Interactions

  • read-contract: Call read-only contract functions
  • write-contract: Execute write functions on a contract
  • deploy-contract: Deploy a new contract to the network
  • call: Execute a message call without submitting a transaction

Gas & Fee Estimation

  • estimate-gas: Estimate gas required for a transaction
  • estimate-fee-per-gas: Estimate fees per gas for inclusion in the next block
  • get-gas-price: Get the current gas price in wei

Block Operations

  • get-block-number: Get the most recent block number
  • get-block: Fetch information about a specific block

Signing & Verification

  • sign-message: Sign a message with your wallet
  • verify-message: Verify a message was signed by a specific address

ENS Operations

  • get-ens-address: Resolve an ENS name to an address
  • get-ens-name: Get the primary ENS name for an address

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "metamask" '{"command":"node","args":["/PATH/TO/YOUR_PROJECT/dist/index.ts"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "metamask": {
            "command": "node",
            "args": [
                "/PATH/TO/YOUR_PROJECT/dist/index.ts"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "metamask": {
            "command": "node",
            "args": [
                "/PATH/TO/YOUR_PROJECT/dist/index.ts"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later