暫無描述

Lukas Goldschmidt 5a63957184 gitignore 1 月之前
src fa5b473d82 Scaffold metals MCP server 1 月之前
.env.example fa5b473d82 Scaffold metals MCP server 1 月之前
.gitignore 5a63957184 gitignore 1 月之前
Dockerfile fa5b473d82 Scaffold metals MCP server 1 月之前
PROJECT.md fa5b473d82 Scaffold metals MCP server 1 月之前
README.md fa5b473d82 Scaffold metals MCP server 1 月之前
discover_swissquote_api.py fa5b473d82 Scaffold metals MCP server 1 月之前
docker-compose.yml fa5b473d82 Scaffold metals MCP server 1 月之前
killserver.sh fa5b473d82 Scaffold metals MCP server 1 月之前
main.py fa5b473d82 Scaffold metals MCP server 1 月之前
metals-mcp_first_idea.md fa5b473d82 Scaffold metals MCP server 1 月之前
requirements.txt fa5b473d82 Scaffold metals MCP server 1 月之前
restart.sh fa5b473d82 Scaffold metals MCP server 1 月之前
run.sh fa5b473d82 Scaffold metals MCP server 1 月之前
swissquote_pairs.json fa5b473d82 Scaffold metals MCP server 1 月之前
test_metals.py fa5b473d82 Scaffold metals MCP server 1 月之前
test_swissquote_api.py fa5b473d82 Scaffold metals MCP server 1 月之前
tests.sh fa5b473d82 Scaffold metals MCP server 1 月之前

README.md

Metals MCP Server

FastMCP-based metals market data server backed by a Swissquote poller and local candle store.

Transport

  • MCP SSE transport mounted at /mcp
  • SSE stream endpoint: /mcp/sse
  • message endpoint handled by FastMCP under /mcp/messages/
  • no legacy /rpc compatibility path

Runtime

source .venv/bin/activate
pip install -r requirements.txt
./run.sh

Default URL base: http://127.0.0.1:8515

HTTP

  • GET / → health + tool list
  • GET /health → health + cache/store stats

Tools

  • get_price
  • get_candles
  • get_last_candle
  • get_capabilities

Notes

Done

  • MCP surface mirrors crypto-mcp tool names where it makes sense.
  • get_price fetches live Swissquote quotes for metals like XAU.
  • An internal background poller keeps the server self-sufficient.
  • 5m candles are clock-aligned and persisted in SQLite.

Planned

  • Fill out get_indicator, get_market_snapshot, get_top_movers, and get_regime with real regime math.
  • Add retention cleanup for older candles.
  • Expand the watched pair set only if it proves useful for market orientation.

Design

  • The public surface should mirror crypto-mcp where practical.
  • Local default port is 8515.
  • Under the hood, the server uses Swissquote polling plus a local candle store.
  • The repo now contains a working scaffold and the first live price path.

Verification

./tests.sh
./run.sh

Housekeeping

  • ./killserver.sh stops stale listeners on the configured port
  • ./restart.sh chains kill and run