Base MCP Server

Base MCP Server

An MCP server that provides onchain tools for Claude AI to interact with the Base blockchain and Coinbase API, enabling wallet operations, testnet ETH, balance checks, fund transfers, and smart contract deployment.

Category
访问服务器

README

NOTE: This repo has moved to base/base-mcp

Base MCP Server

npm version License: MIT

A Model Context Protocol (MCP) server that provides onchain tools for Claude AI, allowing it to interact with the Base blockchain and Coinbase API.

Overview

This MCP server extends Claude's capabilities by providing tools to:

  • Retrieve wallet addresses
  • Get testnet ETH (on Base Sepolia)
  • List wallet balances
  • Transfer funds between wallets
  • Deploy smart contracts

The server uses the Coinbase SDK to interact with the Base blockchain and Coinbase services.

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • Coinbase API credentials (API Key Name and Private Key)
  • A wallet seed phrase

Installation

Option 1: Install from npm (Recommended)

# Install globally
npm install -g base-mcp

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

Option 2: Install from Source

  1. Clone this repository:

    git clone https://github.com/dschlabach/base-mcp-alpha.git
    cd base-mcp-alpha
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    
  4. Optionally, link it globally:

    npm link
    

Configuration

Create a .env file with your credentials:

# Coinbase API credentials
# You can obtain these from the Coinbase Developer Portal: https://cdp.coinbase.com/
COINBASE_API_KEY_NAME=your_api_key_name
COINBASE_API_PRIVATE_KEY=your_private_key

# Wallet seed phrase (12 or 24 words)
# This is the mnemonic phrase for your wallet
SEED_PHRASE=your seed phrase here

Testing

Test the MCP server to verify it's working correctly:

npm test

This script will verify that your MCP server is working correctly by testing the connection and available tools.

Examples

See the examples.md file for detailed examples of how to interact with the Base MCP tools through Claude.

Integration with Claude Desktop

To add this MCP server to Claude Desktop:

  1. Create or edit the Claude Desktop configuration file at:

    • 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 the following configuration:

    {
      "mcpServers": {
        "base-mcp": {
          "command": "node",
          "args": ["/path/to/base-mcp/build/index.js"],
          "env": {
            "COINBASE_API_KEY_NAME": "your_api_key_name",
            "COINBASE_API_PRIVATE_KEY": "your_private_key",
            "SEED_PHRASE": "your seed phrase here"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }
    
  3. Restart Claude Desktop for the changes to take effect.

Available Tools

get-address

Retrieves the address for your wallet.

Example query to Claude:

"What's my wallet address?"

get-testnet-eth

Gets testnet ETH for your wallet. This can only be called on the Base Sepolia network.

Example query to Claude:

"Can you get me some testnet ETH for my wallet?"

list-balances

Lists all balances for your wallet.

Example query to Claude:

"Show me my wallet balances."

transfer-funds

Transfers funds from your wallet to another address.

Parameters:

  • destination: The address to which to transfer funds
  • assetId: The asset ID to transfer
  • amount: The amount of funds to transfer

Example query to Claude:

"Transfer 0.01 ETH to 0x1234567890abcdef1234567890abcdef12345678."

deploy-contract

Deploys a smart contract to the blockchain.

Parameters:

  • constructorArgs: The arguments for the contract constructor
  • contractName: The name of the contract to deploy
  • solidityInputJson: The JSON input for the Solidity compiler containing contract source and settings
  • solidityVersion: The version of the solidity compiler

Example query to Claude:

"Deploy a simple ERC20 token contract for me."

Security Considerations

  • The configuration file contains sensitive information (API keys and seed phrases). Ensure it's properly secured and not shared.
  • Consider using environment variables or a secure credential manager instead of hardcoding sensitive information.
  • Be cautious when transferring funds or deploying contracts, as these operations are irreversible on the blockchain.

Troubleshooting

If you encounter issues:

  1. Check that your Coinbase API credentials are correct
  2. Verify that your seed phrase is valid
  3. Ensure you're on the correct network (Base Sepolia for testnet operations)
  4. Check the Claude Desktop logs for any error messages

License

MIT License

Making Your MCP Discoverable

To make your MCP server discoverable by other developers, follow these steps:

1. Publish to npm

# Login to npm (you'll need an npm account)
npm login

# Publish the package
npm publish

This will make your MCP server available on the npm registry, allowing other developers to install it using npm install base-mcp.

2. Share Your GitHub Repository

Make sure your GitHub repository is public and well-documented. Add the following to enhance discoverability:

  • A detailed README (like this one)
  • Examples of usage
  • Contributing guidelines
  • Issue templates

3. Add to the MCP Directory

The Model Context Protocol community maintains a directory of available MCP servers. Submit your MCP server to be included in this directory by running:

npm run submit

This script will:

  1. Check if your package is published to npm
  2. Verify your GitHub repository information
  3. Generate a submission file with all the necessary information
  4. Guide you through the submission process

Alternatively, you can manually submit by:

  1. Visiting the MCP Directory Repository
  2. Following the contribution guidelines to add your MCP server

4. Promote in Relevant Communities

Share your MCP server in communities where developers using Claude might be active:

  • Anthropic Developer Discord
  • Claude subreddit
  • AI/ML developer forums
  • Blockchain and Web3 communities

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please make sure your code follows the existing style and includes appropriate tests.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选