Skip to main content
Glama
Twelve Data MCP Server

Twelve Data MCP Server

by sherajdev

Twelve Data MCP Server

An MCP (Model Context Protocol) server for fetching real-time and historical market data including forex, precious metals (XAUUSD, XAGUSD), cryptocurrencies, and stocks using the Twelve Data API.

Features

  • 📈 Real-time prices for forex, metals, crypto, and stocks

  • 📊 OHLC time series data with multiple intervals (1min to monthly)

  • 💱 Currency conversion between any supported pairs

  • 📉 Technical indicators (RSI, MACD, SMA, EMA, Bollinger Bands, etc.)

  • 🏆 Commodities listing (precious metals, energy, agricultural)

  • ⚡ Low latency (~170ms average)

  • 🆓 Free tier available (8 API credits/minute, 800/day)

Related MCP server: Stocks MCP Server

Supported Symbols

Precious Metals

  • XAU/USD - Gold Spot

  • XAG/USD - Silver Spot

  • XPT/USD - Platinum Spot

  • XPD/USD - Palladium Spot

Major Forex Pairs

  • EUR/USD, GBP/USD, USD/JPY, USD/CHF

  • AUD/USD, USD/CAD, NZD/USD

  • And 140+ more currency pairs

Cryptocurrencies

  • BTC/USD, ETH/USD, XRP/USD

  • And many more from 180+ exchanges

Stocks

  • All US exchanges (NASDAQ, NYSE)

  • 90+ international exchanges

Installation

cd twelvedata-mcp-server
npm install
npm run build

Configuration

Get Your API Key

  1. Sign up for free at https://twelvedata.com/

  2. Get your API key from the dashboard

  3. Set the environment variable:

export TWELVEDATA_API_KEY="your_api_key_here"

Claude Desktop Configuration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "twelvedata": {
      "command": "node",
      "args": ["/path/to/twelvedata-mcp-server/dist/index.js"],
      "env": {
        "TWELVEDATA_API_KEY": "your_api_key_here"
      }
    }
  }
}

Available Tools

twelvedata_get_price

Get real-time price for any symbol.

"Get the current gold price" → symbol: "XAU/USD"
"EURUSD price" → symbol: "EUR/USD"

twelvedata_get_quote

Get detailed quote with OHLC, change, volume.

"Full quote for silver" → symbol: "XAG/USD"

twelvedata_get_time_series

Get historical OHLC candlestick data.

"Get 1-hour gold candles" → symbol: "XAU/USD", interval: "1h"
"Daily EURUSD last 100 days" → symbol: "EUR/USD", interval: "1day", outputsize: 100

twelvedata_convert_currency

Convert amounts between currencies.

"Convert 1000 USD to EUR" → from: "USD", to: "EUR", amount: 1000
"1 oz gold in USD" → from: "XAU", to: "USD", amount: 1

twelvedata_get_exchange_rate

Get exchange rate for a currency pair.

"EUR/USD exchange rate" → symbol: "EUR/USD"

twelvedata_list_commodities

List all available commodities.

"What metals can I trade?"

twelvedata_technical_indicator

Calculate technical indicators.

"RSI for gold" → symbol: "XAU/USD", indicator: "rsi"
"MACD for EURUSD" → symbol: "EUR/USD", indicator: "macd"
"20-period SMA" → indicator: "sma", time_period: 20

Supported indicators: SMA, EMA, WMA, RSI, MACD, BBANDS, STOCH, ADX, ATR, CCI, OBV, MOM, ROC, WILLR

API Rate Limits

Plan

API Credits/min

Daily Limit

WebSocket

Free

8

800/day

Trial only

Grow

55-377

Unlimited

Trial only

Pro

610-1597

Unlimited

✅

Ultra

2584-10946

Unlimited

✅

Running the Server

Stdio Transport (default)

TWELVEDATA_API_KEY="your_key" npm start

HTTP Transport

TWELVEDATA_API_KEY="your_key" TRANSPORT=http PORT=3000 npm start

Development

# Build
npm run build

# Watch mode (rebuild on changes)
npm run dev

Example Usage

Once configured with Claude Desktop:

"What's the current gold price?"

"Show me the last 50 1-hour candles for XAUUSD"

"Calculate RSI for EUR/USD on the daily timeframe"

"Convert 5000 USD to EUR"

"Get a detailed quote for silver"

License

MIT

Credits

Data provided by Twelve Data

Available Tools

5 tools
twelvedata_convert_currencyConvert CurrencyA
Read-onlyIdempotent

Convert an amount from one currency to another using real-time rates.

Supports fiat currencies, precious metals (XAU, XAG), and cryptocurrencies.

Args:

  • from (string): Source currency code (e.g., "USD", "EUR", "XAU", "BTC")

  • to (string): Target currency code

  • amount (number): Amount to convert

  • response_format ('markdown' | 'json'): Output format

Returns: Converted amount with exchange rate.

Examples:

  • "Convert 1000 USD to EUR" -> from: "USD", to: "EUR", amount: 1000

  • "How much is 1 oz gold in USD?" -> from: "XAU", to: "USD", amount: 1

  • "Convert 0.5 BTC to USD" -> from: "BTC", to: "USD", amount: 0.5

