A Next.js and Flask application that allows users to chat with NBA team GMs and simulate a multi-agent trading system where AI-powered GMs autonomously negotiate with each other.
This project combines:
- Chat Interface: Talk to AI-powered NBA team GMs for insights and strategy
- Trading System: Simulate being a GM and make trades with AI-powered team GMs
- Agent-to-Agent Communication: AI GMs negotiate trades with each other based on team needs and player valuations
/frontend: Next.js application with UI components/mcp-client: Python client for MCP and trading system backend/mcp-server: MCP server for NBA data/nba-mcp-server: MCP server with NBA API integration
- Select any NBA team and chat with their GM
- Ask about team strategy, players, and insights
- Leverages Claude to generate realistic GM responses
- Take control of any NBA team as the GM
- View team roster, salary information, and league activity
- Propose trades to other teams
- Receive counter-offers
- Watch AI GMs make trades with each other
- League simulation that progresses the state of teams
The trading system is built on a multi-agent architecture where each team has an AI agent that:
- Evaluates Players: Considers stats, contract, age, and position
- Analyzes Team Needs: Identifies positional needs and roster holes
- Makes Strategic Decisions: Decides whether to accept, reject, or counter trade offers
- Proposes Trades: Initiates trades with other teams based on needs
- Validates Trades: Ensures trades comply with simplified NBA rules
- Install dependencies:
cd frontend
npm install- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
- Install dependencies:
cd mcp-client
pip install -r requirements.txt- Run the Flask server:
python flask_server.py ../nba-mcp-server/nba_server.py- GMAgent: AI agent that represents each team's GM
- LeagueState: Central data model tracking teams, players and trades
- Flask Server: API endpoints for chat and trade functionality
- TeamDashboard: UI for viewing team roster and league activity
- TradeModal: Interface for proposing and responding to trades
- LeagueActivity: Feed showing recent trades and negotiations
To test the trading system functionality:
cd mcp-client
python test_trades.pyThis will run through test scenarios for:
- Trade proposal acceptance
- Trade proposal rejection
- Counter offers
- Agent-to-agent trading
- More sophisticated player valuation algorithms
- Draft pick trading
- Salary cap exceptions
- Three-team trades
- Season simulation
- Win-loss record tracking
- Next.js & React: Frontend UI
- TailwindCSS: Styling
- Flask: Backend API
- Claude AI: GM conversations and trade evaluations
- MCP Protocol: Multi-agent communication
- NBA API: Team and player data
- NBA data provided by NBA API
- Original MCP server code by obinopaul on GitHub
- Created for the MCP Hackathon