Skip to main content
Glama
sherajdev

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

ParametersJSON Schema
NameRequiredDescriptionDefault
toYesTarget currency code (e.g., EUR, JPY, USD)
fromYesSource currency code (e.g., USD, EUR, XAU)
amountYesAmount to convert
response_formatNoOutput format: 'markdown' for human-readable or 'json' for structured datamarkdown

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only, idempotent behavior. The description adds context about real-time rates and supported asset types (fiat, metals, crypto), which is useful beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, well-structured with sections, and includes examples that are immediately helpful. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description explains the return (converted amount with exchange rate) and provides examples, but lacks explicit structure of the output. Still sufficient for the tool's purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds examples and clarifies valid inputs (e.g., XAU, BTC), enhancing understanding beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool converts an amount between currencies using real-time rates, and it distinguishes itself from siblings like get_exchange_rate by including an amount parameter.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for currency conversion but does not explicitly mention when to use it versus alternatives like get_exchange_rate, or any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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"

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesCurrency pair for exchange rate (e.g., EUR/USD, XAU/USD)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for structured datamarkdown

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, establishing safety. The description adds that the tool returns a 'Current exchange rate with timestamp,' which is useful behavioral context beyond the schema. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, structured with Args, Returns, and Examples sections. Every sentence adds value with no redundancy. The main purpose is front-loaded in the first line.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 2-parameter tool with rich annotations and 100% schema coverage, the description is complete. It covers purpose, parameters, return format, and examples. There is no output schema, but the description explains the return value adequately. Slight deduction for lacking error handling or edge cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with good descriptions for both parameters. The description adds a returns section and concrete examples (e.g., 'XAU/USD' for gold), which adds value beyond the schema by clarifying usage patterns. This justifies above baseline (3).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get the current exchange rate for a currency pair' with a specific verb and resource. It uses examples like 'EUR/USD' and 'XAU/USD' to clarify the resource scope, effectively distinguishing from sibling tools like twelvedata_get_price which likely fetches stock prices.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides examples and expected input formats, giving clear context for when to use the tool. However, it does not explicitly state when not to use it or mention alternatives like twelvedata_convert_currency for conversion with amounts, so it narrowly misses a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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"

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesSymbol to get price for (e.g., XAU/USD for gold, EUR/USD for forex)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for structured datamarkdown

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover readOnlyHint, idempotentHint, and destructiveHint. The description adds that it is the fastest endpoint and supports multiple asset types, which provides valuable behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections and bullet lists. Each sentence adds value, though the examples section could be slightly more compact. Overall no wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool simplicity and rich annotations, the description adequately covers purpose, parameters, usage examples, and return value. Could mention potential errors or rate limits, but not critical for a read-only, idempotent tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (baseline 3), but the description adds numerous real-world examples of symbol formats and usage patterns, which meaningfully guides parameter usage beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it gets the current real-time price for any trading symbol, and distinguishes itself by claiming to be the fastest endpoint for current prices. Examples of supported asset types reinforce the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly describes when to use it (fastest endpoint for current prices) and provides many example symbols. However, it does not explicitly mention when to consider sibling tools like get_quote or get_time_series.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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"

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesSymbol to get detailed quote for (includes OHLC, change, volume)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for structured datamarkdown

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, so the description doesn't need to reiterate safety. It adds value by detailing the return fields (OHLC, change, volume, 52-week range, market status) and notes the tool is more detailed than get_price. No contradictions or additional behavioral issues mentioned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise yet comprehensive: a brief summary, bullet points for args and returns, and two examples. Information is front-loaded and every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given only 2 parameters, no output schema, and strong annotations, the description fully covers tool behavior, usage, and output. It explains when to use, what parameters are, and what the return data contains, making it easy for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds concrete examples for symbol (e.g., 'XAU/USD') and clarifies the meaning of response_format options ('markdown' for human-readable). This extra context merits a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Get comprehensive quote data including OHLC, change, volume, and 52-week range.' It uses a specific verb and resource, and immediately distinguishes from sibling 'get_price' by noting it is more detailed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool versus alternatives by saying 'More detailed than get_price' and includes example queries that demonstrate proper symbol formatting. It lacks explicit when-not-to-use guidance, but the differentiation is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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"

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYesSymbol for time series data
end_dateNoEnd date for historical data (YYYY-MM-DD)
intervalNoCandle interval (1min, 5min, 15min, 30min, 1h, 4h, 1day, 1week)1day
outputsizeNoNumber of data points to return (1-5000, default: 30)
start_dateNoStart date for historical data (YYYY-MM-DD)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for structured datamarkdown

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, openWorldHint. Description adds return structure (OHLC candles with volume) and constraints (outputsize 1-5000). No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections for Args, Returns, and Examples. Front-loaded with purpose. Every sentence adds value, though Args section slightly redundant with schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers all 6 parameters, output format, and use cases. Given no output schema, the description adequately explains return data. No missing critical information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% of parameters with descriptions. The description adds examples and context (e.g., 'Trading symbol', '1-hour gold candles') that enhance understanding beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Get historical OHLC candlestick data' with a specific verb and resource. It distinguishes from siblings like twelvedata_get_price by focusing on historical multi-timeframe data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly states use cases: 'chart analysis, backtesting, and historical price research.' Provides examples to guide selection, but does not explicitly state when to avoid or mention alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv1.0.0
    • First observedtwelvedata_convert_currency
    • First observedtwelvedata_get_exchange_rate
    • First observedtwelvedata_get_price
    • First observedtwelvedata_get_quote
    • First observedtwelvedata_get_time_series

TDQS

A4.2/5.0
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
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    C
    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
    76
    -
  • 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
    74
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    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.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sherajdev/twelvedata-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server