Inputs: to (required), from (required), amount (required), response_format.

twelvedata_get_exchange_rateGet Exchange RateA
Read-onlyIdempotent

Get the current exchange rate for a currency pair.

Args:

  • symbol (string): Currency pair (e.g., "EUR/USD", "XAU/USD")

  • response_format ('markdown' | 'json'): Output format

Returns: Current exchange rate with timestamp.

Examples:

  • "EUR/USD exchange rate" -> symbol: "EUR/USD"

  • "Gold rate" -> symbol: "XAU/USD"

Inputs: symbol (required), response_format.

twelvedata_get_priceGet Real-Time PriceA
Read-onlyIdempotent

Get the current real-time price for any trading symbol.

Supports forex pairs, precious metals, crypto, and stocks. This is the fastest endpoint for getting current prices.

Symbols examples:

  • Metals: XAU/USD (gold), XAG/USD (silver), XPT/USD (platinum)

  • Forex: EUR/USD, GBP/USD, USD/JPY

  • Crypto: BTC/USD, ETH/USD

  • Stocks: AAPL, MSFT, GOOGL

Args:

  • symbol (string): Trading symbol (e.g., "XAU/USD", "EUR/USD", "BTC/USD")

  • response_format ('markdown' | 'json'): Output format

Returns: Current price of the symbol.

Examples:

  • "What's the current gold price?" -> symbol: "XAU/USD"

  • "Get EURUSD price" -> symbol: "EUR/USD"

  • "Bitcoin price now" -> symbol: "BTC/USD"

Inputs: symbol (required), response_format.

twelvedata_get_quoteGet Detailed QuoteA
Read-onlyIdempotent

Get comprehensive quote data including OHLC, change, volume, and 52-week range.

More detailed than get_price - includes open, high, low, close, previous close, change percentage, and market status.

Args:

  • symbol (string): Trading symbol (e.g., "XAU/USD", "EUR/USD")

  • response_format ('markdown' | 'json'): Output format

Returns: Detailed quote with:

  • Current price (close)

  • Open, High, Low

  • Previous close

  • Change and percent change

  • Volume (if available)

  • 52-week range (if available)

  • Market open/closed status

Examples:

  • "Get full gold quote" -> symbol: "XAU/USD"

  • "EURUSD detailed info" -> symbol: "EUR/USD"

Inputs: symbol (required), response_format.

twelvedata_get_time_seriesGet OHLC Time SeriesA
Read-onlyIdempotent

Get historical OHLC (Open, High, Low, Close) candlestick data.

Perfect for chart analysis, backtesting, and historical price research. Supports multiple timeframes from 1-minute to monthly data.

Args:

  • symbol (string): Trading symbol

  • interval (string): Candle interval - "1min", "5min", "15min", "30min", "1h", "4h", "1day", "1week", "1month"

  • outputsize (number): Number of candles to return (1-5000, default: 30)

  • start_date (string, optional): Start date YYYY-MM-DD

  • end_date (string, optional): End date YYYY-MM-DD

  • response_format ('markdown' | 'json'): Output format

Returns: Array of OHLC candles with datetime, open, high, low, close, and volume (where applicable).

Examples:

  • "Get 1-hour gold candles" -> symbol: "XAU/USD", interval: "1h"

  • "Daily EURUSD last 100 days" -> symbol: "EUR/USD", interval: "1day", outputsize: 100

  • "5-minute BTC data" -> symbol: "BTC/USD", interval: "5min"

Inputs: symbol (required), end_date, interval, outputsize, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 5 tools

    Disambiguation2/5

    Tools get_price and get_exchange_rate have overlapping functionality for currency pairs, and get_quote also provides current price. This creates ambiguity about which tool to use for simple price queries.

    Naming Consistency5/5

    All tools use a consistent 'verb_noun' pattern with snake_case (get_price, get_quote, get_time_series, convert_currency, get_exchange_rate), making it easy to predict functionality.

    Tool Count5/5

    With 5 tools, the server covers essential financial data operations without being overly cluttered. The count is well-scoped for the domain.

    Completeness4/5

    Covers major needs: real-time price, detailed quote, historical data, currency conversion. Missing advanced features like symbol search or indicators, but core workflows are supported.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      C
      quality
      B
      maintenance
      Provides integration with Twelve Data API to access financial market data including historical time series, real-time quotes, and instrument metadata for stocks, forex pairs, and cryptocurrencies.
      35
      86
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time access to financial market data including stock quotes, company information, cryptocurrency exchange rates, historical options chains, and time series data through the Alpha Vantage API.
      -
    • A
      license
      C
      quality
      D
      maintenance
      Provides access to real-time and historical stock market data through the Alpha Vantage API, enabling financial analysis and market data queries through natural language.
      100
      118 PyPI
      74
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables access to real-time and historical market data including stocks, ETFs, forex, and cryptocurrencies, with support for time series, quotes, dividends, splits, and earnings.
      325 npm
      MIT