# mcp-trader

> MCP Server

The MCP Trader Server repository provides a Model Context Protocol server equipped with tools for stock analysis and trading, including technical analysis, relative strength calculations, and position sizing.

## Overview

- **Category:** Developer Tools
- **Language:** Python
- **Stars:** 273
- **Forks:** 7
- **Owner:** wshobson
- **GitHub:** https://github.com/wshobson/mcp-trader
- **Homepage:** https://sethhobson.com
- **Created:** 2025-01-09T19:29:25+00:00
- **Updated:** 2025-03-28T09:42:00+00:00
- **Source:** https://model-context-protocol.com/servers/stock-trading-model-context-protocol-server

## Setup

## Setup

### Prerequisites

- Python 3.11+
- [uv](https://github.com/astral-sh/uv)
- [ta-lib](https://ta-lib.org/install/)
- [Tiingo API Key](https://api.tiingo.com/)

### Environment Variables

Create a `.env` file:

```bash
TIINGO_API_KEY=your_api_key_here
```

### Installing via Smithery

To install Trader for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-trader):

```bash
npx -y @smithery/cli install mcp-trader --client claude
```

This will:

1. Install the MCP Trader server
2. Configure it with your Tiingo API key
3. Set up the Claude Desktop integration

#### Smithery Configuration

The server includes a `smithery.yaml` configuration file that defines:

- Required configuration parameters (Tiingo API key)
- Command function to start the MCP server
- Integration with Claude Desktop

You can customize the Smithery configuration by editing the `smithery.yaml` file.

### Installation

```bash
uv venv --python 3.11
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv sync
```

### Docker Deployment

The project includes a Dockerfile for containerized deployment:

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

# Run the container with your API key
docker run -e TIINGO_API_KEY=your_api_key_here -p 8000:8000 mcp-trader
```

To run the container in HTTP server mode:

```bash
docker run -e TIINGO_API_KEY=your_api_key_here -p 8000:8000 mcp-trader uv run mcp-trader --http
```

## Tools

## Available Tools

1.  analyze-stock (Performs technical analysis on a given stock symbol).
2.  relative-strength (Calculates a stock's relative strength compared to a benchmark).
3.  volume-profile (Analyzes volume distribution by price).
4.  detect-patterns (Identifies chart patterns in price data).
5.  position-size (Calculates optimal position size based on risk parameters).
6.  suggest-stops (Suggests stop loss levels based on technical analysis).
