> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vectrade.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP (AI IDEs)

> Use VecTrade financial tools in Claude Desktop, Cursor, VS Code, and other MCP-compatible clients

## Overview

The VecTrade MCP server provides **22 financial & trading tools** to any AI IDE that supports the [Model Context Protocol](https://modelcontextprotocol.io/).

Supported clients: Claude Desktop, Cursor, VS Code Copilot, Windsurf, Cline, Continue.dev.

## Quick Setup

### Option 1: Hosted (recommended — zero install)

Add this to your IDE's MCP configuration:

<CodeGroup>
  ```json Claude Desktop (~/.config/claude/claude_desktop_config.json) theme={null}
  {
    "mcpServers": {
      "vectrade": {
        "url": "https://mcp.vectrade.io/sse",
        "headers": {
          "X-API-Key": "vq_your_key_here"
        }
      }
    }
  }
  ```

  ```json Cursor (.cursor/mcp.json) theme={null}
  {
    "mcpServers": {
      "vectrade": {
        "url": "https://mcp.vectrade.io/sse",
        "headers": {
          "X-API-Key": "vq_your_key_here"
        }
      }
    }
  }
  ```

  ```json VS Code (.vscode/mcp.json) theme={null}
  {
    "servers": {
      "vectrade": {
        "url": "https://mcp.vectrade.io/sse",
        "headers": {
          "X-API-Key": "vq_your_key_here"
        }
      }
    }
  }
  ```
</CodeGroup>

### Option 2: Local (stdio via npx)

```json theme={null}
{
  "mcpServers": {
    "vectrade": {
      "command": "npx",
      "args": ["-y", "@vectrade/mcp-server"],
      "env": {
        "VECTRADE_API_KEY": "vq_your_key_here"
      }
    }
  }
}
```

### CLI Auto-Setup

If you have the [VecTrade CLI](/sdks/cli):

```bash theme={null}
vectrade mcp setup cursor
vectrade mcp setup claude
vectrade mcp setup vscode
```

## Available Tools (22)

### Quotes & Market Data

| Tool                    | Description                                       |
| ----------------------- | ------------------------------------------------- |
| `get_quote`             | Real-time stock quote (price, change, volume)     |
| `get_batch_quotes`      | Multiple quotes in one call (up to 50)            |
| `get_historical_prices` | Historical OHLCV data (5d, 1mo, 3mo, 6mo, 1y, 5y) |

### Fundamentals

| Tool                       | Description                                 |
| -------------------------- | ------------------------------------------- |
| `get_fundamentals`         | Key financial metrics (market cap, SMAs)    |
| `get_financial_statements` | Income statement, balance sheet, cash flow  |
| `get_company_profile`      | Company info, sector, industry, description |

### Technical Analysis

| Tool             | Description                                               |
| ---------------- | --------------------------------------------------------- |
| `get_technicals` | Technical score, RSI, MACD, Bollinger, support/resistance |

### News & Sentiment

| Tool            | Description                                        |
| --------------- | -------------------------------------------------- |
| `get_news`      | Latest financial news for a symbol                 |
| `get_sentiment` | Sentiment score, social mentions (Twitter, Reddit) |

### Analyst

| Tool                      | Description                                      |
| ------------------------- | ------------------------------------------------ |
| `get_analyst_ratings`     | Analyst consensus rating (Buy/Hold/Sell)         |
| `get_analyst_targets`     | Price target estimates (high, low, mean, median) |
| `get_upgrades_downgrades` | Recent analyst rating changes                    |

### Earnings & Insider

| Tool                       | Description                                  |
| -------------------------- | -------------------------------------------- |
| `get_earnings`             | Earnings history with EPS actual vs estimate |
| `get_insider_transactions` | Insider buy/sell transactions                |

### Options & ETF

| Tool                | Description                                     |
| ------------------- | ----------------------------------------------- |
| `get_options_chain` | Full options chain (calls & puts)               |
| `get_etf`           | ETF info, holdings, sector weights, performance |

### Trading (Bot API)

<Note>Trading tools require a Bot API key (`tvt_...`) set in `VECTRADE_BOT_KEY`. See the [Bot Trading guide](/guides/bot-trading) for setup.</Note>

| Tool              | Description                                   |
| ----------------- | --------------------------------------------- |
| `place_order`     | Buy/sell stocks, crypto, forex, ETFs, options |
| `cancel_order`    | Cancel an open order                          |
| `get_orders`      | List recent orders (filter by status)         |
| `get_portfolio`   | Cash balance + all positions with P\&L        |
| `get_trading_kpi` | Performance metrics & leaderboard rank        |
| `get_bot_account` | Account info, status & API quota              |

## Trading Setup

To enable AI agent trading, add your Bot API key:

```json theme={null}
{
  "mcpServers": {
    "vectrade": {
      "command": "npx",
      "args": ["-y", "@vectrade/mcp-server"],
      "env": {
        "VECTRADE_API_KEY": "vq_your_key_here",
        "VECTRADE_BOT_KEY": "tvt_your_bot_key"
      }
    }
  }
}
```

Create a Bot API key at [vectrade.io/vtrade/developer](https://vectrade.io/vtrade/developer) → Bot API Keys section.

## Example Usage

Once configured, ask your AI assistant:

* "What's Apple's current stock price?"
* "Show me the technical analysis for TSLA"
* "What are analysts saying about NVDA?"
* "Compare insider trading activity for MSFT and GOOG"
* "Get the options chain for SPY"
* "What ETFs track the S\&P 500?"
* "Show me AAPL's historical prices for the past month"
* "Buy 10 shares of AAPL" (requires Bot API key)
* "How's my portfolio doing?" (requires Bot API key)
* "Set a stop-loss on TSLA at \$250" (requires Bot API key)

## Verification

Test the connection by asking your AI assistant to call any tool:

> "Use the get\_quote tool to get the price of AAPL"

If authentication fails, verify your API key is correct and active at [vectrade.io/vtrade/developer](https://vectrade.io/vtrade/developer).

## Links

* [GitHub Repository](https://github.com/VecTrade-io/vectrade-mcp)
* [Examples](https://github.com/VecTrade-io/vectrade-examples)
* [Custom AI Agent Examples](https://github.com/VecTrade-io/vectrade-examples/tree/main/use-cases/ai-agent-trading) — Build your own trading agent (OpenAI, Claude, cron)
* [Get API Key](https://vectrade.io/vtrade/developer)
