Provides containerization support for running the PostgreSQL database, Redis cache, MCP Server, and Web DApp as a complete system
Handles environment variable configuration for the MCP Blockchain Server
Enables reading balances, contract state, and other on-chain data from the Ethereum blockchain, as well as preparing unsigned transactions for user approval and signing
Hosts the MCP Blockchain Server repository and provides dependency installation sources
Serves as the runtime environment for the MCP Blockchain Server
Manages package dependencies for the MCP Blockchain Server
Provides support for reading data and preparing transactions on the Polygon network as part of the multi-chain EVM-compatible blockchain support
Used for storing users, API keys, and transaction records in the MCP blockchain server system
Powers the Web DApp that provides the user interface for wallet connection and transaction signing
Utilized for caching frequently accessed blockchain data to improve performance
Used for implementing the MCP server and related components
Alternative package manager for installing dependencies
MCP Blockchain Server & DApp
A secure system enabling AI assistants to interact with blockchain smart contracts while ensuring users maintain complete control over their private keys and transaction signing.
Overview
This project addresses a key challenge in AI-blockchain integration: allowing AI assistants to read blockchain data and prepare transactions while ensuring users maintain exclusive control over transaction signing and private keys.
The system consists of:
- MCP Server: A Model Context Protocol server that exposes blockchain operations as tools that can be used by AI assistants
- Web DApp: A React application that provides a user interface for wallet connection and transaction signing
- Database: PostgreSQL database for storing users, API keys, and transaction records
- Caching: Redis for caching frequently accessed data
Features
MCP Server Features
- Blockchain Data Access: Read balances, contract state, and other on-chain data
- Transaction Preparation: Create unsigned transactions for user approval
- Multi-Chain Support: Works with Ethereum, Polygon, and other EVM-compatible chains
- Smart Contract Interaction: Read from verified smart contracts on supported networks
- Security-First Design: Private keys never leave the user's wallet
Web DApp Features
- Wallet Integration: Connect with MetaMask and other Web3 wallets
- Transaction Review: Clear UI for reviewing transaction details before signing
- Transaction Signing: Sign transactions with connected wallet
- Transaction Tracking: Monitor status of submitted transactions
- Mobile Compatibility: Responsive design works on all devices
Security Principles
- Private Key Isolation: Keys never leave the user's wallet
- Transaction Verification: Clear UI for reviewing transaction details
- API Authentication: Secure API key management
- Rate Limiting: Prevent abuse
- Input Validation: Sanitize all inputs
- Audit Logging: Track all operations
- HTTPS Only: Secure communications
- Content Security Policy: Prevent XSS
Transaction Flow
- AI assistant requests transaction through MCP Server
- MCP Server prepares unsigned transaction with UUID
- MCP Server returns transaction URL to AI assistant
- AI assistant provides URL to user
- User opens URL in browser
- User connects wallet and reviews transaction details
- User approves and signs transaction with their wallet
- Web DApp submits signed transaction to blockchain
- Transaction status is updated and tracked
Getting Started
Prerequisites
- Node.js (v18 or higher)
- npm or yarn
- PostgreSQL
- Redis (optional, for caching)
- Infura API key (for blockchain access)
- Etherscan API key (for contract ABIs)
Installation
- Clone the repository:
- Install dependencies:
- Set up environment variables:
Create a
.env
file in the root directory (or copy from.env.example
):
- Set up the database:
See Database Setup Guide for detailed instructions on installing and configuring PostgreSQL.
- Start the server:
Using Docker Compose
For a quick start using Docker:
This will start:
- PostgreSQL database
- Redis cache
- MCP Server
- Web DApp
Development
Server Structure
src/mcp
: MCP server implementationsrc/services
: Core business logic servicessrc/utils
: Utility functionssrc/index.ts
: Main entry point
Web DApp Structure
web/src/components
: React componentsweb/src/hooks
: Custom React hooksweb/src/services
: API servicesweb/src/pages
: Page components
Using the MCP Server
The MCP Server exposes several tools that can be used by AI assistants:
get-chains
: Get list of supported blockchain networksget-balance
: Get account balance for an addressread-contract
: Read data from a smart contractprepare-transaction
: Prepare an unsigned transaction for user approvalget-transaction-status
: Get the current status of a transaction
Example Tool Usage
Troubleshooting
If you encounter issues with dependencies:
For database connection issues, see the Database Setup Guide.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A secure system enabling AI assistants to interact with blockchain data and prepare transactions while ensuring users maintain exclusive control over their private keys and transaction signing.
- Overview
- Features
- Security Principles
- Transaction Flow
- Getting Started
- Development
- Using the MCP Server
- Troubleshooting
- License
Related Resources
Related MCP Servers
- -securityFlicense-qualityEnables secure interactions with cryptocurrency daemon RPC interfaces through AI assistants, supporting transaction management, wallet operations, and daemon monitoring for Bitcoin-derived cryptocurrencies.Last updated -1TypeScript
- AsecurityAlicenseAqualityEnables AI assistants to interact with the Hive blockchain through the Model Context Protocol, allowing for account info retrieval, content reading/creation, cryptocurrency transfers, and cryptographic operations.Last updated -13372TypeScriptISC License
- AsecurityAlicenseAqualityProvides tools for AI assistants to interact with the Ethereum blockchain through standard JSON-RPC methods, enabling queries for account balances, gas prices, and smart contract code.Last updated -63JavaScriptMIT License
- -securityAlicense-qualityA comprehensive toolkit for building AI agents with blockchain capabilities, enabling interactions with multiple blockchain networks for tasks like wallet management, fund transfers, smart contract interactions, and cross-chain asset bridging.Last updated -2TypeScriptGPL 3.0