Skip to main content
Glama
isdaniel

Metal Price MCP Server

by isdaniel

铁匠徽章 PyPI - 下载 PyPI - 版本

金属价格MCP服务器

通过GoldAPI.io服务提供当前和历史黄金/贵金属价格的 MCP 服务器。

特征

  • 获取黄金 (XAU)、白银 (XAG)、铂金 (XPT) 和钯金 (XPD) 的当前价格

  • 支持多种货币(美元、欧元等)

  • 可选按日期查找历史价格

Related MCP server: Frankfurter Forex MCP

要求

  • Python 3.7+

  • 套餐:

    • mcp>=1.0.0

    • requests>=2.31.0

设置

  1. 克隆此存储库

  2. 安装依赖项:

    pip install -r requirements.txt
  3. 将您的 GoldAPI.io API 密钥设置为环境变量:

    export GOLDAPI_API_KEY="your_api_key_here"

    (Windows 用户:使用set而不是export

用法

服务器提供了一个 MCP 工具:

安装

该服务器设计为通过将其配置添加到cline_mcp_settings.json文件来手动安装。

  1. 将以下条目添加到cline_mcp_settings.json文件中的mcpServers对象:

"mcp_metal_price": {
  "args": [
    "/c",
    "python",
    "-m",
    "mcp_metal_price"
  ],
  "env": {
    "GOLDAPI_API_KEY": "Your GOLDAPI_API_KEY"
  }
}

获取黄金价格

获取当前或历史金属价格。

参数:

  • currency (字符串,默认值:“USD”):货币代码(ISO 4217 格式)

  • metal (字符串,默认值:“XAU”):金属符号(XAU,XAG,XPT,XPD)

  • date (字符串,可选):YYYYMMDD 格式的历史日期

示例用法:

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

运行服务器

使用以下命令启动服务器:

python src/server.py

与 MCP 客户端一起使用

一旦服务器运行,您就可以从 Cline 或 Claude 等 MCP 客户端连接到它。

连接到服务器

服务器默认在 stdio 上运行。在 MCP 客户端中,您可以使用以下方式连接:

cmd /c python src/server.py

使用 get_gold_price 工具

Cline/Claude 中的工具使用示例:

<use_mcp_tool>
<server_name>gold-price</server_name>
<tool_name>get_gold_price</tool_name>
<arguments>
{
  "currency": "USD",
  "metal": "XAU"
}
</arguments>
</use_mcp_tool>

响应格式

服务器返回JSON格式的价格数据:

{
  "timestamp": 1713600000,
  "metal": "XAU",
  "currency": "USD",
  "price": 2345.67,
  "unit": "per troy ounce"
}

执照

本项目遵循 MIT 许可证。详情请参阅LICENSE文件。

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    C
    quality
    F
    maintenance
    An MCP server providing real-time currency conversion and exchange rate data through the Frankfurter API, enabling users to convert currencies, fetch latest or historical rates, and list available currencies.
    4
    35
  • F
    license
    B
    quality
    D
    maintenance
    An MCP server that provides currency rates, conversions, and historical exchange-rate data using the Frankfurter API. It enables users to retrieve latest rates, convert amounts between currencies, and access time-series data for currency pairs.
    3
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server providing market data for 15,000+ cryptocurrencies including prices, history, trends, and deep coin metadata via CoinGecko.
    65
    1
    Apache 2.0

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/isdaniel/mcp-metal-price'

If you have feedback or need assistance with the MCP directory API, please join our Discord server