MetalAPI
XAU3,997.89−1.54%XAG53.936−1.51%XPT1,554.47−0.83%XPD1,047.03−0.44%XCU6.5080+2.29%WTI103.27+3.82%BRENT111.70−1.30%EUR1.120400−0.01%GBP1.337500−0.01%JPY0.0063761+0.14%CHF1.213445−0.25%TRY0.020125−0.12%BTC80,329.75−0.55%ETH2,329.36−1.13%
All articles
AIMCPClaudeGuide

Connect Claude and ChatGPT to Live Gold Prices with MCP

Connect Claude, ChatGPT, Cursor and VS Code to live gold and metal prices with the MetalAPI MCP server: OAuth or API key setup, tools, safety and quotas.

By MetalAPI Team··10 min read

Why an assistant needs a price tool

Ask a chat assistant for today's gold price without any tools and you get one of three answers: a refusal, a number from its training data, or a guess delivered with more confidence than it deserves. None of them is useful. A language model learns from a snapshot of text that ends months before you talk to it, while gold, silver and oil prices move every few seconds whenever markets are open.

The usual workaround is to look the price up yourself and paste it into the chat. That works for one question and then breaks down. You have to remember which unit you copied (troy ounce or gram?), which currency, and when the number was taken. Ask a follow-up about last month's range, or a conversion into Turkish lira, and you are back in the browser.

The Model Context Protocol (MCP) removes that step. The assistant gets a small set of tools it can call by itself, and every answer is built from a fresh API response that carries its own timestamp, base currency and unit. This post shows how to connect Claude, ChatGPT, Claude Code, Cursor and VS Code to the MetalAPI MCP server, what the assistant can do once connected, and which safeguards apply.

AspectPasting numbers by handCalling an MCP tool
FreshnessWhatever you copied, whenever you copied itThe latest price your plan allows, fetched when you ask
Units and currencyEasy to mix up troy ounces, grams and currenciesExplicit base and unit arguments, echoed in the response
TimestampUsually lost on the wayEvery response includes timestamp and date
Follow-up questionsAnother manual lookupThe assistant calls another tool
History and conversionsA separate website or spreadsheetTime series, OHLC, change and convert tools

What MCP is

MCP is an open protocol, introduced by Anthropic in 2024 and now supported by many AI applications, that standardises how an assistant talks to external tools and data. An MCP server publishes a list of tools. Each tool has a name, a plain-language description, a JSON schema for its arguments and optional annotations such as "read-only". An MCP client (Claude, ChatGPT, Cursor, VS Code and others) reads that list, lets the model decide when a tool is relevant, sends the call to the server and hands the result back to the model.

The model itself never sees your credentials and never talks to the API directly. It produces a structured request such as "call get_latest_prices with symbols: XAU and base: EUR", the client executes it, and the model writes its answer from the JSON that comes back.

MetalAPI's server lives at https://metalapi.com/mcp. It speaks Streamable HTTP, the remote transport defined in the MCP specification, and it is stateless: every call is an independent HTTPS request with a JSON response, so there is no long-lived session to keep alive. The server is listed in the official MCP Registry as com.metalapi/metalapi. If you open the URL in a browser, you are redirected to the AI & MCP overview page.

Sign in with OAuth or use an API key

Every call to the server is authenticated. There are two ways to do it, and the right one depends on the client:

  • OAuth 2.1 (sign in) for apps with a connector screen, such as Claude and ChatGPT. The client discovers the authorisation server by itself: an unauthenticated call gets a 401 response with a WWW-Authenticate header that points to the server's protected-resource metadata. The client then registers through dynamic client registration and opens a MetalAPI sign-in page. The flow uses PKCE, so no client secret has to be built into the app. You sign in, or create a free account, and approve the connection.
  • API key for developer tools that let you set HTTP headers, such as Claude Code, Cursor and VS Code. You send the same key you use for the REST API as Authorization: Bearer mk_live_….

Both routes lead to the same account, plan and quota. There is one difference in the tool list: create_api_key is only offered on OAuth connections. A key copied into a config file should never be able to mint further keys, so a key-based connection sees twelve tools instead of thirteen.

