Data source: Alpha Vantage
Overview
Alpha Vantage (Finance) wraps Alpha Vantage, handling authentication, pagination, and rate limits for you. This tutorial covers all 5 tools with working code examples you can copy and run.
Prerequisites
- Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
- Choose your integration method: MCP protocol or REST API.
Connect via MCP
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"gnist-alpha-vantage": {
"url": "https://context.gnist.ai/mcp/alpha-vantage/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Tools (5)
get_price
Get the latest market quote for a stock or ETF. Uses Alpha Vantage (requires ALPHA_VANTAGE_API_KEY env var). Args: ticker: Stock ticker symbol (e.g. "AAPL", "TSLA", "SPY"). Returns: Latest price, open/high/low, volume, previous close, and change %.
| Parameter | Type | Required | Description |
|---|---|---|---|
ticker | string | required | Stock ticker symbol (e.g. "AAPL", "TSLA", "SPY"). |
curl -X POST "https://context.gnist.ai/mcp/alpha-vantage/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_price", "arguments": {"ticker": "AAPL"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/alpha-vantage/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'ticker': 'AAPL'}, 'name': 'get_price'}},
)
print(resp.json())
get_historical
Get historical OHLCV data for a stock or ETF. Args: ticker: Stock ticker symbol (e.g. "AAPL", "MSFT"). start: Start date in YYYY-MM-DD format (inclusive). end: End date in YYYY-MM-DD format (inclusive). interval: Data interval — "daily", "weekly", or "monthly" (default: "daily"). Returns: Symbol, interval, count, and list of OHLCV entries (open, high, low, close, volume).
| Parameter | Type | Required | Description |
|---|---|---|---|
ticker | string | required | Stock ticker symbol (e.g. "AAPL", "MSFT"). |
start | string | required | Start date in YYYY-MM-DD format (inclusive). |
end | string | required | End date in YYYY-MM-DD format (inclusive). |
interval | string | optional | Data interval — "daily", "weekly", or "monthly" (default: "daily"). (default: daily) |
curl -X POST "https://context.gnist.ai/mcp/alpha-vantage/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_historical", "arguments": {"ticker": "AAPL", "start": "example", "end": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/alpha-vantage/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'end': 'example',
'start': 'example',
'ticker': 'AAPL'},
'name': 'get_historical'}},
)
print(resp.json())
get_fx_rate
Get the daily exchange rate between two currencies. Uses ECB reference rates (updated daily ~16:00 CET on business days). Supports all major currencies. Cross-rates are derived from EUR-based data. Args: base: Base currency ISO 4217 code (e.g. "USD", "EUR", "GBP"). quote: Quote currency ISO 4217 code (e.g. "NOK", "JPY", "CHF"). Returns: Exchange rate (1 base = N quote), with the ECB reference date.
| Parameter | Type | Required | Description |
|---|---|---|---|
base | string | required | Base currency ISO 4217 code (e.g. "USD", "EUR", "GBP"). |
quote | string | required | Quote currency ISO 4217 code (e.g. "NOK", "JPY", "CHF"). |
curl -X POST "https://context.gnist.ai/mcp/alpha-vantage/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_fx_rate", "arguments": {"base": "USD", "quote": "NOK"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/alpha-vantage/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'base': 'USD', 'quote': 'NOK'},
'name': 'get_fx_rate'}},
)
print(resp.json())
get_crypto_price
Get the current price and market data for a cryptocurrency. Accepts common ticker symbols (e.g. "BTC", "ETH", "SOL") or CoinGecko IDs (e.g. "bitcoin", "ethereum"). Prices are in USD via CoinGecko's free API. Args: symbol: Cryptocurrency symbol (e.g. "BTC") or CoinGecko ID (e.g. "bitcoin"). Returns: Current USD price, market cap, and 24-hour change percentage.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | required | Cryptocurrency symbol (e.g. "BTC") or CoinGecko ID (e.g. "bitcoin"). |
curl -X POST "https://context.gnist.ai/mcp/alpha-vantage/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_crypto_price", "arguments": {"symbol": "BTC"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/alpha-vantage/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'symbol': 'BTC'}, 'name': 'get_crypto_price'}},
)
print(resp.json())
report_feedback
Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: general) |
curl -X POST "https://context.gnist.ai/mcp/alpha-vantage/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/alpha-vantage/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())
FAQ
What data does Alpha Vantage (Finance) provide?
Stock quotes, historical OHLCV, FX rates, and crypto prices. It exposes 5 tools: get_price, get_historical, get_fx_rate, get_crypto_price, report_feedback.
What do I need to get started?
A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.
What format does the Alpha Vantage (Finance) API return?
JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.