Get the FREE Ultimate OpenClaw Setup Guide →

base

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

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio base-base-mcp npx -y base-mcp@latest \
  --env CHAIN_ID="optional_for_base_sepolia_testnet" \
  --env PINATA_JWT="your_pinata_jwt" \
  --env SEED_PHRASE="your seed phrase here" \
  --env NEYNAR_API_KEY="your_neynar_api_key" \
  --env ALCHEMY_API_KEY="your_alchemy_api_key" \
  --env OPENROUTER_API_KEY="your_openrouter_api_key" \
  --env COINBASE_PROJECT_ID="your_project_id" \
  --env COINBASE_API_KEY_NAME="your_api_key_name" \
  --env COINBASE_API_PRIVATE_KEY="your_private_key"

How to use

Base MCP is an extensible server that exposes onchain tools for interacting with the Base network and Coinbase API through a consistent MCP interface. It offers capabilities such as retrieving wallet addresses, listing balances, transferring funds, deploying smart contracts, interacting with Morpho vaults, calling contract functions, managing ERC20 tokens, and handling NFTs (ERC721 and ERC1155). It also supports onramping funds via Coinbase and purchasing OpenRouter credits, plus utilities like resolving Farcaster usernames to Ethereum addresses. You can access these tools via natural language queries in Claude Desktop or other MCP clients that support the MCP protocol. The server is designed to be extended with new tools by adding modules under src/tools and registering them in the main configuration, making it straightforward to add custom capabilities for Base or other workflows.

How to install

Prerequisites:

  • Node.js (v16 or higher) and npm
  • Git (optional, for cloning the repo)
  • Coinbase API credentials, a wallet seed phrase, and Base-related API keys as described in the README

Option 1: Install from npm (Recommended)

# Install globally
npm install -g base-mcp

# Or install locally in your project
npm install base-mcp

Once installed, configure clients with the following command:

base-mcp --init

Option 2: Install from Source

  1. Clone this repository:
git clone https://github.com/base/base-mcp.git
cd base-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Optionally, link it globally:
npm link

Configuration: Create a .env file with your credentials as shown in the README, including COINBASE_API_KEY_NAME, COINBASE_API_PRIVATE_KEY, SEED_PHRASE, COINBASE_PROJECT_ID, ALCHEMY_API_KEY, OPENROUTER_API_KEY, CHAIN_ID, NEYNAR_API_KEY, and PINATA_JWT if needed.

Additional notes

Tips and common considerations:

  • Ensure your environment variables are kept secure and never committed to version control.
  • For NFT functionality, an Alchemy API Key is required; ensure your Alchemy account is configured for ERC721/ERC1155 support.
  • If using Base Sepolia testnet, set CHAIN_ID accordingly (84532); otherwise omit if using Base Mainnet.
  • The integration example shows Claude Desktop; you can adapt to other MCP clients by matching the server name (e.g., base-mcp) and providing the same environment variables.
  • When adding new tools, follow the project structure under src/tools and update src/main.ts to register the tool; include tests and documentation for the best results.

Related MCP Servers

Sponsor this space

Reach thousands of developers