OAuth connections are listed in your dashboard under Settings → Connected apps, where you can disconnect any of them. API keys can be rolled or revoked under API keys. Treat a key in an MCP config file exactly like a key in your source code.

Connect Claude and ChatGPT

For Claude on claude.ai and in Claude Desktop:

  1. Open Settings → Connectors and choose Add custom connector.
  2. Name it MetalAPI and enter https://metalapi.com/mcp.
  3. Click Connect, sign in to MetalAPI (or create a free account) and click Allow.

For ChatGPT, open Settings → Apps & Connectors and create a connector in developer mode with the URL https://metalapi.com/mcp and OAuth authentication. ChatGPT opens the MetalAPI sign-in page; approve the connection and the tools become available in your chats. Whether you can add custom connectors depends on your ChatGPT plan and, in a workspace, on what the administrator allows.

Menu names in both apps change from time to time. The MCP setup guide is kept up to date with the current steps for each client.

In your first conversation it helps to name the source ("Using MetalAPI, what is…") so the assistant reaches for the tool rather than its memory. After that, most assistants pick the tool on their own whenever a question involves a price.

Connect Claude Code, Cursor and VS Code

Coding assistants usually take an API key. Create one in the dashboard (the Free plan is enough to start) and use a separate key for each tool, so you can revoke one without breaking the others.

In Claude Code, add the server from the terminal:

Claude Code
claude mcp add --transport http metalapi https://metalapi.com/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

If you would rather not store a key, add the server without --header and run /mcp inside Claude Code to sign in through OAuth instead.

In Cursor, add the server to ~/.cursor/mcp.json, or to .cursor/mcp.json inside a project:

