MCP Server, connect AI to live metals data
Integrate Metals-API with Claude Desktop, ChatGPT or any MCP-compatible assistant. Get real-time precious metals prices directly in your AI conversations.
"What's the current price of gold per ounce in USD?"
What is MCP and why does it matter?
The Model Context Protocol (MCP) lets AI assistants access external data in real time. Instead of outdated training data, your AI can fetch live metals prices from our API — just by asking a question.
Example: Ask Claude "What's the current price of gold?" and it will call our
metals.latest tool automatically.
Real-time prices
Live gold, silver, platinum and 618+ symbols instantly.
Natural language
Ask questions like "Compare gold and silver prices this week" and get accurate answers.
Same API quota
MCP calls use your existing API plan. Each AI request counts as one API call.
Available MCP tools
A comprehensive suite of tools to access metals market data from your AI assistant.
Get real-time prices for gold, silver, platinum, palladium, and 618+ supported symbols.
Retrieve historical prices for any specific date.
Calculate price changes between two dates with percentage and absolute values.
Convert amounts between any metal or currency pairs instantly.
Get Open/High/Low/Close price data for technical analysis.
List all 618+ supported symbols available metal and currency symbols.
Get daily price data over a date range for trend analysis.
Get intraday candles for a single symbol on a specific date (intervals from 1m to 1d).
Getting started
Connect in minutes using your API key in the endpoint URL. For direct programmatic calls, include api_key in the tool arguments.
Connect to Claude Desktop
Add this configuration to your Claude Desktop config file. On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"metals-api": {
"command": "npx",
"args": [
"mcp-remote",
"https://metals-api.mcp.metals-api.com/mcp?api_key=YOUR_API_KEY"
]
}
}
}
Create an account to get your API key and replace YOUR_API_KEY in the configuration above.
After setup, try asking Claude: "What's the current price of gold per ounce?"
OpenAI proxy — use with ChatGPT
Our OpenAI-compatible proxy enriches ChatGPT responses with real-time metals data. Send your request to our endpoint instead of OpenAI's and we'll inject live prices into the AI context.
- You send a request to our proxy with your OpenAI API key
- We fetch real-time metals data using the MCP tool you specify
- We inject the data into the conversation context
- OpenAI responds with accurate, up-to-date information
curl -X POST "https://metals-api.mcp.metals-api.com/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{"openai_api_key":"YOUR_OPENAI_API_KEY","model":"gpt-4o-mini","messages":[{"role":"user","content":"What is the current price of gold?"}],"force_mcp_tool":{"tool_name":"metals.latest","params":{"api_key":"YOUR_API_KEY","symbols":"XAU","base":"USD"}}}'
openai_api_key— your OpenAI API keymodel— any OpenAI model (gpt-4o-mini, gpt-4o, etc.)force_mcp_tool.tool_name— MCP tool to useforce_mcp_tool.params.api_key— your Metals API keyforce_mcp_tool.params.symbols— metal symbols (XAU, XAG, XPT, XPD, etc.)
Python: get gold price example
A complete Python example that fetches the current gold price using the MCP protocol.
import httpx
import json
import asyncio
MCP_SERVER_URL = "https://metals-api.mcp.metals-api.com/mcp"
API_KEY = "YOUR_API_KEY"
async def call_mcp_tool(tool_name: str, arguments: dict):
async with httpx.AsyncClient(timeout=60) as client:
init_response = await client.post(
MCP_SERVER_URL,
json={
"jsonrpc": "2.0",
"id": "1",
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {"name": "PythonClient"}
}
}
)
session_id = init_response.headers.get("Mcp-Session-Id")
response = await client.post(
MCP_SERVER_URL,
headers={"Mcp-Session-Id": session_id},
json={
"jsonrpc": "2.0",
"id": "2",
"method": "tools/call",
"params": {
"name": tool_name,
"arguments": {"api_key": API_KEY, **arguments}
}
}
)
return response.json()
async def main():
result = await call_mcp_tool(
"metals.latest",
{"symbols": "XAU", "base": "USD"}
)
if result.get("result", {}).get("rates", {}).get("XAU"):
rate = result["result"]["rates"]["XAU"]
price = 1 / rate
print(f"Current Gold Price: ${price:.2f} USD per ounce")
else:
print(json.dumps(result, indent=2))
asyncio.run(main())
Connect ChatGPT to real-time metals prices
Use Metals MCP to give ChatGPT access to live market data — including gold, silver, platinum, and 618+ assets.
Step 1: Get your API key
Create an account and generate your Metals API key.
Step 2: Add MCP connector in ChatGPT
Paste this MCP endpoint:
Step 3: Ask for live data
- "What is the current price of gold?"
- "Compare gold and silver prices"
- "Show platinum price changes this week"
- "Convert 1 ounce of gold to USD"
Ready to integrate? Get your API key in minutes.
Get startedFrequently asked questions
api_key parameter for each tool call.metals.symbols tool or visit our symbols page for a complete list.