A comprehensive Model Context Protocol (MCP) based payment distribution system for open source projects using stablecoins. This system enables fair and transparent compensation for contributors based on various contribution metrics.
- MCP-based Architecture: Intelligent payment distribution using Model Context Protocol
- Multiple Payment Models:
- Contribution-based payments (commits, PRs, issues)
- Time-based compensation
- Milestone-based rewards
- Reputation-weighted distributions
- Blockchain Integration: Secure stablecoin payments via smart contracts
- Real-time Notifications: Stay updated on payments and contributions
- Analytics Dashboard: Comprehensive insights and trends
- Modern React 18 with TypeScript
- Web3 Integration with MetaMask support
- Real-time Data with React Query
- Interactive Charts using Recharts and D3.js
- Responsive Design with Tailwind CSS
- Enhanced UX with multi-step forms and notifications
- FastAPI with async support
- Smart Contract Integration via Web3.py
- Database Models with SQLAlchemy
- Contribution Tracking from GitHub
- Payment Processing with batch operations
- Notification System for real-time updates
- Clone the repository:
git clone <repository-url>
cd mcp-payment-system
- Run the setup script:
./scripts/setup.sh
- Access the application:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
- Run the application:
uvicorn app.main:app --reload
- Navigate to frontend directory:
cd frontend
- Install dependencies:
npm install
- Set up environment:
cp .env.example .env
# Edit with your configuration
- Start development server:
npm run dev
- For production build:
npm run build
- Install Foundry (if not already installed):
curl -L https://foundry.paradigm.xyz | bash
foundryup
- Install dependencies:
forge install
- Compile contracts:
forge build
- Deploy contracts:
forge script script/Deploy.s.sol --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --broadcast
- Connect Wallet: Use MetaMask to connect your Ethereum wallet
- Browse Projects: Explore active projects seeking contributions
- Submit Contributions: Add your work and track approval status
- Receive Payments: Get compensated automatically based on contribution value
- Create Project: Set up your project with GitHub integration
- Configure Payment Rules: Choose contribution-based, time-based, or milestone payments
- Review Contributions: Approve or reject submitted work
- Distribute Payments: Create batch payments for approved contributions
- Monitor Analytics: Track system-wide metrics and trends
- Manage Projects: Oversee project health and activity
- Review Payments: Monitor payment distribution and success rates
Backend (.env):
DATABASE_URL=postgresql://user:password@localhost:5432/mcp_payment
WEB3_PROVIDER_URI=https://mainnet.infura.io/v3/your-project-id
PAYMENT_DISTRIBUTOR_ADDRESS=0x...
SIGNER_PRIVATE_KEY=your-private-key
GITHUB_TOKEN=your-github-token
Frontend (.env):
VITE_API_URL=http://localhost:8000
VITE_PAYMENT_DISTRIBUTOR_ADDRESS=0x...
VITE_CHAIN_ID=1337
The API provides comprehensive endpoints for:
- Projects: CRUD operations for project management
- Payments: Create and track payment distributions
- Contributions: Submit and manage contributions
- Analytics: System-wide metrics and insights
- Notifications: Real-time user notifications
Access interactive API documentation at: http://localhost:8000/docs
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ Smart Contract │
│ (React) │◄──►│ (FastAPI) │◄──►│ (Solidity) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Web3 Wallet │ │ Database │ │ Blockchain │
│ (MetaMask) │ │ (PostgreSQL) │ │ (Ethereum) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- React 18 with TypeScript
- Vite for build tooling and development
- Web3 Integration with ethers.js and web3-react
- UI Framework with Tailwind CSS and Headless UI
- Data Visualization using Recharts and D3.js
- State Management with React Query
- Routing with React Router
- FastAPI with async/await support
- SQLAlchemy ORM with PostgreSQL
- Web3.py for blockchain interaction
- Alembic for database migrations
- Redis for caching and sessions
- Celery for background tasks
- Solidity 0.8.19
- Foundry for development and testing
- OpenZeppelin for security standards
- ERC20 token support (USDC)
- Docker and Docker Compose
- PostgreSQL database
- Redis for caching
- GitHub Actions for CI/CD
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Python: Follow PEP 8, use Black for formatting
- TypeScript: Use Prettier and ESLint
- Solidity: Follow Solidity style guide
pytest
cd frontend
npm test
forge test
- Set up production environment variables
- Deploy smart contracts to mainnet
- Build and deploy backend services
- Build and deploy frontend
- Configure monitoring and logging
docker-compose up -d
- Smart Contract Security: Audited contracts with OpenZeppelin standards
- API Security: JWT authentication and rate limiting
- Database Security: Encrypted connections and parameterized queries
- Frontend Security: Content Security Policy and XSS protection
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the
/docs
folder for detailed guides - Issues: Report bugs and request features via GitHub Issues
- Community: Join our Discord server for discussions
- Multi-chain Support: Expand beyond Ethereum
- Advanced Analytics: ML-powered contribution analysis
- Mobile App: React Native mobile application
- DAO Integration: Governance token and voting
- API Integrations: GitLab, Bitbucket support
- Advanced Notifications: Email, Slack, Discord