npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@goldapi/mcp-server

v1.0.0

Published

Official GoldAPI MCP server for precious metals prices and calculations.

Readme

GoldAPI.io MCP Server

Official Model Context Protocol server for GoldAPI.io precious metals data.

@goldapi/mcp-server lets MCP clients such as Claude Desktop, ChatGPT, Cursor, Windsurf, and other AI agent runtimes retrieve real-time and historical precious metals prices from GoldAPI and perform common bullion and jewelry value calculations.

Features

  • Latest GoldAPI.io spot prices for gold, silver, platinum, and palladium.
  • Historical GoldAPI prices by date.
  • Metal value calculations by weight, unit, and purity.
  • Supported currencies for major fiat currencies and BTC.
  • Strict input validation with useful MCP errors.

Installation

npm install -g @goldapi/mcp-server

You can also run without global installation:

npx -y @goldapi/mcp-server

Environment

Create a GoldAPI API key from the GoldAPI dashboard and pass it as GOLDAPI_KEY.

GOLDAPI_KEY=your_api_key

If GOLDAPI_KEY is missing, the server exits with:

Missing GOLDAPI_KEY environment variable

Claude Desktop Configuration

Add this to your Claude Desktop MCP configuration:

{
  "mcpServers": {
    "goldapi": {
      "command": "npx",
      "args": ["-y", "@goldapi/mcp-server"],
      "env": {
        "GOLDAPI_KEY": "your_api_key"
      }
    }
  }
}

Cursor Setup

Add a new MCP server in Cursor settings:

{
  "mcpServers": {
    "goldapi": {
      "command": "npx",
      "args": ["-y", "@goldapi/mcp-server"],
      "env": {
        "GOLDAPI_KEY": "your_api_key"
      }
    }
  }
}

Windsurf Setup

Add the server to your Windsurf MCP configuration:

{
  "mcpServers": {
    "goldapi": {
      "command": "npx",
      "args": ["-y", "@goldapi/mcp-server"],
      "env": {
        "GOLDAPI_KEY": "your_api_key"
      }
    }
  }
}

Tools

get_metal_price

Get latest precious metal spot price.

Input:

{
  "metal": "XAU",
  "currency": "USD"
}

Output:

{
  "metal": "XAU",
  "currency": "USD",
  "price": 2391.72,
  "change": 11.6,
  "changePercent": 0.49,
  "timestamp": 1716000000
}

get_historical_metal_price

Retrieve historical metal price.

Input:

{
  "metal": "XAU",
  "currency": "USD",
  "date": "20250101"
}

Calls:

GET https://www.goldapi.io/api/{metal}/{currency}/{date}

calculate_metal_value

Calculate value of metal using weight and purity.

Input:

{
  "metal": "XAU",
  "currency": "AED",
  "weight": 125,
  "unit": "gram",
  "purity": "22k"
}

Output:

{
  "metal": "XAU",
  "metalName": "Gold",
  "currency": "AED",
  "weight": 125,
  "unit": "gram",
  "purity": "22k",
  "purityPercent": 91.67,
  "spotPricePerGram": 283.21,
  "adjustedPricePerGram": 259.57,
  "totalValue": 32446.25,
  "timestamp": 1716000000,
  "humanReadable": "The current estimated value of 125 grams of 22k gold is AED 32,446.25."
}

Supported units:

  • gram
  • kg
  • oz
  • troy_oz

Supported purities:

  • 24k = 100%
  • 22k = 91.67%
  • 21k = 87.5%
  • 20k = 83.33%
  • 18k = 75%
  • 16k = 66.67%
  • 14k = 58.33%
  • 10k = 41.67%

get_supported_metals

Returns:

["XAU", "XAG", "XPT", "XPD"]

get_supported_currencies

Returns all supported currencies.

Supported Metals

  • XAU - Gold
  • XAG - Silver
  • XPT - Platinum
  • XPD - Palladium

Supported Currencies

AED, AUD, BTC, CAD, CHF, CNY, CZK, EGP, EUR, GBP, HKD, INR, JOD, JPY, KRW, KWD, MXN, MYR, OMR, PLN, RUB, SAR, SGD, THB, USD, ZAR

Example Prompts

What is gold price in AUD?
What is current value of 125 grams of 22k gold in AED?
What was gold price in USD on January 1st 2025?
What is value of 3 troy ounces of silver?

Local Development

npm install
npm run build
npm run verify

Run the server locally:

GOLDAPI_KEY=your_api_key npm run dev

Run the built server:

GOLDAPI_KEY=your_api_key npm start

Publishing

npm publish --access public