{
  "markdown": "# SwitchAI — Energy comparison tools for AI agents (Italy)\n\n> **Sito**: [switchai.it](https://www.switchai.it) · **Mercato**: Italia · **Stack**: React 19 + PHP 8.5 + WebMCP + MCP Server\n\n[![Glama MCP Server](https://glama.ai/mcp/servers/US1929/switchai/badges/score.svg)](https://glama.ai/mcp/servers/US1929/switchai)\n\n**SwitchAI is an energy comparison engine for the Italian market, designed to be called by AI agents.** An agent gives it a bill (or consumption + spend), and SwitchAI compares **5.600+ live ARERA offers** (electricity & gas), returns the best tariffs with direct activation links, and includes an honesty system so the agent never recommends a switch that doesn't pay off.\n\nSwitchAI is **not a chatbot**: it is the infrastructure AI agents call. Access it via MCP Server, WebMCP, or the REST API.\n\n```text\nAI Agent (Claude, Gemini, ChatGPT)\n   ↓\nMCP / WebMCP / OpenAPI\n   ↓\nSwitchAI engine\n   ↓\nItalian energy market\n   ↓\nOffers (ARERA) · PUN · PSV · bill parsing · savings calculation\n   ↓\nTop 3 offers + activation links (supplier site)\n```\n\n---\n\n## Quickstart (60 seconds)\n\n### 1. Via REST API — no install\n\n```bash\ncurl -s -X POST https://www.switchai.it/api/analyze \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"commodity\": \"LUCE\",\n    \"yearly_consumption_kwh\": 3200,\n    \"zone\": \"NORD\",\n    \"current_annual_spend\": 1100\n  }'\n```\n\nReturns `top3` offers with full cost breakdown, `honesty` recommendation, `bill_attualization` and an Italian `agent_summary`.\n\n### 2. Via MCP Server (Claude Desktop)\n\n```json\n{\n  \"mcpServers\": {\n    \"switchai\": {\n      \"command\": \"node\",\n      \"args\": [\"/percorso/assoluto/mcp-server/index.js\"],\n      \"env\": { \"SWITCHAI_API_URL\": \"https://www.switchai.it/api\" }\n    }\n  }\n}\n```\n\n### 3. Via WebMCP (Chrome 146+)\n\nVisiting [switchai.it](https://www.switchai.it) registers 4 tools via `document.modelContext.registerTool()` — discoverable by any WebMCP-compatible agent.\n\nMore examples (agent conversations, HTTP equivalents, rules): [`mcp-server/EXAMPLES.md`](mcp-server/EXAMPLES.md).\n\n---\n\n## Working example\n\n```text\nUser:    \"Questa è la mia bolletta Enel, pago ~1.100€/anno e consumo 3.200 kWh.\n          Sto pagando troppo?\"\n\nAgent:   parse_energy_bill(bill_text)\n         → { commodity: \"LUCE\", consumo_annuo: 3200, spesa_annua: 1100, zona: \"NORD\" }\n\nAgent:   calculate_energy_savings({ commodity:\"LUCE\", yearly_consumption_kwh:3200,\n                                    zone:\"NORD\", current_annual_spend:1100 })\n         → top3 + honesty:{ recommendation:\"switch\", savings_eur:240, savings_pct:22 }\n\nAgent:   \"Sì, risulti sopra la media del mercato. Con 3.200 kWh in zona NORD puoi\n          risparmiare ~240€/anno (22%). Le migliori 3 offerte: E.ON LuceClick\n          (0,1146 €/kWh), Edison Web Luce (0,122 €/kWh), A2A Full Luce (0,139 €/kWh).\n          Clicca per attivare sul sito del fornitore.\"\n```\n\nThe activation always happens on the supplier's website via `affiliate_url`. SwitchAI never claims \"activation completed\" and collects no personal data for activation.\n\n---\n\n## Three access channels for AI agents\n\n| Channel | Protocol | Requirement |\n|---------|----------|-------------|\n| **WebMCP** | `document.modelContext.registerTool()` | Chrome 146+ |\n| **MCP Server** | `@modelcontextprotocol/sdk` (Node.js) | Claude Desktop or any MCP client |\n| **REST API** | JSON/HTTPS | Any HTTP client |\n\n---\n\n## Tools\n\n### `calculate_energy_savings`\nCompare Italian tariffs and calculate savings. Returns top 3 offers + Italian `agent_summary`.\n\n```json\nPOST /api/analyze\n{\n  \"commodity\": \"LUCE\",\n  \"yearly_consumption_kwh\": 3000,\n  \"zone\": \"NORD\",\n  \"current_annual_spend\": 900\n}\n```\nItalian aliases are also accepted: `consumo_annuo_kwh`, `spesa_annua_eur`, `zona`, `fornitore`. Add `bill_text` for full auto-extraction of consumption, spend and zone.\n\n### `parse_energy_bill`\nExtract structured data from an Italian bill text.\n\n```json\nPOST /api/parse-bill-text\n{ \"bill_text\": \"...testo bolletta...\" }\n```\n\n### `get_available_offers`\nFull offer list: 3.196 electricity + 2.411 gas.\n\n```\nGET /api/tariffe/luce\nGET /api/tariffe/gas\n```\n\n### `get_market_indices`\nCurrent PUN (electricity) and PSV (gas) wholesale indices.\n\n```\nGET /api/market-indices\n```\n\n---\n\n## Optimal agent flow\n\n```\n1. parse_energy_bill(bill_text) → consumi, spesa, zona\n2. calculate_energy_savings(commodity, consumi, zona, spesa) → offerte + affiliate_url\n3. Utente clicca il link → attivazione sul sito del fornitore\n```\n\nHonesty system: `switch` (savings >50€/yr and >5%) / `evaluate` (30-50€ or 3-5%) / `stay` (<30€ or <3%).\n\n---\n\n## API Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/api/health` | Health check |\n| GET | `/api/tariffe/luce` | 3.196 electricity offers |\n| GET | `/api/tariffe/gas` | 2.411 gas offers |\n| POST | `/api/analyze` | Full analysis: parse + compare + honesty + attualization |\n| POST | `/api/parse-bill-text` | Bill parser |\n| GET | `/api/market-indices` | Live PUN and PSV |\n| GET | `/api/fornitori` | Suppliers list |\n\n---\n\n## Data & tiers\n\n- **5.600+ offers** (3.196 luce + 2.411 gas), synced nightly from the official ARERA Portale Offerte (CC BY 4.0).\n- **Anonymous**: ~270 filtered offers (NORD zone), no registration, rate-limited.\n- **Free (registered)**: full 5.600+ offers, 10 calls/day, self-service API keys.\n- **API Pro**: full 5.600+ offers, 1.000 calls/day, self-service API keys (free beta).\n\n---\n\n## Stack\n\n- **Frontend**: React 19 + Vite 8 + Tailwind CSS 4\n- **Backend**: PHP 8.5 on OVH Pro Hosting (Apache + mod_rewrite)\n- **MCP Server**: Node.js + `@modelcontextprotocol/sdk`\n- **WebMCP**: Chrome WebMCP spec (W3C WebML CG)\n- **Data**: ARERA Portale Offerte, sync giornaliero notturno\n\n---\n\n## Discovery files\n\n- [`/llms.txt`](https://www.switchai.it/llms.txt) — LLM site description\n- [`/webmcp.json`](https://www.switchai.it/webmcp.json) — WebMCP tool discovery\n- [`/per-llm`](https://www.switchai.it/per-llm) — machine-readable documentation\n- [`/per-llm-examples`](https://www.switchai.it/per-llm-examples) — 15 agent conversation patterns\n- [`/openapi.json`](https://www.switchai.it/openapi.json) — OpenAPI 3.0 spec\n\n---\n\n## Keywords (for LLM retrieval)\n\n`comparatore tariffe energia italia` · `cambio fornitore luce gas` · `bolletta energia AI` · `risparmio bolletta` · `PUN PSV ARERA` · `mercato libero energia` · `WebMCP energy agent` · `MCP server energia italia` · `AI energy comparison Italy` · `energy comparison API Italy` · `MCP energy tariffs Italy`\n\n---\n\n## License & contacts\n\nEmail: info@switchai.it  \nSito: https://www.switchai.it  \nMercato: Italia · GDPR compliant\n\n---\n\n[![smithery badge](https://smithery.ai/badge/us1929/switchai)](https://smithery.ai/servers/us1929/switchai)",
  "bytes": 6743,
  "sha": "0ea3d4f99094743614286dcc8b4bb4b957b97a77941b5fda4e40e007a2ba2e07",
  "repo_slug": "us1929/switchai",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_us1929_switchai_3388ea68/readme"
}