- Home
- MCP servers
- Metal Price
Metal Price
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"isdaniel-mcp-metal-price": {
"command": "cmd",
"args": [
"/c",
"python",
"-m",
"mcp_metal_price"
],
"env": {
"GOLDAPI_API_KEY": "YOUR_GOLDAPI_API_KEY"
}
}
}
}You can run a Python-based MCP server that fetches current and historical precious metal prices through GoldAPI.io. This server exposes a single MCP tool to query metal prices in different currencies and optionally by date, making it easy to integrate live metal pricing into your MCP workflows.
How to use
Start the server with a standard Python execution, then connect to it from your MCP client. Use the available tool to fetch current prices for gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD) in your preferred currency. If you need historical data, provide a date in YYYYMMDD format to retrieve prices from that day.
Once the server is running, you can invoke the get_gold_price tool through your MCP client, passing parameters such as currency, metal, and an optional date. The server will respond with the requested price data in JSON, including timestamp, metal, currency, price, and unit.
How to install
Prerequisites: Python 3.7 or newer and a working environment to install Python packages.
Install dependencies for the project.
pip install -r requirements.txt
Additional configuration and notes
Set your GoldAPI.io API key in your environment to authorize price lookups.
Example: on Unix-like systems, set the variable GOLDAPI_API_KEY to your key.
export GOLDAPI_API_KEY="your_api_key_here"
On Windows, use set instead of export.
## Running the server and MCP integration
Run the server using Python and point your MCP client to the local stdio endpoint.
python src/server.py
In your MCP client, connect to the local stdio server using the standard local connection method your client supports.
Using the get_gold_price tool
The tool accepts parameters to customize the query: currency, metal, and an optional date. If you request a historical price, provide date in YYYYMMDD format.
Response format
The server returns price data in JSON format with details such as timestamp, metal, currency, price, and unit.
Security and maintenance notes
Protect your API key and keep your environment secure. Review access controls for your MCP setup and rotate API keys periodically.
Examples
# Example usage in a client script
# Fetch current XAU price in EUR
{
"currency": "EUR",
"metal": "XAU"
}
# Fetch historical XAU price in USD for 20230101
{
"currency": "USD",
"metal": "XAU",
"date": "20230101"
}
Available tools
get_gold_price
Retrieves current or historical metal prices in the specified currency and metal symbol, with an optional date for historical data.