Skip to main content

Charlie Munger Investment Analysis 🎯

"I'm not paid to be easy. I'm paid to be right." - Charlie Munger

AI-powered investment analysis using Charlie Munger's wisdom and framework. Available as both an MCP server for Claude Code and a universal Web API.

Python 3.10+ License: MIT FastAPI

Features

  • 🧠 Authentic Charlie Munger AI - Trained on Munger's actual investment philosophy
  • ⚡ Kill-Switch Framework - Automatic rejection of bad investments
  • 📊 100-Point Scoring System - Quantitative analysis with qualitative insights
  • 🔍 Smart Company Search - Yahoo Finance API integration with fuzzy matching
  • 🌍 International Coverage - Supports global exchanges (US, Europe, Asia)
  • 💬 Conversational Follow-ups - Ask deeper questions about any analysis
  • 📈 Multi-Stock Comparison - Rank investments head-to-head
  • 🚀 Two Interfaces - MCP server + Web API

Quick Start

Install Package

# Basic installation (MCP server only)
pip install financial-advisor-munger

# With web API support
pip install financial-advisor-munger[web]

# Development version
pip install financial-advisor-munger[web,dev]

Option 1: MCP Server (Claude Code)

# Start MCP server
munger-mcp

# Configure in Claude Code MCP settings:
{
  "mcpServers": {
    "munger": {
      "command": "munger-mcp",
      "args": []
    }
  }
}

Then use in Claude Code:

Can you analyze Apple stock using Munger's framework?

Option 2: Web API (Universal)

# Start web API server
munger-web --port 8000

# Server runs at http://localhost:8000
# API docs at http://localhost:8000/docs

Python Example:

import requests

# Analyze a stock
response = requests.post("http://localhost:8000/analyze",
                        json={"symbol": "AAPL"})
analysis = response.json()

print(f"Recommendation: {analysis['analysis']['recommendation']}")
print(f"Munger Score: {analysis['analysis']['munger_score']}/100")
print(f"Reasoning: {analysis['analysis']['key_reasoning'][0]}")

JavaScript Example:

// Analyze Apple stock
fetch('http://localhost:8000/analyze', {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({symbol: 'AAPL'})
})
.then(r => r.json())
.then(data => {
    console.log(`${data.analysis.recommendation}: ${data.analysis.munger_score}/100`);
    console.log(data.analysis.munger_voice);
});

cURL Example:

# Get Munger's take on Tesla
curl -X POST http://localhost:8000/analyze \
     -H "Content-Type: application/json" \
     -d '{"symbol": "TSLA"}'

API Endpoints

Endpoint Method Description
/analyze POST Full Munger analysis of a stock
/followup POST Ask follow-up questions
/compare POST Compare multiple stocks
/search POST Search for companies
/data/{symbol} GET Raw financial data
/health GET API health check

Docker Deployment

# Build and run
docker build -t munger-api .
docker run -p 8000:8000 munger-api

# Or use docker-compose
docker-compose up -d

Railway/Heroku Deployment

Railway:

# Deploy to Railway
railway login
railway init
railway add
railway deploy

Heroku:

# Deploy to Heroku
heroku create your-munger-api
git push heroku main

Environment Variables

# Optional configuration
MUNGER_API_HOST=0.0.0.0      # API host
MUNGER_API_PORT=8000         # API port
MUNGER_LOG_LEVEL=info        # Logging level
MUNGER_CACHE_TTL=300         # Cache duration (seconds)

Example Analysis Output

{
  "success": true,
  "symbol": "AAPL",
  "company": "Apple Inc.",
  "analysis": {
    "recommendation": "APPROVED",
    "munger_score": 85,
    "key_reasoning": [
      "Exceptional brand moat creates pricing power",
      "Capital-light ecosystem generates massive cash flows",
      "Management obsessed with capital efficiency"
    ],
    "munger_voice": "Apple's got something I respect: a business so good that even the government can't screw it up. When customers line up to pay premium prices for incremental improvements, you've got pricing power that would make John D. Rockefeller jealous...",
    "kill_switches": [],
    "follow_up_suggestions": [
      "what_could_go_wrong",
      "historical_context",
      "management_assessment"
    ]
  }
}

International Stocks

# European stocks
requests.post("/analyze", json={"symbol": "PNDORA.CO"})  # Pandora (Copenhagen)
requests.post("/analyze", json={"symbol": "NESN.SW"})    # Nestlé (Swiss)

# Asian stocks
requests.post("/analyze", json={"symbol": "7203.T"})     # Toyota (Tokyo)
requests.post("/analyze", json={"symbol": "0700.HK"})    # Tencent (Hong Kong)

Development

# Clone and setup
git clone https://github.com/user/financial-advisor-munger
cd financial-advisor-munger
pip install -e .[web,dev]

# Run tests
pytest

# Format code
black src/
ruff check src/

# Build package
python -m build

# Local development server
munger-web --reload --host 127.0.0.1

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure code passes black and ruff checks
  5. Submit a pull request

License

MIT License - see LICENSE file.

Disclaimer

This tool provides AI-generated investment analysis for educational purposes. Not financial advice. Charlie Munger's actual opinions may vary. Past performance doesn't predict future results.


"The big money is not in the buying and selling, but in the waiting." - Charlie Munger

Metadata

Release files for financial-advisor-munger 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for financial-advisor-munger 0.2.1
File Size Uploaded Provenance Actions
financial_advisor_munger-0.2.1.tar.gz 28.9 kB Without provenance Details for financial_advisor_munger-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for financial-advisor-munger 0.2.1
File Interpreter ABI Platform Actions
financial_advisor_munger-0.2.1-py3-none-any.whl Python 3 none any Details for financial_advisor_munger-0.2.1-py3-none-any.whl

Total release size: 53.8 kB

Release files / financial_advisor_munger-0.2.1.tar.gz

Download URL financial_advisor_munger-0.2.1.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8c4b93b945a2abcc8520fce334279a40986ccf5449c7db1eb7d9d5defe38cd81
BLAKE2b-256 checksum
How to use checksums
e437b6130992a934ed49b1d2d9e8b7dc02512761fd0c1c6155df8bedf16df14d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / financial_advisor_munger-0.2.1-py3-none-any.whl

Download URL financial_advisor_munger-0.2.1-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0483fcb4b8162515ff84b83b71207598cc7d64f0134c1e3a3934b460371dbdc5
BLAKE2b-256 checksum
How to use checksums
1553721be5c879aa350dd1da0f5f2dce63e9624440e42b758882d77579762783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for financial-advisor-munger 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page