home / mcp / stock indicators mcp server

Stock Indicators MCP Server

Provides stock market data and technical indicators with MCP integration for multi-timeframe analysis.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "accelizero-stock_mcp": {
      "command": "python",
      "args": [
        "stock_indicators_mcp.py"
      ],
      "env": {
        "LONGPORT_APP_KEY": "YOUR_APP_KEY",
        "LONGPORT_APP_SECRET": "YOUR_APP_SECRET",
        "LONGPORT_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN"
      }
    }
  }
}

You can run a dedicated MCP server that computes stock market indicators across multiple timeframes using Python, exposing a standard MCP interface you can call from any MCP client. It combines real data access, fast incremental indicator calculations, and convenient multi-timeframe analysis for practical trading insights.

How to use

To get started, run the MCP server locally and connect to it from your MCP client. The server exposes indicators for stock symbols such as AAPL.US, NVDA.US, and TSLA.US, with support for multiple timeframes (from minutes to years) and standard indicators like EMA, MACD, RSI, ATR, and Bolling bands.

Start the MCP service from the command line and then query it using your MCP client to request data for a specific symbol and timeframe. You can request current values, percentage changes, and intraday series for downstream visualization or strategy backtesting.

How to install

Prerequisites: you need Python installed on your system. You also need access credentials for the data provider used by the MCP server when fetching real stock prices.

Install Python dependencies used by the server and MCP tooling.

pip install pandas numpy talib longport python-dotenv

Install the MCP runtime libraries if you plan to work with MCP tooling and clients.

pip install mcp

Configuration and running the MCP server

Prepare the environment variables for authenticating with the real stock data provider.

LONGPORT_APP_KEY=your_app_key
LONGPORT_APP_SECRET=your_app_secret
LONGPORT_ACCESS_TOKEN=your_access_token

Run the MCP server using Python with the provided entry script.

python stock_indicators_mcp.py

Configuration for clients and examples

You can connect your MCP client to the local server via the standard MCP endpoint. Use a client configuration that points to the local host or the URL where you expose the MCP API.

Example MCP client configuration (local stdio setup) shows how to run the server and pass environment values.

{
  "mcpServers": {
    "stock_indicators": {
      "command": "python",
      "args": ["stock_indicators_mcp.py"],
      "env": {
        "LONGPORT_APP_KEY": "your_app_key",
        "LONGPORT_APP_SECRET": "your_app_secret",
        "LONGPORT_ACCESS_TOKEN": "your_access_token"
      }
    }
  }
}

Additional notes

Multi-timeframe analysis is supported across ranges from 1 minute to 1 year (1m/5m/15m/30m/1h/4h/1d/1w/1M/1Q/1Y). The service uses incremental calculations to maintain performance as data grows.

The server provides a structured data model including current price, percentage changes, EMA, MACD, RSI, ATR, Bollinger bands, and intraday series for visualization and strategy evaluation.

Examples of common tasks

Query the server for the 1-hour indicators of AAPL.US and read current RSI7 and EMA20 values.

Run multi-timeframe analyses to compare monthly and weekly trends alongside daily and hourly signals.

Available tools

get_stock_indicators

Fetches technical indicators for a specified stock symbol and timeframe, returning current and intraday indicators such as EMA, MACD, RSI, ATR, and Bollinger bands.

get_multi_timeframe_analysis

Aggregates indicators across multiple timeframes for a given stock symbol, enabling comparative analysis across periods (e.g., 1M, 1W, 1D, 4H).