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 726+ 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 726+ 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 726+ 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
Same URL for every agent. Authenticate with Authorization: Bearer YOUR_API_KEY. Do not put the key in the URL — Claude Desktop and claude.ai reject ?api_key= and ?apikey=.
MCP endpoint
Never paste an API key into this URL. There is no OAuth client. Create an account to get a key.
"url": "https://metals-api.mcp.metals-api.com/mcp". Do not wrap the server with npx or mcp-remote.
Connect to Claude
These steps are the same on claude.ai and in the Claude Desktop app. Add Metals-API as a custom connector. The remote URL has no key. Do not edit claude_desktop_config.json.
1. Open Connectors
User menu → Settings → Customize → Connectors → Add / Add custom connector. Do not search the official connector directory — Metals-API is added as a custom connector.
2. Name and URL
In the Add custom connector panel, fill in:
Name: for example MCP Metals-API
Remote server URL:
3. Authentication
Never paste an API key into the MCP URL. Metals-API does not use an OAuth client, so leave any OAuth client secret empty. Send the key as Authorization: Bearer YOUR_API_KEY. If this connector cannot attach a request header, include api_key in the tool arguments. The key still must not appear in the URL. Get a key if you do not have one.
After setup, try asking Claude: "What's the current price of gold per ounce?"
Connect with Claude Code
Add the remote HTTP server from a terminal. The URL stays free of the API key. Authentication is the Bearer header on this command.
claude mcp add --transport http mcp-metals-api https://metals-api.mcp.metals-api.com/mcp \ --header "Authorization: Bearer YOUR_API_KEY"
Check the connection
Open Claude Code and run claude mcp list. Metals-API uses a Bearer API key, so there is no OAuth sign-in. The /mcp authenticate action is only for servers that use OAuth.
Then try: "What's the current price of gold per ounce?"
Connect to Cursor
Add the remote MCP server from Cursor Settings. You need a Metals API key. The URL has no key. Send it as Authorization: Bearer.
If you have a Mac
1. In the menu bar click Cursor → Preferences → Cursor Settings.
2. In the sidebar, click Customize.
3. Filter by MCPs, then click New MCP Server.
4. URL:
5. When it asks for a header, set Authorization to Bearer YOUR_API_KEY. There is no OAuth client id.
If you have Windows
1. Open the Cursor menu and click Settings → Cursor Settings.
2. In the sidebar, click Customize.
3. Filter by MCPs, then click New MCP Server.
4. URL:
5. When it asks for a header, set Authorization to Bearer YOUR_API_KEY. There is no OAuth client id.
Optional: a settings file instead
Only if you prefer not to use the menus. Paste this into ~/.cursor/mcp.json on a Mac, or %USERPROFILE%\.cursor\mcp.json on Windows. The server is a remote url. Do not use npx or mcp-remote.
{
"mcpServers": {
"metals-api": {
"url": "https://metals-api.mcp.metals-api.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
After setup, try: "What's the current price of gold per ounce?"
Connect to ChatGPT
Add Metals-API from ChatGPT Settings → Connectors. This is the MCP connector, not an OpenAI proxy and not a curl call. Never put an API key in the MCP URL.
1. Get your API key
Create an account and copy your Metals API key.
2. Name and URL
In ChatGPT, open Settings → Connectors and add a custom MCP connector.
Remote server URL:
3. Authentication
Send Authorization: Bearer YOUR_API_KEY. Do not put the key in the URL. There is no OAuth client id and no client secret.
4. 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"
Python: get gold price example
A complete Python example that fetches the current gold price using the MCP protocol. The key travels in the Authorization header, not in the URL and not in the tool arguments.
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,
headers={"Authorization": f"Bearer {API_KEY}"},
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,
"Authorization": f"Bearer {API_KEY}"
},
json={
"jsonrpc": "2.0",
"id": "2",
"method": "tools/call",
"params": {
"name": tool_name,
"arguments": 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())
Frequently asked questions
Authorization: Bearer YOUR_API_KEY on each request to the MCP endpoint. Do not put the key in the URL (?api_key= or ?apikey=) — Claude Desktop and claude.ai reject tokens in the query string. There is no OAuth client. Register here to get a key. Check our pricing page for plan details.metals.symbols tool or visit our symbols page for a complete list.