{
  "markdown": "# Lead Stampede MCP Server\n\nThe live backend that powers Lead Stampede Agent Cards. Exposes SMB business\ndata as tools that AI agents can call over HTTP.\n\n## What this is\n\nAn Express server that implements four MCP tools:\n\n| Tool | What it returns |\n| --- | --- |\n| `get_business_profile` | Name, description, industry, service area, contact info |\n| `get_services` | List of services + pricing summary |\n| `get_availability` | Hours + booking URL (or phone/email fallback) |\n| `get_reviews` | Review count, average rating, summary |\n\nEach request is authenticated via an `X-Agency-API-Key` header that maps to a\nrow in the `agencies` table in Supabase. Clients are scoped to their agency,\nso one agency can never read another's data.\n\n## Setup\n\n### 1. Install\n\n```bash\nnpm install\n```\n\n### 2. Configure environment\n\n```bash\ncp .env.example .env\n```\n\nThen edit `.env` and fill in:\n\n- `SUPABASE_URL` — your project URL (e.g. `https://xlhxnlhxeprtzwbyepza.supabase.co`)\n- `SUPABASE_SERVICE_ROLE_KEY` — from Supabase → Project Settings → API → `service_role` secret\n- `PORT` — defaults to 3000\n\n**Never commit `.env` to git.** It's already in `.gitignore`.\n\n### 3. Run locally\n\n```bash\nnpm run dev\n```\n\nYou should see:\n\n```\nLead Stampede MCP server listening on port 3000\n```\n\n## Testing it works\n\n### Health check (no auth)\n\n```bash\ncurl http://localhost:3000/health\n# → {\"status\":\"ok\",\"timestamp\":\"...\"}\n```\n\n### List available tools (auth required)\n\n```bash\ncurl -H \"X-Agency-API-Key: YOUR_AGENCY_API_KEY\" \\\n  http://localhost:3000/mcp/tools\n```\n\n### Call a tool\n\n```bash\ncurl -X POST \\\n  -H \"X-Agency-API-Key: YOUR_AGENCY_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"arguments\":{\"client_slug\":\"grandinetti-molinar-law\"}}' \\\n  http://localhost:3000/mcp/tools/get_business_profile\n```\n\nExpected response:\n\n```json\n{\n  \"tool\": \"get_business_profile\",\n  \"result\": {\n    \"business_name\": \"Grandinetti & Molinar Law\",\n    \"description\": \"Austin-based law firm founded in 2002...\",\n    \"industry\": \"legal\",\n    ...\n  },\n  \"response_ms\": 42\n}\n```\n\n## Deploying to Railway\n\n1. Push this folder to a new GitHub repo.\n2. In Railway: **New Project → Deploy from GitHub repo**.\n3. Select this repo.\n4. Under **Variables**, add:\n   - `SUPABASE_URL`\n   - `SUPABASE_SERVICE_ROLE_KEY`\n5. Railway auto-detects Node.js, installs deps, and runs `npm start`.\n6. Once deployed, Railway gives you a public URL like `mcp-production.up.railway.app`.\n7. Point a custom subdomain (e.g. `mcp.leadstampede.io`) at it via Railway → Settings → Domains.\n\n## Architecture\n\n```\nAI agent  →  POST /mcp/tools/:name  →  auth.js → tools.js → supabase.js\n                                         ↓\n                                   analytics.js (fire-and-forget)\n                                         ↓\n                                   mcp_tool_calls table\n```\n\n## Next steps\n\n- Build the Cloudflare Worker that serves Agent Cards at `agentcards.leadstampede.io/{slug}`.\n- Build the onboarding form that populates `clients` rows in Supabase.\n- Build the agency portal dashboard.\n",
  "bytes": 3061,
  "sha": "f8885686c8e1aa4aee33e392ca3bd9a02a4fa4ef217508540722a0c1a3d49174",
  "repo_slug": "treymerica1982/lead-stampede-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_treymerica1982_lead_stampede_93db89ba/readme"
}