{
  "markdown": "# TroyStack API\n\nREST API + MCP Server for TroyStack. Provides live precious metals data, \nportfolio management, and AI/LLM integration.\n\n## Quick Start\n\n```bash\nnpm install\ncp .env.example .env  # fill in Supabase credentials\nnpm run dev\n```\n\n## Deploy to Railway\n\n1. Push to GitHub repo\n2. Connect repo in Railway dashboard\n3. Set environment variables:\n   - `SUPABASE_URL`\n   - `SUPABASE_SERVICE_ROLE_KEY`\n   - `PORT` (Railway sets automatically)\n4. Deploy\n\nCustom domain: `api.troystack.ai`\n\n## Database Setup\n\nRun `migrations/001_api_keys.sql` in Supabase SQL editor.\n\n## Endpoints\n\n### Public (no auth)\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | `/v1/prices` | Live spot prices (Au, Ag, Pt, Pd) |\n| GET | `/v1/prices/history` | Historical prices |\n| GET | `/v1/market-intel` | News headlines |\n| GET | `/v1/vault-watch` | COMEX inventory |\n| GET | `/v1/speculation` | What-if projections |\n\n### Authenticated (Bearer token)\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | `/v1/portfolio` | Portfolio summary |\n| GET | `/v1/analytics` | Cost basis analysis |\n| GET | `/v1/holdings` | List holdings |\n| POST | `/v1/holdings` | Add purchase |\n\n### LLM / AI\n| Path | Description |\n|------|-------------|\n| `/llms.txt` | LLM-readable description |\n| `/openapi.json` | OpenAPI 3.0 spec |\n| `/.well-known/ai-plugin.json` | AI plugin manifest |\n| `/.well-known/mcp.json` | MCP server manifest |\n\n## Architecture\n\n```\nUser's iPhone → TroyStack app (local SQLite)\n                          ↕ sync\n                    Supabase (server-side storage)\n                          ↕\n                    TroyStack API (Railway)\n                      ↕         ↕\n                  AI Agents    X/Twitter Bot\n                (Claude, GPT)  (auto-tweets)\n```\n",
  "bytes": 1797,
  "sha": "8f7dc835b0019c23600f1e0c598a2d0b95c0c396c3333df214e2faa98ecfeb84",
  "repo_slug": "kingleosgold/troystack-api",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kingleosgold_troystack_ce82d6bf/readme"
}