Use MetalAPI with AI Assistants (MCP)
Connect Claude, ChatGPT, Cursor, VS Code and other AI assistants to live metal prices with the MetalAPI MCP server, by signing in or with an API key.
What the MCP server does
MetalAPI runs a Model Context Protocol server at https://metalapi.com/mcp. Once connected, your assistant can look up live and historical prices, convert amounts, chart time series and check your plan and usage, all from a chat.
There are two ways to connect:
- Sign in (OAuth): Claude, ChatGPT and other apps that support custom connectors. You sign in to MetalAPI (or create a free account) and approve the connection.
- API key: Claude Code, Cursor, VS Code and any client that can send a header. Use a key from your dashboard.
Claude (claude.ai and Claude Desktop)
- Open Settings → Connectors and choose Add custom connector.
- Name it MetalAPI and enter the URL
https://metalapi.com/mcp. - Click Connect, sign in to MetalAPI and click Allow.
Then ask, for example: "What is the gold price in euros per gram today?"
ChatGPT
In Settings → Apps & Connectors, create a connector (developer mode) with the URL https://metalapi.com/mcp and OAuth authentication. ChatGPT opens the MetalAPI sign-in; approve the connection and the tools are ready.
Claude Code
Add the server with your API key:
claude mcp add --transport http metalapi https://metalapi.com/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
# Or sign in instead of using a key: add it without --header, then run /mcp in Claude Code.Cursor
Add MetalAPI to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):
{
"mcpServers": {
"metalapi": {
"url": "https://metalapi.com/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}VS Code (GitHub Copilot)
Create .vscode/mcp.json; VS Code asks for the key once and stores it securely:
{
"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}" }
}
}
}Tools
get_latest_prices,get_historical_prices,convert,get_timeseries,get_fluctuation,get_ohlc,get_carat_prices: market data. Each call counts as one request against your plan, exactly like the REST API, and is as fresh as your plan allows.list_symbols,get_account,list_plans,list_api_keys: free of charge.get_upgrade_link: a secure Stripe checkout link for a bigger plan. Your assistant can prepare it, but only you can pay.create_api_key: creates a key for your own apps (only when connected by signing in).
For AI coding assistants
Building an integration with an AI coding tool? Point it at llms.txt, the complete llms-full.txt or the OpenAPI specification; they describe every endpoint, parameter and response.
Security
Connections made by signing in are listed under Settings → Connected apps in your dashboard, where you can disconnect them at any time. API keys can be rolled or revoked under API keys; a key in an MCP config is as sensitive as one in your code.
Related guides
Ready to start building?
Create a free account to get your API key, or explore every endpoint in the API reference.