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/mcpIt 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:
- GoldAPI MCP Server overview
- GoldAPI API documentation — MCP Server
- GoldAPI dashboard
- OAuth protected-resource metadata
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 orx-access-tokenAPI 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.
- Sign in to ChatGPT on the web and confirm that your personal or workspace permissions allow custom MCP plugins.
- Open Plugins, select the add button, and choose Add custom MCP server.
- Name the server
GoldAPI. - Select a remote server connection and enter
https://mcp.goldapi.io/mcp. - Select OAuth as the authentication method.
- Create and install the plugin, then complete the GoldAPI login and consent flow.
- Open a new conversation, type
@, select GoldAPI, and confirm that its MCP tools are available. - 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.
- In Claude or Claude Desktop, open Customize, then Connectors.
- Select Add custom connector and name it
GoldAPI. - Enter
https://mcp.goldapi.io/mcpas the remote MCP server URL. - Confirm that Claude detects OAuth and choose Sign in now.
- When prompted, use Claude's published OAuth identity.
- Sign in to GoldAPI, review the requested access, and approve consent.
- Return to Claude and verify that GoldAPI is connected and enabled for the conversation.
- 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 listStart 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 listAfter 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:
- Create a remote MCP connection named
goldapi. - Set its URL to
https://mcp.goldapi.io/mcp. - Use OAuth when the client supports remote authorization.
- Otherwise, configure the
x-access-tokenheader with a securely stored GoldAPI API key. - Reconnect or restart the client so it discovers the current tool catalogue.
- 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.
| Tool | Purpose | GoldAPI request cost |
|---|---|---|
get_current_metal_price | Return the current price for a supported metal and currency. | 1 price request |
get_historical_metal_price | Return the price for one historical calendar date. | 1 price request |
get_metal_price_history | Return ordered daily prices for an inclusive range of up to 90 days. | 1 history request |
get_currency_rate | Return a current currency conversion rate with bid and ask values. | 1 rates request |
convert_currency | Convert an amount using the current GoldAPI currency rate. | 1 rates request |
get_lbma_benchmark | Return an LBMA benchmark for a supported metal and date. | 1 LBMA request |
convert_metal_weight | Convert precious-metal weight between nine supported units. | No price request |
calculate_metal_value | Calculate live or historical melt value by weight and purity. | 1 price request |
calculate_dealer_quote | Create a nonbinding dealer buy or sell estimate from melt value. | 1 price request |
compare_karat_values | Compare common karat values using one GoldAPI price. | 1 price request |
analyze_metal_performance | Calculate descriptive statistics for a history range without forecasting. | 1 history request |
value_metal_holdings | Value 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:
- Confirm that
goldapiis shown as connected and authenticated. - Inspect the available tools and look for
get_current_metal_priceand the other GoldAPI tools listed above. - Ask a simple current-price question.
- Open the client's tool-call details and confirm that it called a GoldAPI tool rather than answering from general model knowledge.
- 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.
