home / mcp / stock valuation mcp server

Stock Valuation MCP Server

Provides professional stock valuation tools, real-time SET Watch data, and investment recommendations.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "b9b4ymin-mymcpserver": {
      "command": "node",
      "args": [
        "C:/Programing/ByAI/myMCPserver/dist/index.js"
      ],
      "env": {
        "NODE_ENV": "production",
        "LOG_LEVEL": "info",
        "API_AUTH_VALUE": "your-api-key",
        "API_AUTH_HEADER": "X-API-Key",
        "SET_WATCH_API_HOST": "https://xxxx-api.vercel.app",
        "SET_WATCH_API_TIMEOUT": "30000"
      }
    }
  }
}

The Stock Valuation MCP Server is a TypeScript-powered MCP server that provides professional stock valuation and financial analysis tools, integrating real-time data and multiple valuation models to help you make informed investment decisions.

How to use

You use this MCP server by running it locally or in the cloud and connecting your MCP client or Claude Desktop to access valuation tools. The server exposes a suite of models and data fetchers that you can invoke to compute intrinsic value, analyze historical trends, and generate investment recommendations. Start by ensuring the server is running in your environment, then request tasks such as valuation analyses, data retrieval, or historical ratio exploration. You can combine valuation models with live data from SET Watch to derive actionable insights and generate buy/sell/hold suggestions.

How to install

Prerequisites you need before installation include Node.js 18+ and Docker if you plan containerized deployment. You may also use Claude Desktop for MCP integration.

# Clone the project
git clone <repository-url>
cd myMCPserver

# Install dependencies
npm install

# Copy environment configuration
cp .env.example .env

# Build the project
npm run build

Additional sections

Configuration and security are centered around environment-based settings. Provide API keys and secrets via environment variables, and configure API endpoints for the SET Watch data source. The server is prepared for Oracle Cloud Free Tier deployment and supports Docker-based containerization.

For integration with Claude Desktop, you typically add the MCP server to your Claude Desktop configuration so that the tools are available directly from the MCP protocol. Restart Claude Desktop after making changes to ensure the tools are registered.

Configuration and environment

Configure environment variables in a .env file based on the provided template. Typical variables include the SET Watch API host and timeout, server mode, and optional custom authentication headers.

# API Configuration
SET_WATCH_API_HOST=https://xxxxxxxxxxxx.app  # Your API host
SET_WATCH_API_TIMEOUT=30000

# Server Configuration
NODE_ENV=production
LOG_LEVEL=info

# Optional: Custom API Authentication
# API_AUTH_HEADER=X-API-Key
# API_AUTH_VALUE=your-api-key

Examples and testing

Use the MCP Inspector or client tools to test the server locally. You can perform a full valuation in a single flow by invoking the complete valuation tool after the server is running and the client is connected.

An example workflow might start with fetching stock data, then running valuation models like PE Band, DDM, and DCF, followed by generating an overall investment recommendation.

Deployment notes

For containerized deployment, you can build a Docker image and run it on any environment that supports Docker. You expose port 2901 to access MCP services and pass environment variables to configure the data source and runtime.

If you deploy to Oracle Cloud, you can use the provided deployment script or a manual deployment process to launch an instance, install Docker, and run the MCP server image with the appropriate environment settings.

n8n integration and automation

You can integrate with n8n to automate workflows that trigger stock valuation analyses. Use HTTP requests to the MCP server to call specific tools like fetch_stock_data and complete_valuation, and to retrieve results for reporting or alerts.

Available tools

calculate_pe_band

Calculate PE band valuation with historical data, producing fair value ranges and recommendations.

calculate_ddm

Dividend Discount Model analysis for dividend-paying stocks.

calculate_dcf

Discounted Cash Flow valuation using free cash flow projections.

fetch_stock_data

Fetch real-time stock data from SET Watch.

complete_valuation

Run all valuation models with fetched data.

fetch_income_statement

Fetch income statement data for analysis.

fetch_balance_sheet

Fetch balance sheet data for analysis.

fetch_cash_flow_statement

Fetch cash flow statement data.

fetch_all_financial_statements

Fetch all statements with ratio analysis.

fetch_historical_ratios

Fetch historical PE, PBV, ROE, ROA, ROIC data.

analyze_historical_ratios

Analyze trends in historical ratios and generate investment recommendations.