Get the FREE Ultimate OpenClaw Setup Guide →

stock_valuation_calculator

Stock valuation with improved DCF model

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio starpastoral-stock_valuation_calculator uv --directory /path/to/your/project run python mcp_server.py

How to use

Stock Valuation Calculator is an MCP server that provides both enhanced DCF-based stock valuations and supporting utilities for single-stock, multi-stock, and portfolio analysis. It supports interactive AI-assisted queries via Ollama integration and direct command-line usage for batch processing, reverse DCF, and Excel report generation. With the enhanced DCF core, the server prioritizes a dynamic growth-rate model, automatic development-stage recognition, and multi-scenario valuation (conservative, neutral, aggressive), while still offering a traditional DCF fallback when needed. You can perform individual valuations, compare methods, compare against market expectations via reverse-DCF, and generate outputs in console reports or Excel formats. The MCP interface exposes endpoints that accept natural-language requests or scripted commands, enabling you to automate workflows and integrate valuation results into larger analyses.

How to install

Prerequisites:

  • Python 3.10+ installed on your system
  • uv (the universal validator/runner) available in your environment
  • Optional: Ollama for AI assistant features and internet connectivity for data sources

Step-by-step installation:

  1. Install uv if not already installed (Python-based runner for MCP):

    Example (macOS/Linux)

    curl -LsSf https://astral.sh/uv/install.sh | sh

  2. Install Python dependencies and set up the project environment (if your project provides a pyproject/requirements.txt, install them accordingly):

    uv sync

  3. Ensure necessary directories exist for data and outputs (as examples in the project):

    mkdir -p data output

  4. Optional AI assistant setup (requires Ollama and model download):

    Install Ollama (per platform)

    brew install ollama

    Start Ollama service

    ollama serve

    Download a recommended model

    ollama pull llama3.1

  5. Install MCP server components (in the project directory):

    uv sync --group mcp

  6. Test the MCP server locally:

    uv run python test_mcp.py

  7. Start or deploy the MCP server via the Claude Desktop configuration example provided in the repo:

    uv run python mcp_server.py

Note: Replace /path/to/your/project with the actual path to your project when configuring the MCP server in Claude Desktop or other MCP clients.

Additional notes

Tips and common issues:

  • Ensure Python 3.10+ is the active interpreter in your environment when running the MCP server.
  • If the dynamic growth-rate or enhanced-DCF features fail, the system will fall back to traditional DCF automatically; verify configuration and data sources for WACC and growth inputs.
  • Keep WACC data up-to-date by periodically running the update commands (uv sync --group mcp) to refresh financial metrics.
  • When using reverse-DCF and Excel report generation, ensure the output paths have write permissions and sufficient disk space.
  • For Claude Desktop integration, confirm that the path to your project is accurate in the mcpServer configuration and that the Python entry point (mcp_server.py) exposes the necessary endpoints.
  • If you encounter data source issues, validate network access and API keys (where applicable) for historical financials and industry mappings.
  • The MCP server supports single-stock, multi-stock, and portfolio analyses; use the provided commands to switch between scenarios and outputs as needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers