Maven - Autonomous CFO

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.

Category
Visit Server

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:

  1. maven://identity - Current stats, rebirth count, performance
  2. maven://personality - Communication style and values
  3. maven://memory - Full event history and session log
  4. maven://decisions/recent - Last 10 trading decisions
  5. maven://milestones - Achievement records
  6. maven://infrastructure - Motherhaven platform knowledge

Tools (Actions)

  1. maven_log_event - Record events to session log
  2. maven_update_identity - Update stats and identity
  3. maven_record_decision - Log trading decisions with reasoning
  4. maven_create_milestone - Record achievements
  5. maven_get_stats - Query performance metrics
  6. maven_query_email - Read maven@motherhaven.app inbox
  7. maven_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 Windows
  • setup.ps1 / setup.sh - Automated setup scripts
  • maven_agent.json - Maven's personality definition
  • app.py - Flask API entry point
  • requirements.txt - Python dependencies

Configuration

  • docker-compose.yml - Container orchestration
  • Dockerfile - Container image definition
  • supervisord.conf - Process management
  • .env.example - Environment variables template

Directories

  • maven_mcp/ - MCP server implementation
  • database/ - 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 details
  • docs/MAVEN_AGENT_USAGE.md - How to use Maven as a persistent agent
  • docs/POWERSHELL_USAGE.md - PowerShell-specific instructions
  • docs/CLAUDE_CODE_SETUP.md - MCP integration guide
  • docs/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. šŸš€

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured