How to Connect ChatGPT, Claude and Codex to the GoldAPI MCP Server

Connect AI agents to the hosted GoldAPI MCP Server for live and historical metal (gold, silver) prices, currency conversion, valuations, portfolio analysis and LBMA benchmarks.

Connect AI Agents to Precious-Metals Data with the GoldAPI MCP Server

GoldAPI.io provides a remotely hosted Model Context Protocol (MCP) server for AI assistants and agent applications. It gives compatible clients structured tools for current and historical precious-metals prices, currency conversion, melt-value calculations, dealer quotes, portfolio valuation, performance analysis, and LBMA benchmarks.

The production MCP endpoint is:

https://mcp.goldapi.io/mcp

It uses the Streamable HTTP transport. There is no package to install and no local MCP process to keep running: connect your AI client directly to the HTTPS endpoint and authenticate with OAuth or a GoldAPI API key.

Free accounts can evaluate MCP using their shared 150 monthly GoldAPI requests. The Business plan includes unlimited MCP Server usage. The Pro plan includes unlimited REST API requests but does not include MCP Server access.

Useful references:

Why use MCP instead of calling the REST API directly?

REST is a good fit when your application already knows which endpoint to call and how to process the response. MCP is designed for AI clients: the server publishes named tools and their input schemas, and the AI client selects the appropriate tool from the user's request.

For example, a user can ask:

What is the current melt value of 125 grams of 22k gold in AUD?

The client can identify calculate_metal_value, supply the metal, currency, weight, unit, and purity, and present the structured result conversationally.

Use GoldAPI MCP when an AI assistant needs to retrieve or calculate precious-metals data. Use the GoldAPI REST API for conventional backend lookups, and use GoldAPI WebSockets for continuously updated dashboards and streaming applications.

Authentication

GoldAPI supports two authentication methods for the remote MCP endpoint.

OAuth for interactive AI clients

OAuth is recommended for ChatGPT, Claude, Claude Code, Codex, and other interactive clients that support remote MCP authorization.

Configure only the endpoint:

{
  "mcpServers": {
    "goldapi": {
      "url": "https://mcp.goldapi.io/mcp"
    }
  }
}

The client discovers the GoldAPI authorization service, opens the GoldAPI login and consent flow, and manages the resulting access and refresh tokens. Sign in with an eligible Free or Business GoldAPI account.

API key for controlled clients

Server-side clients and MCP clients that support custom headers can authenticate with an existing GoldAPI API key in the x-access-token header:

{
  "mcpServers": {
    "goldapi": {
      "url": "https://mcp.goldapi.io/mcp",
      "headers": {
        "x-access-token": "${GOLDAPI_API_KEY}"
      }
    }
  }
}

Store GOLDAPI_API_KEY in an environment variable or secret manager. Do not commit an API key to source control or place it in a public client configuration.

If both credentials are supplied, the OAuth Bearer token takes priority. GoldAPI validates the authenticated user and Business-plan access on each MCP request.

Common authentication responses are:

  • 401 — no valid OAuth Bearer token or x-access-token API key was supplied.
  • 403 MCP_PLAN_NOT_AVAILABLE — the authenticated account is on a plan without MCP access.
  • MONTHLY_API_QUOTA_EXCEEDED — a Free account has exhausted its shared monthly allowance; the MCP tool returns an error without an HTTP 500 response.
  • 429 — an underlying GoldAPI request or rate limit was reached.

Connect ChatGPT

ChatGPT uses OAuth for this connection because its custom MCP setup does not send a customer-supplied API-key header.

  1. Sign in to ChatGPT on the web and confirm that your personal or workspace permissions allow custom MCP plugins.
  2. Open Plugins, select the add button, and choose Add custom MCP server.
  3. Name the server GoldAPI.
  4. Select a remote server connection and enter https://mcp.goldapi.io/mcp.
  5. Select OAuth as the authentication method.
  6. Create and install the plugin, then complete the GoldAPI login and consent flow.
  7. Open a new conversation, type @, select GoldAPI, and confirm that its MCP tools are available.
  8. Test the connection with: Use GoldAPI to get the current gold price in Australian dollars.

If the tools do not appear, refresh the plugin's tool catalogue and start a new conversation. Client availability and workspace permissions can vary.

Connect Claude or Claude Desktop

Claude can add GoldAPI as a remote custom connector. On Team and Enterprise plans, an organization owner or authorized administrator may need to add the connector before members can use it.

  1. In Claude or Claude Desktop, open Customize, then Connectors.
  2. Select Add custom connector and name it GoldAPI.
  3. Enter https://mcp.goldapi.io/mcp as the remote MCP server URL.
  4. Confirm that Claude detects OAuth and choose Sign in now.
  5. When prompted, use Claude's published OAuth identity.
  6. Sign in to GoldAPI, review the requested access, and approve consent.
  7. Return to Claude and verify that GoldAPI is connected and enabled for the conversation.
  8. Test it with: Use GoldAPI to calculate the current melt value of 125 grams of 22k gold in AUD.

Connect Claude Code

Add GoldAPI as a remote HTTP MCP server from the terminal:

claude mcp add --transport http goldapi https://mcp.goldapi.io/mcp
claude mcp list

Start or restart Claude Code, run /mcp, select goldapi, and complete OAuth when requested. Run /mcp again to confirm that the connection is active and the tools have been discovered.

Example verification prompt:

Use GoldAPI to compare the current per-gram values of 14k, 18k, 22k, and 24k gold in USD.

Connect Codex

Codex supports remote Streamable HTTP MCP servers and browser-based OAuth login:

codex mcp add goldapi --url https://mcp.goldapi.io/mcp
codex mcp get goldapi
codex mcp login goldapi
codex mcp list

After authorization, start a new Codex session so it reloads the available tools. If authorization becomes stale, run codex mcp logout goldapi, repeat codex mcp login goldapi, and check the connection with codex mcp list.

Example verification prompt:

Use GoldAPI to value 10 ounces of gold, 250 ounces of silver, and 5 ounces of platinum in USD.

Connect another MCP-compatible client

For any client that supports remote Streamable HTTP MCP servers:

  1. Create a remote MCP connection named goldapi.
  2. Set its URL to https://mcp.goldapi.io/mcp.
  3. Use OAuth when the client supports remote authorization.
  4. Otherwise, configure the x-access-token header with a securely stored GoldAPI API key.
  5. Reconnect or restart the client so it discovers the current tool catalogue.
  6. Run a simple current-price prompt and inspect the tool-call details to confirm GoldAPI supplied the result.

Do not assume that every AI client supports both authentication methods. In particular, clients that cannot send custom headers must use OAuth.

Available MCP tools

The GoldAPI MCP Server currently exposes the following tools.

ToolPurposeGoldAPI request cost
get_current_metal_priceReturn the current price for a supported metal and currency.1 price request
get_historical_metal_priceReturn the price for one historical calendar date.1 price request
get_metal_price_historyReturn ordered daily prices for an inclusive range of up to 90 days.1 history request
get_currency_rateReturn a current currency conversion rate with bid and ask values.1 rates request
convert_currencyConvert an amount using the current GoldAPI currency rate.1 rates request
get_lbma_benchmarkReturn an LBMA benchmark for a supported metal and date.1 LBMA request
convert_metal_weightConvert precious-metal weight between nine supported units.No price request
calculate_metal_valueCalculate live or historical melt value by weight and purity.1 price request
calculate_dealer_quoteCreate a nonbinding dealer buy or sell estimate from melt value.1 price request
compare_karat_valuesCompare common karat values using one GoldAPI price.1 price request
analyze_metal_performanceCalculate descriptive statistics for a history range without forecasting.1 history request
value_metal_holdingsValue up to 50 holdings using deduplicated price requests.1–8 price requests

The server supports GoldAPI precious-metal symbols including gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD). Supported currencies and the precise input schema for each tool are published to the connected MCP client automatically.

Example prompts

Current and historical prices

What is the current gold price in Australian dollars?

Expected tool: get_current_metal_price

What was the silver price in USD on 2025-01-15?

Expected tool: get_historical_metal_price

Show daily XAU/EUR prices from 2025-03-01 through 2025-03-14.

Expected tool: get_metal_price_history

Currency and benchmark data

Convert 10,000 USD to AED using the current GoldAPI exchange rate.

Expected tool: convert_currency

Get the LBMA gold benchmark in USD for 2025-06-30.

Expected tool: get_lbma_benchmark

Jewelry, bullion, and dealer workflows

What is the current melt value of 125 grams of 22k gold in AUD?

Expected tool: calculate_metal_value

Estimate a dealer buy quote for 50 troy ounces of silver at a 4% discount to melt value.

Expected tool: calculate_dealer_quote

Compare the current value per gram of 14k, 18k, 22k, and 24k gold in USD.

Expected tool: compare_karat_values

Analysis and portfolio valuation

Analyze XAU/USD performance over the last 30 calendar days.

Expected tool: analyze_metal_performance

The performance tool calculates descriptive statistics from GoldAPI history. It does not forecast future prices or provide investment advice.

Value my holdings: 10 ounces of gold, 250 ounces of silver, and 5 ounces of platinum in USD.

Expected tool: value_metal_holdings

How to verify the integration

After connecting an AI client:

  1. Confirm that goldapi is shown as connected and authenticated.
  2. Inspect the available tools and look for get_current_metal_price and the other GoldAPI tools listed above.
  3. Ask a simple current-price question.
  4. Open the client's tool-call details and confirm that it called a GoldAPI tool rather than answering from general model knowledge.
  5. Check that the returned metal, currency, date, and unit match the prompt.

If a connection fails, verify the endpoint exactly, repeat OAuth or check the API-key header, confirm active Business-plan access, and restart the AI client to refresh its MCP tool catalogue.

Start using the GoldAPI MCP Server

The hosted GoldAPI MCP Server lets ChatGPT, Claude, Claude Code, Codex, and other compatible AI agents work with structured precious-metals data without installing or operating a local server. Connect to https://mcp.goldapi.io/mcp, authenticate through OAuth or the x-access-token header, and use natural-language prompts to invoke the appropriate GoldAPI tools.

For authoritative endpoint, authentication, tool, and error details, see the GoldAPI MCP Server API documentation.

GoldAPI.io Developer FAQ

Helpful answers for developers working with precious metals price data.

Can I use GoldAPI.io price API examples in production?

Yes. GoldAPI.io API examples can be used in production applications with your API key. Developers can integrate real-time gold, silver, and precious metals prices into websites, trading platforms, and financial tools.

Does GoldAPI.io support multiple currencies for gold price API?

Yes. GoldAPI.io supports multiple currencies including USD, AUD, CAD, EUR, GBP, AED, SGD, KWD, OMR, and SAR. You can request gold price and other metals price data in any supported currency.

Is GoldAPI.io suitable for trading bots and financial applications?

Yes. GoldAPI.io is designed for developers building trading bots, financial dashboards, analytics platforms, and pricing tools. It provides fast and reliable real-time and historical metals price data via JSON API.

Integration Guides To

Build With GoldAPI.io Today

Practical guides for WordPress, Shopify, Excel, Joomla, and Drupal.

WordPress integration icon
WordPress

How to Get Real-Time Gold and Silver Prices in WordPress

Step-by-step guide on integrating GoldAPI.io Price Call in WordPress site

Read article →
Shopify integration icon
Shopify

How to Get Real-Time Gold and Silver Prices in Shopify

Step-by-step guide on integrating GoldAPI.io Price Call in Shopify store

Read article →
Excel integration icon
Excel

How to Get Real-Time Gold and Silver Prices in Excel

Step-by-step guide on integrating GoldAPI.io Price Call in Excel spreadsheet

Read article →
WebSockets integration icon
WebSockets

How to Stream Live Gold Prices Using GoldAPI.io WebSockets Integration

Build a real-time gold price WebSocket feed for bullion dealer quotes, live dashboards, inventory valuation, and customer price updates with GoldAPI.io.

Read article →
FX WebSockets integration icon
FX WebSockets

How to Get Real-Time Currency FX Rates Using GoldAPI.io WebSockets

Stream live foreign-exchange rates, bid and ask prices, and currency-pair updates into FX dashboards, conversion tools, checkout pricing, and treasury workflows.

Read article →
MCP Server integration icon
MCP Server

How to Connect ChatGPT, Claude and Codex to the GoldAPI MCP Server

Connect AI agents to the hosted GoldAPI MCP Server for live and historical metal (gold, silver) prices, currency conversion, valuations, portfolio analysis and LBMA benchmarks.

Read article →