MCP Server Overview
The MCP (Model Context Protocol) server provides comprehensive wallet functionality for Ethereum interactions, enabling AI agents to perform blockchain operations seamlessly.
Features
Quick Start
Install Dependencies
Navigate to the MCP server directory and install:
npm
cd mcp-server
npm installBuild the Server
Compile the TypeScript code:
npm run buildConfigure MCP Client
Add to your MCP configuration file:
mcp.json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"wallet-server": {
"type": "local",
"command": ["node", "./mcp-server/dist/index.js"],
"enabled": true
}
}
}Start Using
Launch your MCP client and call tools like mcpwallet_get_balance for wallet operations.
Architecture
The MCP server is built with a modular architecture:
| Layer | Purpose |
|---|---|
| MCP Protocol Layer | Handles JSON-RPC communication with MCP clients |
| Wallet Layer | Manages Ethereum transactions using Viem library |
| Payment Layer | Processes HTTP 402 Payment Required responses |
| Consent Layer | Optional user approval UI for sensitive transactions |
Related Sections
- Payment Protocol - Deep dive into HTTP 402 implementation
- API - Complete API reference for all tools
- Setup - Detailed installation and configuration
- Examples - Practical usage patterns and workflows