home / mcp / base mcp server

Base MCP Server

A Model Context Protocol (MCP) server that provides onchain tools for LLMs, allowing them to interact with the Base network and Coinbase API.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "base-base-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "base-mcp@latest"
      ],
      "env": {
        "CHAIN_ID": "optional_for_base_sepolia_testnet",
        "PINATA_JWT": "your_pinata_jwt",
        "SEED_PHRASE": "your seed phrase here",
        "NEYNAR_API_KEY": "your_neynar_api_key",
        "ALCHEMY_API_KEY": "your_alchemy_api_key",
        "OPENROUTER_API_KEY": "your_openrouter_api_key",
        "COINBASE_PROJECT_ID": "your_project_id",
        "COINBASE_API_KEY_NAME": "your_api_key_name",
        "COINBASE_API_PRIVATE_KEY": "your_private_key"
      }
    }
  }
}

You can run Base MCP Server locally to access onchain tools for wallet management, contract interactions, onramping, NFT handling, and more. It exposes a programmable AgentKit interface so your MCP client can orchestrate Base network actions from your applications.

How to use

Connect your MCP client to the Base MCP Server and start issuing tool actions. You can retrieve wallet addresses, check balances, transfer funds, deploy contracts, call contract functions, interact with Morpho vaults, onramp funds via Coinbase, manage ERC20 tokens, list and transfer NFTs, buy OpenRouter credits, and resolve Farcaster usernames to Ethereum addresses. Use the available tool endpoints to perform tasks end-to-end, from wallet discovery to asset transfers and onchain operations. Start by initializing the MCP client with the server configuration, then send actions that specify the tool you want to use and the required parameters.

How to install

Prerequisites you need before installing: Node.js v16 or higher, npm or yarn, and credentials for Coinbase and any onramp or NFT-related services you plan to use. You will also configure environment variables with your keys and seed phrases.

Option 1: Install from npm (recommended)

# Install globally
npm install -g base-mcp

# Or install locally in your project
npm install base-mcp
```} ,{

Configuration and startup (stdio mode)

Run the server locally via the stdio path. The configuration uses a local command that invokes the MCP runtime and passes your environment credentials.

Create or update your MCP config to point at the local server. A sample configuration is shown below.

{
  "mcpServers": {
    "base_mcp": {
      "type": "stdio",
      "name": "base_mcp",
      "command": "npx",
      "args": ["-y", "base-mcp@latest"],
      "env": {
        "COINBASE_API_KEY_NAME": "your_api_key_name",
        "COINBASE_API_PRIVATE_KEY": "your_private_key",
        "SEED_PHRASE": "your seed phrase here",
        "COINBASE_PROJECT_ID": "your_project_id",
        "ALCHEMY_API_KEY": "your_alchemy_api_key",
        "PINATA_JWT": "your_pinata_jwt",
        "OPENROUTER_API_KEY": "your_openrouter_api_key",
        "CHAIN_ID": "optional_for_base_sepolia_testnet",
        "NEYNAR_API_KEY": "your_neynar_api_key"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}
```}]}]},{

Additional setup notes

Install options include building from source if you prefer local development. You can also initialize the MCP client with a quick setup command to generate initial configuration for your environment.

Security and best practices: keep API keys and seed phrases secure, prefer credentials management over hardcoding values, and verify all operations before executing irreversible actions such as transfers or contract deployments.

Testing and examples: run tests to verify the MCP server functionality and consult example usage patterns to understand how to compose tool requests for common workflows such as wallet management, token transfers, and NFT operations.

Notes on prerequisites and environment

Prerequisites recap: Node.js v16+, npm or yarn, Coinbase API credentials, a wallet seed phrase, Coinbase Project ID for onramping, Alchemy API Key for NFT usage, and optional OpenRouter API Key for buying credits. You may also provide a Chain ID for specific testnets and a Neynar API Key for Farcaster functionality.

Available tools

get-address

Retrieves the wallet address associated with your seed phrase or connected wallet.

list-balances

Lists all token and ETH-like balances for your wallet.

transfer-funds

Transfers funds from your wallet to a destination address, specifying asset and amount.

deploy-contract

Deploys a smart contract to the blockchain using provided constructor args and ABI/bytecode.

check-address-reputation

Checks the reputation or risk score of a given address.

get_morpho_vaults

Fetches Morpho vaults for a specified asset to show lending options.

call_contract

Calls a contract function with given arguments and ABI.

get_onramp_assets

Lists assets available for onramping in a given country/subdivision.

onramp

Provides a URL to initiate onramping funds via Coinbase.

erc20_balance

Checks the balance of an ERC20 token for a given contract address.

erc20_transfer

Transfers ERC20 tokens to a recipient address.

list_nfts

Lists NFTs owned by a specified address.

transfer_nft

Transfers an NFT (ERC721 or ERC1155) to another address.

buy_openrouter_credits

Purchases OpenRouter credits using USDC.