MCP ready

MCP Server, connect AI to live metals data

Integrate Metals-API with ChatGPT, Claude, Cursor or any MCP-compatible assistant. Get real-time precious metals prices directly in your AI conversations.

Ask Claude:

"What's the current price of gold per ounce in USD?"

AI calls MCP tool:
{
"tool": "metals.latest",
"params": {
"symbols": "XAU",
"base": "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 743+ 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.

metals.latest Core

Get real-time prices for gold, silver, platinum, palladium, and 743+ supported symbols.

metals.historical Core

Retrieve historical prices for any specific date.

metals.fluctuation Analytics

Calculate price changes between two dates with percentage and absolute values.

metals.convert Core

Convert amounts between any metal or currency pairs instantly.

metals.ohlc Technical

Get Open/High/Low/Close price data for technical analysis.

metals.symbols Reference

List all 743+ supported symbols available metal and currency symbols.

metals.time_series Analytics

Get daily price data over a date range for trend analysis.

metals.intraday Technical

Get intraday candles for a single symbol on a specific date (intervals from 1m to 1d).

Set up in one step

Paste this line into your AI agent (Claude Code, Cursor, Codex, Gemini CLI, VS Code or Windsurf). It reads the instructions, adds the Metals-API server and checks that it works.

Paste into your agent

No API key needed: the agent adds the server and you sign in to Metals-API once in the browser. Create an account if you do not have one.

Using ChatGPT or the Claude app? They connect by signing in, with no key to paste: see the steps below.

Connect manually

Same URL for every client. Most of them connect by signing in, with no key.

ChatGPT connects by signing in to your Metals-API account. There is no key to paste.

  1. Open Settings → Connectors and add a custom MCP connector.
  2. Paste the URL above as the remote server URL.
  3. Choose OAuth and leave the client ID and secret empty.
  4. Create the connector, then log in to Metals-API and approve access.

Then ask: "What's the current price of gold per ounce?"

Call it from code

You can also call the MCP server directly over HTTP.

Python example: get the gold price
get_gold_price.py
import httpx
import json
import asyncio

MCP_SERVER_URL = "https://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

By signing in: ChatGPT, Claude, Claude Code and Cursor open Metals-API in the browser, you log in and approve, and there is no key to paste. Clients that cannot sign in send Authorization: Bearer YOUR_API_KEY. Never put the key in the URL. Register here to get a key.
MCP requests count toward your existing API quota just like REST API calls. Each tool call equals one API request. Check our pricing page for plan details.
We support 743+ symbols including precious metals, industrial metals, and major currencies. Use the metals.symbols tool or visit our symbols page for a complete list.
Yes. Any client that speaks the Model Context Protocol over HTTP can connect. That includes Claude (claude.ai and Desktop), Claude Code, Cursor, ChatGPT connectors, and custom Python clients.