🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

value-investing-agent

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

value-investing-agent

AI-powered MCP server for value investors. Analyze stocks using principles from Benjamin Graham and Warren Buffett.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

English | 中文

Value Investing Agent

An AI-powered MCP server for value investors. Analyze stocks using principles from Benjamin Graham and Warren Buffett. Every value investor deserves their own AI agent.

"Price is what you pay. Value is what you get." - Warren Buffett

License: MIT Node.js Version MCP

Disclaimer

This tool is for educational and research purposes only. It does not constitute investment advice. Investing involves risks, including the potential loss of principal. The author is not responsible for any investment decisions made based on this tool.

Features

  • 📊 Real-time Stock Data - Quotes, financials, and company profiles
  • 🧮 Intrinsic Value Calculation - DCF model and Graham Number
  • 🏰 Moat Analysis - Evaluate competitive advantages
  • 📰 News Aggregation - Stay informed on your watchlist
  • 📝 Report Generation - Daily summaries and deep analysis reports
  • 🔌 Pluggable Data Sources - Easy to add your own data providers

Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • Any MCP-compatible client (Claude Desktop, Claude Code, or your own application)

Note: This is a standalone MCP server that can run on Windows, macOS, or Linux. It can be used with any application that supports the Model Context Protocol, not just Claude products.

Installation

No installation required. Configure MCP directly:

{
  "mcpServers": {
    "value-investing-agent": {
      "command": "npx",
      "args": ["-y", "value-investing-agent"]
    }
  }
}

Option 2: Global Install

npm install -g value-investing-agent

Configure MCP:

{
  "mcpServers": {
    "value-investing-agent": {
      "command": "value-investing-agent"
    }
  }
}

Option 3: From Source

git clone https://github.com/danielchu97/Value-Investing-Agent.git
cd Value-Investing-Agent
npm install
npm run build

Configure MCP:

{
  "mcpServers": {
    "value-investing-agent": {
      "command": "node",
      "args": ["/path/to/value-investing-agent/dist/index.js"]
    }
  }
}

Configuration Files

Claude Desktop:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Usage

Get Stock Quote

"Get me the current quote for Apple"
"What's the price of MSFT?"

Analyze Intrinsic Value

"Calculate the intrinsic value of AAPL"
"What is Amazon's fair value using DCF?"

Evaluate Economic Moat

"Analyze the competitive moat of Coca-Cola"
"Does Microsoft have a wide moat?"

Manage Watchlist

"Add GOOGL to my watchlist in the Technology group"
"Show my watchlist"
"Remove TSLA from watchlist"

Generate Reports

"Generate a daily report for my watchlist"
"Create a detailed analysis report for Berkshire Hathaway"

Available Tools

ToolDescription
get_stock_quoteGet real-time stock quote and metrics
get_financialsFetch financial statements (income, balance, cash flow)
calculate_intrinsic_valueDCF and Graham valuation with margin of safety
analyze_moatEvaluate competitive advantages
get_newsGet stock-related news articles
manage_watchlistManage your personal stock watchlist
generate_daily_reportDaily summary of watchlist stocks
generate_stock_reportComprehensive value investing analysis
set_providerSwitch data provider
list_providersList available data providers

Data Providers

The plugin architecture allows you to add your own data sources. See Custom Provider Guide.

Built-in Providers

ProviderAPI KeyRate LimitBest For
yahoo-finance (default)Not requiredLimited (may hit 429 errors)Quick testing
finnhubRequired (free)60 calls/minProduction use
alpha-vantageRequired (free)5 calls/minBasic data needs

Configuring API Keys

Finnhub (Recommended for reliable access):

  • Get free API key at finnhub.io/register
  • Set environment variable:
    export FINNHUB_API_KEY=your_api_key_here
    
    Or in Claude Desktop config:
    {
      "mcpServers": {
        "value-investing-agent": {
          "command": "npx",
          "args": ["-y", "value-investing-agent"],
          "env": {
            "FINNHUB_API_KEY": "your_api_key_here"
          }
        }
      }
    }
    

Alpha Vantage:

  • Get free API key at alphavantage.co
  • Set environment variable: ALPHA_VANTAGE_API_KEY=your_key

Switching Providers

"Switch to finnhub provider"
"Use alpha-vantage for data"
"List available providers"

Adding a Custom Provider

  • Copy src/providers/provider-template.ts
  • Implement the DataProvider interface
  • Register in src/providers/index.ts
import { MyProvider } from './my-provider';
registerProvider('my-provider', (config) => new MyProvider(config));

Value Investing Principles

This tool is built on timeless investment principles:

1. Intrinsic Value

A company's true worth based on future cash flows, not market price.

2. Margin of Safety

Buy only when price is significantly below intrinsic value (25%+ discount).

3. Economic Moat

Seek durable competitive advantages that protect profits.

4. Circle of Competence

Only invest in businesses you understand.

5. Mr. Market

Use market emotions as opportunities, don't be ruled by them.

Key Metrics

Valuation

  • P/E Ratio: < 15 (undervalued)
  • P/B Ratio: < 1.5 (undervalued)
  • Graham Number: Price ceiling for defensive investors

Profitability

  • ROE: > 15% (excellent)
  • Gross Margin: > 40% (pricing power)
  • Net Margin: > 10% (efficient)

Safety

  • Current Ratio: > 1.5 (liquid)
  • Debt/Equity: < 1.0 (conservative)
  • Interest Coverage: > 5x (safe)

Development

# Install dependencies
npm install

# Build
npm run build

# Development mode (watch)
npm run dev

# Run tests
npm test

# Lint
npm run lint

Project Structure

value-investing-agent/
├── src/
│   ├── index.ts              # Entry point
│   ├── server.ts             # MCP server
│   ├── providers/            # Data providers
│   ├── tools/                # MCP tools
│   ├── analysis/             # Analysis engine
│   ├── utils/                # Utilities
│   ├── config/               # Configuration
│   └── types/                # TypeScript types
├── skills/                   # Claude skills
├── data/                     # Local data (watchlist, cache)
├── docs/                     # Documentation
└── tests/                    # Test files

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

  • Fork the repository
  • Create a feature branch
  • Make your changes
  • Run tests
  • Submit a pull request

License

MIT License - see LICENSE for details.

Acknowledgments

This project is inspired by the investment wisdom of:

  • Benjamin Graham - The Intelligent Investor, Security Analysis
  • Warren Buffett - Berkshire Hathaway Letters to Shareholders
  • Charlie Munger - Poor Charlie's Almanack

Resources

Remember: "The stock market is designed to transfer money from the active to the patient." - Warren Buffett

Keywords

mcp

FAQs

Package last updated on 29 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts