Evid Invest
← Back to Blog

How to Build a Stock Valuation Agent in 10 Minutes Using EvidInvest MCP

·EvidInvest Team
MCPClaudeAItutorialvaluationinvesting

What if you could ask an AI to value any stock — instantly — and get back a DCF-derived fair value, a margin of safety estimate, and a risk breakdown? Not a chatbot hallucination. Real numbers from a real valuation engine.

That's exactly what EvidInvest MCP lets you do. In this tutorial, you'll connect EvidInvest's full valuation toolkit to Claude Desktop and start running stock analysis in natural language. No coding. No spreadsheets. No Bloomberg terminal.

Total setup time: about 10 minutes.


What is EvidInvest MCP?

MCP stands for Model Context Protocol. It's an open standard that lets AI assistants like Claude connect to external data sources and tools — not just text on the internet, but live APIs with real computation behind them.

EvidInvest MCP exposes 26 tools that give Claude direct access to our valuation engine. That includes:

  • DCF valuation for any publicly traded US stock
  • Modern Portfolio Theory optimization across custom stock baskets
  • Price history with rolling volatility for any ticker and date range
  • Sector analysis and peer comparisons
  • Financial statement data (income, balance sheet, cash flow)
  • Intrinsic value scoring with multi-factor breakdowns

When you connect EvidInvest MCP to Claude, you're not asking Claude to guess at valuations. You're giving it a calculator that runs the same models institutional analysts use — and letting it interpret the results for you in plain English.


Step 1: Install Claude Desktop

If you don't already have Claude Desktop, download it from claude.ai/download. It's available for Mac and Windows.

Once installed, open it and sign in with your Anthropic account.


Step 2: Connect EvidInvest MCP

Open Claude Desktop's settings and navigate to the MCP Servers section. Click Add Server and enter the following configuration:

{
  "mcpServers": {
    "evidinvest": {
      "command": "npx",
      "args": ["-y", "@evidinvest/mcp-server"],
      "env": {
        "EVIDINVEST_API_KEY": "your-api-key-here"
      }
    }
  }
}

Replace your-api-key-here with your EvidInvest API key. Don't have one? Sign up at evidinvest.com/developers — the free tier includes 100 API calls per day.

Save the configuration and restart Claude Desktop. You should see the EvidInvest tools appear in Claude's tool list.


Step 3: Run Your First Valuation

Now the fun part. Open a new conversation in Claude Desktop and try this:

"What's the intrinsic value of Apple stock right now?"

Claude will call get_dcf_valuation with the ticker AAPL and return something like this:

AAPL — Apple Inc.
Current Price: $198.50
DCF Fair Value: $215.30
Margin of Safety: 7.8% (undervalued)

Key Assumptions:
- Revenue Growth Rate: 8.2% (5-year CAGR)
- Terminal Growth Rate: 3.0%
- Discount Rate (WACC): 9.4%
- Free Cash Flow Margin: 26.1%

Verdict: Apple trades at a modest discount to intrinsic value.
The margin of safety is thin but positive — this is not a screaming
buy, but the valuation is reasonable for a long-term holder.

That's a real DCF model running behind the scenes — not Claude making up numbers. The fair value comes from projected free cash flows, discounted at Apple's weighted average cost of capital, with a terminal value based on long-run growth assumptions.


Demo 2: Optimize a Portfolio

Try asking Claude to optimize a basket of stocks:

"Optimize a portfolio of AAPL, MSFT, NVDA, and GOOGL using the last year of data."

Claude calls get_mpt_optimization with those four tickers and a 252-day lookback window:

Optimal Portfolio (Maximum Sharpe Ratio)
----------------------------------------
AAPL:  28.4%
MSFT:  31.2%
NVDA:  18.7%
GOOGL: 21.7%

Expected Annual Return: 34.2%
Portfolio Volatility:   19.8%
Sharpe Ratio:           1.52

Note: NVDA has the highest individual return but also the highest
volatility. The optimizer underweights it to reduce portfolio risk.
MSFT gets the largest allocation due to its strong risk-adjusted
return profile.

This is Modern Portfolio Theory in action. The optimizer doesn't just pick the highest-returning stock — it finds the combination that maximizes return per unit of risk. That's why NVDA, despite being the strongest performer, gets a smaller allocation than MSFT.


Demo 3: Analyze Price History and Volatility

Want to understand how a stock has behaved over time? Try this:

"Show me Tesla's price history and volatility from 2023 to today."

Claude calls get_price_history_with_volatility for TSLA:

TSLA — Tesla Inc.
Period: Jan 2023 – Apr 2026

Price Range: $101.81 (low) – $488.54 (high)
Current Price: $342.15
Total Return: +127.4%

30-Day Rolling Volatility:
- Current: 42.1% (annualized)
- Average over period: 51.3%
- Peak: 78.2% (Oct 2023)

Tesla remains one of the most volatile mega-caps. The current
volatility of 42% is actually below its 3-year average, suggesting
the stock is in a relatively calm period compared to its history.

Rolling volatility is one of the most underused metrics in retail investing. It tells you not just how much a stock moves, but whether the current movement is normal or unusual for that stock. A 3% daily move in Tesla is Tuesday. A 3% daily move in Johnson & Johnson is a five-alarm fire.


What You Can Build From Here

Once you have EvidInvest MCP connected, the possibilities expand quickly. Here are some things our users are building:

  • Portfolio optimizer agent — paste your holdings, get MPT-optimized weights and rebalancing suggestions
  • Earnings tracker — ask Claude to value a stock before and after earnings, flag any changes in fair value
  • Sector screener — "Find the 3 most undervalued stocks in healthcare" → Claude screens the sector using DCF
  • Watchlist monitor — set up a list of tickers and ask Claude to flag any that cross below fair value
  • Risk dashboard — get a volatility and correlation breakdown of your entire portfolio in one conversation

The key insight is that MCP turns Claude from a text generator into a tool user. It's not guessing at valuations — it's running the math and then explaining the results. That's a fundamentally different kind of AI assistant.


Get Started

EvidInvest MCP is available now. The free tier gives you 100 API calls per day — enough to value dozens of stocks, run portfolio optimizations, and build custom analysis workflows.

  1. Sign up at evidinvest.com/developers
  2. Get your API key
  3. Connect to Claude Desktop using the config above
  4. Start asking questions

The best investment analysis tool is the one you'll actually use. And there's nothing easier than asking a question in plain English and getting a real answer backed by real math.


EvidInvest provides data and analysis tools for educational and informational purposes. This is not financial advice. Always do your own research before making investment decisions.

Get the next deep dive

Subscribe to EvidInvest updates and get future valuation breakdowns and portfolio research delivered to your inbox.