Stock Analyzer (Tingo) MCP server

Integrates with Tiingo API to perform technical analysis on stocks, providing key indicators for trading decisions.
Back to servers
Setup instructions
Provider
Seth Hobson
Release date
Jan 10, 2025
Language
Python
Stats
209 stars

The MCP Trader Server is a specialized server implementing the Model Context Protocol (MCP) for stock and cryptocurrency analysis. It provides technical analysis tools and market data access with minimal configuration requirements.

Installation

Prerequisites

Environment Setup

Create a .env file in your project root:

# Tiingo API Key (free tier works great)
TIINGO_API_KEY=your_tiingo_api_key_here

# Optional: For higher rate limits
BINANCE_API_KEY=your_binance_api_key_here
BINANCE_API_SECRET=your_binance_api_secret_here

Installation Steps

# Clone the repository
git clone https://github.com/wshobson/mcp-trader.git
cd mcp-trader

# Create virtual environment and install dependencies
uv venv --python 3.11
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv sync

# Copy the example environment file
cp .env.example .env
# Edit .env and add your Tiingo API key

Configuration

Claude Desktop App Configuration

The configuration file location varies by platform:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Standard MCP Configuration

{
  "mcpServers": {
    "stock-analyzer": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/mcp-trader",
        "run",
        "mcp-trader"
      ],
      "env": {
        "TIINGO_API_KEY": "your_api_key_here"
      }
    }
  }
}

FastMCP Configuration

To enable FastMCP resources alongside the standard tools:

{
  "mcpServers": {
    "stock-analyzer": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/mcp-trader",
        "run",
        "python",
        "-m",
        "mcp_trader.fastmcp_server"
      ],
      "env": {
        "TIINGO_API_KEY": "your_api_key_here"
      }
    }
  }
}

Running the Server

Standard Mode

uv run mcp-trader

Development Mode

# Run with Python directly
uv run python -m mcp_trader.server

# Run with MCP Inspector for debugging
npx @modelcontextprotocol/inspector uv --directory . run mcp-trader

Docker Deployment

# Build the Docker image
docker build -t mcp-trader .

# Run the container
docker run -e TIINGO_API_KEY=your_api_key_here -p 8000:8000 mcp-trader

# Run in HTTP server mode
docker run -e TIINGO_API_KEY=your_api_key_here -p 8000:8000 mcp-trader uv run mcp-trader --http

Available Tools

Technical Analysis Tools

  • analyze-stock: Performs technical analysis on a stock symbol

    Required argument: symbol (string, e.g. "NVDA")
    
  • analyze-crypto: Analyzes cryptocurrency assets

    Required argument: symbol (string, e.g. "BTC", "ETH", "BTCUSDT")
    Optional arguments:
      - provider (string, default: "tiingo", options: "tiingo", "binance")
      - lookback_days (integer, default: 365)
      - quote_currency (string, default: "usd" for Tiingo, "USDT" for Binance)
    
  • relative-strength: Calculates a stock's relative strength compared to a benchmark

    Required argument: symbol (string, e.g. "AAPL")
    Optional argument: benchmark (string, default: "SPY")
    
  • volume-profile: Analyzes volume distribution by price

    Required argument: symbol (string, e.g. "MSFT")
    Optional argument: lookback_days (integer, default: 60)
    
  • detect-patterns: Identifies chart patterns in price data

    Required argument: symbol (string, e.g. "AMZN")
    
  • position-size: Calculates optimal position size based on risk parameters

    Required arguments:
      - symbol (string, e.g. "TSLA")
      - stop_price (number)
      - risk_amount (number)
      - account_size (number)
    Optional argument: price (number, default: current price)
    
  • suggest-stops: Suggests stop loss levels based on technical analysis

    Required argument: symbol (string, e.g. "META")
    

FastMCP Resources

Stock Resources

  • stock://{symbol} - Get current stock price and statistics
  • stock://{symbol}/history - Get historical price data

Crypto Resources

  • crypto://{symbol} - Get current crypto price (supports Tiingo & Binance)
  • crypto://{symbol}/history - Get historical crypto data

Cache Resources

  • market://cache/clear - Clear the data cache
  • market://cache/status - View cache statistics

Example Usage

In Claude Desktop, simply ask:

Analyze the technical setup for NVDA

For crypto analysis:

Analyze BTC using Binance data

Troubleshooting

Common Issues

  1. "TIINGO_API_KEY not set" error

    • Copy .env.example to .env
    • Add your Tiingo API key to the .env file
  2. Import errors

    • Make sure you're in the virtual environment: source .venv/bin/activate
    • Reinstall dependencies: uv sync --force-reinstall

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "stock-analyzer" '{"command":"uv","args":["--directory","/absolute/path/to/mcp-trader","run","mcp-trader"],"env":{"TIINGO_API_KEY":"your_api_key_here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "stock-analyzer": {
            "command": "uv",
            "args": [
                "--directory",
                "/absolute/path/to/mcp-trader",
                "run",
                "mcp-trader"
            ],
            "env": {
                "TIINGO_API_KEY": "your_api_key_here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "stock-analyzer": {
            "command": "uv",
            "args": [
                "--directory",
                "/absolute/path/to/mcp-trader",
                "run",
                "mcp-trader"
            ],
            "env": {
                "TIINGO_API_KEY": "your_api_key_here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later