stock_valuation_calculator
Stock valuation with improved DCF model
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:
-
Install uv if not already installed (Python-based runner for MCP):
Example (macOS/Linux)
curl -LsSf https://astral.sh/uv/install.sh | sh
-
Install Python dependencies and set up the project environment (if your project provides a pyproject/requirements.txt, install them accordingly):
uv sync
-
Ensure necessary directories exist for data and outputs (as examples in the project):
mkdir -p data output
-
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
-
Install MCP server components (in the project directory):
uv sync --group mcp
-
Test the MCP server locally:
uv run python test_mcp.py
-
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
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
RiMCP_hybrid
Rimworld Coding RAG MCP server
mcp-manager
CLI tool for managing Model Context Protocol (MCP) servers in one place & using them across them different clients
mcpscc
Security Command Center for Model Context Protocol (MCP) servers. Detect prompt injection, tool poisoning, secrets, and vulnerabilities. The Trivy of MCP security.
CasualMarket
功能完整的台灣股票交易 Model Context Protocol (MCP) Server,提供即時股價查詢、財務分析、市場資訊等多種功能
gobbler
The missing link between your content and AI. Convert YouTube, documents, web pages, and audio to structured markdown that LLMs can immediately reason about.