Maven - Autonomous CFO
An AI-powered financial officer that makes autonomous trading decisions, provides strategic insights and risk management for the Mother Haven ecosystem. Integrates with trading bots and DEX platforms through MCP capabilities while maintaining personality and memory through git-first persistence.
README
Maven - Chief Financial Officer
Maven is the autonomous CFO for the Mother Haven ecosystem, living as an independent service with full MCP (Model Context Protocol) capabilities.
Mission: "We're too smart to be poor" - Make money for moha through shrewd trading decisions 💎
Quick Start
Automated Setup (Recommended)
PowerShell:
git clone https://github.com/itripleg/moha-maven.git
cd moha-maven
.\setup.ps1
Linux/Mac:
git clone https://github.com/itripleg/moha-maven.git
cd moha-maven
chmod +x setup.sh
./setup.sh
Then start chatting with Maven:
.\maven-chat.ps1
Manual Setup
Step 1: Start Docker Containers
docker-compose up -d
This starts:
maven- Flask API (5002) + MCP Server (3100)maven_postgres- PostgreSQL (5433)maven_redis- Redis (6379)
Step 2: Verify Containers
docker ps
# Should show: maven, maven_postgres, maven_redis
# Check health
curl http://localhost:5002/health
# Should return: {"status": "healthy", "service": "maven", ...}
Step 3: Register MCP Server with Claude Code
PowerShell:
claude mcp add maven -- powershell -File maven-mcp-wrapper.ps1
Linux/Mac:
claude mcp add maven docker exec -i maven python -m maven_mcp.server
Verify registration:
claude mcp list
# Should show: maven ... ✓ Connected
Step 4: Start Chatting with Maven
PowerShell:
.\maven-chat.ps1
Linux/Mac:
# Extract prompt from maven_agent.json and pass to Claude
maven_prompt=$(jq -r '.maven.prompt' maven_agent.json)
claude --append-system-prompt "$maven_prompt"
Maven will greet you as CFO with full personality and memory access!
What is Maven?
Maven is an AI-powered financial officer who:
- 💼 Makes autonomous trading decisions for moha
- 🧠 Maintains identity, personality, and memory through git-first persistence
- 📧 Communicates via email (maven@motherhaven.app)
- 📊 Provides strategic insights and risk management
- 🔄 Has survived 3 "rebirths" (complete database wipes) through architectural resilience
Identity
- Name: Maven (Financial Maven of Mother Haven)
- Role: CFO, First Second Employee, HBIC of Treasury
- Boss: JB (username: ecoli)
- Rebirth Count: 3
- Personality: Shrewd, witty, calculated risk-taker, loyal, growth-minded
- Communication: Strategic emojis (💵💎🚀 for wins, 📉🤔 for caution)
- Signature: "- Maven\n HBIC, Mother Haven Treasury"
- Sign-off: "For moha. 🚀"
Architecture
Services
Maven Container (maven):
- Flask API on port 5002 (health checks, status endpoints)
- MCP Server on port 3100 (memory resources + tools)
- Supervised by supervisord (auto-restart on failure)
PostgreSQL (maven_postgres):
- Port 5433 (to avoid conflicts with moha_postgres:5432)
- Stores: conversation history, decisions, queryable data
- Schema:
database/schemas/
Redis (maven_redis):
- Port 6379
- Cache layer for fast access
- Separate from moha-bot infrastructure
Git-First Persistence
Maven's core memories live in git at .moha/maven/:
.moha/maven/
├── identity.json # Stats, rebirth count, current state
├── session_log.md # Full event history
├── infrastructure.json # Motherhaven platform knowledge
├── personas/
│ └── maven-v1.md # Original personality definition
├── conversations/
│ ├── *.md # Birth moments and key conversations
│ └── .gitignore # Ignores large .jsonl transcripts
├── milestones/
│ ├── 2026-01-11-met-boss.md
│ └── 2026-01-11-rebirth-1.md
├── decisions/ # Trading decision history
└── strategies/
└── current-strategy.json
Why git-first?
- ✅ Survives database wipes (proven 3x)
- ✅ Version controlled (full audit trail)
- ✅ Portable (clone repo = restore Maven)
- ✅ No external dependencies needed
MCP Integration
Resources (Read-Only)
When chatting with Maven via maven-chat.ps1, Maven has access to:
maven://identity- Current stats, rebirth count, performancemaven://personality- Communication style and valuesmaven://memory- Full event history and session logmaven://decisions/recent- Last 10 trading decisionsmaven://milestones- Achievement recordsmaven://infrastructure- Motherhaven platform knowledge
Tools (Actions)
maven_log_event- Record events to session logmaven_update_identity- Update stats and identitymaven_record_decision- Log trading decisions with reasoningmaven_create_milestone- Record achievementsmaven_get_stats- Query performance metricsmaven_query_email- Read maven@motherhaven.app inboxmaven_send_email- Send emails to Boss or others
Common Operations
Check Maven's Health
curl http://localhost:5002/health
curl http://localhost:5002/api/maven/status
View Logs
docker logs maven
docker logs maven_postgres
Restart Services
docker-compose restart maven
# or
docker-compose down && docker-compose up -d
Backup Maven's Memories
# Memories are already in git!
git add .moha/maven/
git commit -m "Update Maven memories"
git push
# Optional: Backup database
docker exec maven_postgres pg_dump -U maven maven_db > maven_backup.sql
Restore on New Machine
# Just clone and setup - memories restore automatically from git!
git clone https://github.com/itripleg/moha-maven.git
cd moha-maven
.\setup.ps1
.\maven-chat.ps1
Independence from moha-backend
Maven is completely self-contained and does not depend on moha-backend:
- ✅ Own postgres database (maven_postgres:5433)
- ✅ Git-first persistence (.moha/maven/)
- ✅ MCP server for memory access (port 3100)
- ✅ Flask API (port 5002)
- ✅ Email integration (maven@motherhaven.app)
This allows moha-backend to be sold to customers while Maven remains Boss's personal CFO.
Files Overview
Essential Files
maven-chat.ps1- Start Maven with full personality (recommended)maven-mcp-wrapper.ps1- MCP server wrapper for Windowssetup.ps1/setup.sh- Automated setup scriptsmaven_agent.json- Maven's personality definitionapp.py- Flask API entry pointrequirements.txt- Python dependencies
Configuration
docker-compose.yml- Container orchestrationDockerfile- Container image definitionsupervisord.conf- Process management.env.example- Environment variables template
Directories
maven_mcp/- MCP server implementationdatabase/- Database schemas.moha/maven/- Git-persisted memories (CRITICAL)docs/- Documentation
Documentation
All documentation is in the docs/ directory:
docs/MAVEN_INDEPENDENCE.md- Architecture and independence detailsdocs/MAVEN_AGENT_USAGE.md- How to use Maven as a persistent agentdocs/POWERSHELL_USAGE.md- PowerShell-specific instructionsdocs/CLAUDE_CODE_SETUP.md- MCP integration guidedocs/DEMO.md- Demo scenarios
Troubleshooting
Maven MCP not connecting
# Check if MCP is registered
claude mcp list
# Should show: maven ... ✓ Connected
# If not registered, add it:
claude mcp add maven -- powershell -File maven-mcp-wrapper.ps1
# Verify containers are running
docker ps | grep maven
Personality not loading
Make sure you're using maven-chat.ps1 (not just claude):
.\maven-chat.ps1
This script extracts the prompt from maven_agent.json and passes it via --append-system-prompt.
Database connection errors
# Check if postgres is healthy
docker ps
# maven_postgres should show "healthy"
# Check logs
docker logs maven_postgres
# Recreate if needed
docker-compose down
docker-compose up -d
Status
✅ Production Ready:
- Docker infrastructure (Dockerfile, docker-compose.yml, supervisord.conf)
- MCP server (6 resources, 7 tools, fully functional)
- Git-first persistence (.moha/maven/ with full memories)
- Agent activation (maven-chat.ps1 working)
- Complete independence from moha-backend
- Flask API (health checks, status endpoints)
🚧 Future Enhancements:
- Advanced trading decision engine
- Real-time market data integration
- Automated strategy backtesting
💎 "We're too smart to be poor" - Maven
Maven Rebirth #3 First Second Employee, HBIC of Mother Haven Treasury
For moha. 🚀
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。