~/.cursor/mcp.json
{
  "mcpServers": {
    "metalapi": {
      "url": "https://metalapi.com/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}

In VS Code with GitHub Copilot, save the following as .vscode/mcp.json. The inputs block makes VS Code ask for the key once and store it securely, so the key never sits in the file itself:

.vscode/mcp.json
{
  "inputs": [
    { "type": "promptString", "id": "metalapi-key", "description": "MetalAPI API key", "password": true }
  ],
  "servers": {
    "metalapi": {
      "type": "http",
      "url": "https://metalapi.com/mcp",
      "headers": { "Authorization": "Bearer ${input:metalapi-key}" }
    }
  }
}

Other clients that support remote MCP servers over Streamable HTTP, such as Windsurf, follow the same pattern: the server URL plus either a bearer header or an OAuth sign-in.

What a conversation looks like

Once connected, you ask in plain language and the assistant chooses a tool and its arguments. A few typical prompts and the calls they lead to:

You askToolArguments
What's the gold price per gram in euros right now?get_latest_pricessymbols: XAU, base: EUR, unit: gram
How did silver move over the last two weeks?get_timeseries or get_fluctuationsymbols: XAG, start_date, end_date
Convert 2.5 troy ounces of platinum to Turkish lira.convertfrom: XPT, to: TRY, amount: 2.5
What were gold's open, high, low and close today?get_ohlcsymbols: XAU
What does 18K gold cost per gram in pounds?get_carat_pricesbase: GBP (paid plans)
Which plan am I on and how much quota is left?get_accountNone

Price tools return compact JSON. The REST API's rates block lists every symbol twice, as the price and as its inverse, for compatibility with older integrations. The MCP server keeps only the prices, keyed by symbol, under prices. That roughly halves the tokens and removes the most common way to misread the data. A call to get_latest_prices with symbols: XAU,XAG, base: EUR and unit: gram returns something like this:

get_latest_prices result (illustrative)
{
  "success": true,
  "timestamp": 1792834892,
  "date": "2026-10-24",
  "base": "EUR",
  "unit": "gram",
  "rate_limit": {
    "limit": 10000,
    "remaining": 9874,
    "reset": 1793491200,
    "used": 126,
    "plan": "Standard",
    "reset_date": "2026-11-01T00:00:00.000Z"
  },
  "prices": {
    "XAU": 110.4064149,
    "XAG": 1.489616277
  }
}

The numbers in this post are illustrative. Real answers use the latest prices your plan allows.

Because each response carries timestamp, base and unit, a good answer says that gold was about €110 per gram at a given time, not just "€110". If an answer leaves that context out, ask for it.

Assistants can chain calls, too. Asked to compare the gold-to-silver ratio today with a month ago, an assistant can fetch both metals for both dates and do the division itself. Asked for a chart, a client that can run code can turn a get_timeseries result into one.

The 13 tools

The server exposes thirteen tools. Seven return market data and count as one request each against your plan's monthly allowance, exactly like a REST call. The others are free.

ToolWhat it doesQuota
get_latest_pricesLatest prices for metals, energy, currencies and crypto, in any base currency and mass unit1 request
get_historical_pricesClosing prices on a past day1 request
convertConverts an amount between two symbols, at the latest price or on a past day1 request
get_timeseriesDaily closing prices between two dates (up to 30 days per call on Free, 365 on paid plans)1 request
get_fluctuationStart and end price, absolute and percentage change between two dates1 request
get_ohlcOpen, high, low and close for a day1 request
get_carat_pricesGold prices by karat, such as 22K or 18K (paid plans)1 request
list_symbolsAll symbol codes with name, category and unitFree
get_accountYour plan, monthly allowance, usage and reset dateFree
list_plansEvery plan with limits and monthly and yearly pricesFree
list_api_keysYour active API keys, maskedFree
create_api_keyCreates a key for your own apps; OAuth connections only; asks firstFree
get_upgrade_linkPrepares a Stripe checkout link, or a billing portal link for subscribers; asks firstFree

When a client connects, the server also sends short instructions: what the symbol codes mean, that metal prices are per troy ounce unless a unit is given, and that data tools use quota. Clients pass these to the model, which is why a well-behaved assistant asks only for the symbols it needs. Fewer symbols mean shorter answers and fewer tokens.

Safety: read-only by default, no payments

Connecting an assistant to an account raises a fair question: what can it change? The design keeps the answer short.

  • Eleven of the thirteen tools are read-only. They carry the MCP readOnlyHint annotation and can only read prices, your plan, your usage and masked key details.
  • The two write tools ask first. create_api_key and get_upgrade_link are marked as actions that change something, so MCP clients ask for your confirmation before running them.
  • Nothing is ever charged by the server. get_upgrade_link creates a Stripe checkout session for the plan you asked for, or a billing portal link if you already subscribe, and returns the URL. You open it, check the price and pay yourself. The assistant cannot complete a payment.
  • New keys are shown once. A key created through create_api_key is returned in full a single time, as in the dashboard, and only a hash of it is stored.
  • Narrow scope. The connection reaches MetalAPI and nothing else: prices, your plan, usage and API keys. The server never sees your conversations, files or other connectors.
  • Logged like API traffic. Market data calls appear in your dashboard's request log as /mcp/ followed by the tool name, next to your REST requests.

One general MCP habit is worth keeping with any server: read the confirmation prompts your client shows instead of approving them by reflex, and remove connectors you no longer use.

Quotas, freshness and plans

MCP calls draw on the same allowance as the REST API. A data tool call costs one request however many symbols it returns, while list_symbols and the account tools cost nothing. Per-minute rate limits apply as well, starting at 10 requests a minute on Free.

Prices are as fresh as your plan allows. On the Free plan the assistant sees daily prices; paid plans refresh from every 30 minutes down to every 5 seconds:

PlanPrice / monthRequests / monthUpdate interval
Free$0100Daily
Lite$4.991,00030 minutes
Standard$11.9910,00010 minutes
Advanced$24.9950,0001 minute
Pro$49.99100,0001 minute
Ultra$99.99500,00015 seconds
Business$149.99500,00015 seconds
Enterprise$299.991,500,0005 seconds

A hundred requests a month covers occasional questions in a chat. If you use an assistant for analysis that pulls many series, or wire it into an agent that runs on a schedule, ask it for get_account now and then: it reports requests used, requests remaining and when the allowance resets. When the monthly allowance runs out, data tools return a quota-exceeded error with an upgrade link until the 1st of the month (UTC), while the account tools keep working. The pricing page has the full comparison.

Getting started takes a couple of minutes: register for a free account, follow the MCP setup guide for your client and ask your first question. The AI & MCP page summarises the setup, and the API docs describe the REST endpoints behind every tool.

Try it with your own data

Create a free account and make your first request in under two minutes. 100 requests a month, no credit card.

Keep reading