Spaces:
Running
counts: bind every published number to canon; the facilities figure was an over-claim
Browse filesThis Space published "21,900+ data-center facilities" while DC Hub's own
citation-safe floor was 20,400+ (live measurement 20,519). Canon floors DOWN and
is never above reality, so this was ~1,400 ABOVE the number the platform is
willing to stand behind — on a CC-BY-4.0 surface built to be cited, in the MCP
tool schema an agent reads. Every other stale count here was in the safe
direction; that one was not.
Also stale: 74 tools (live 83), 311 markets (live 327 — and 311 is the exact
figure backend canon documents as wrong, having counted score ROWS rather than
scored markets), 1,400+ deals (live 2,107). "4,900+ verified" is dropped: it
maps to no field canon publishes, so it could not be verified at all.
All 14 typed counts now resolve from /api/v1/canon/phrases through _canon(),
cached for an hour. app.py already spoke to that API, so this reuses the client
it had rather than adding one.
FAIL-OPEN IS THE POINT. An unreadable canon yields "" for every phrase and the
copy renders COUNT-FREE, never with a fallback literal — a missing number is
visible and self-correcting, a stale one is neither. Verified by pointing API at
a dead host: hero chips drop out cleanly, "(83 tools; 10 calls/day...)" becomes
"(10 calls/day...)", and the accordion sentence stays grammatical. No mangled
prose, no empty chips, no "( calls/day".
Two deliberate exceptions:
- TOOL DOCSTRINGS state no count. They are the MCP schema, they are read once
at import, and a network call in the import path is its own defect.
- HERO and the connect snippet became functions. As module-level f-strings
they would have resolved canon at IMPORT, freezing the boot value; they now
build when the UI does.
The README is static and cannot resolve canon, so its counts are canon's floors
as of this commit, and it now says so and points readers at the endpoint.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@@ -20,19 +20,19 @@ short_description: Live data-center power index + MCP server for AI agents
|
|
| 20 |
|
| 21 |
# ⚡ DC Hub — Power Index (live demo + MCP server)
|
| 22 |
|
| 23 |
-
**Can you actually get power to build a data center here?** DC Hub scores
|
| 24 |
|
| 25 |
The headline today: the three biggest markets — **Northern Virginia, Phoenix, and Columbus all score AVOID** (Northern Virginia is a modeled ~60-month wait for firm power), while build-ready capacity has shifted to the interior — **Cheyenne, Omaha, and Tulsa score BUILD**. Try it above.
|
| 26 |
|
| 27 |
## 🔌 Connect in 30 seconds
|
| 28 |
|
| 29 |
-
This Space **is an MCP server** (7 tools). The full DC Hub MCP has **
|
| 30 |
|
| 31 |
```bash
|
| 32 |
# This Space (7 tools, free)
|
| 33 |
claude mcp add --transport sse dchub-power-index https://dchubcloud-dchub.hf.space/gradio_api/mcp/sse
|
| 34 |
|
| 35 |
-
# Full DC Hub MCP (
|
| 36 |
claude mcp add --transport http dchub https://dchub.cloud/mcp
|
| 37 |
```
|
| 38 |
|
|
@@ -65,11 +65,13 @@ with MCPClient({"url": "https://dchubcloud-dchub.hf.space/gradio_api/mcp/sse"})
|
|
| 65 |
| `dcpi_score` | DCPI verdict + score + time-to-power for one U.S. market |
|
| 66 |
| `compare_markets` | Several markets ranked by power availability |
|
| 67 |
| `grid_scoreboard` | Live ranked grids (fuel mix, renewable share, demand) |
|
| 68 |
-
| `search_facilities` | Facility search across
|
| 69 |
| `rank_markets` | Markets ranked by capacity, power cost, operators, speed |
|
| 70 |
| `interconnection_queue` | US interconnection-queue capacity, per ISO |
|
| 71 |
-
| `hyperscaler_deals` | Recent hyperscaler / AI-capex deals (
|
| 72 |
|
| 73 |
-
## Want all
|
| 74 |
|
| 75 |
-
Connect the full server — **`https://dchub.cloud/mcp`** —
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# ⚡ DC Hub — Power Index (live demo + MCP server)
|
| 22 |
|
| 23 |
+
**Can you actually get power to build a data center here?** DC Hub scores 300+ data-center markets worldwide on power availability — a 0–100 index with a **BUILD / CAUTION / AVOID** verdict, average power cost, and a modeled time-to-power. Live from [dchub.cloud](https://dchub.cloud).
|
| 24 |
|
| 25 |
The headline today: the three biggest markets — **Northern Virginia, Phoenix, and Columbus all score AVOID** (Northern Virginia is a modeled ~60-month wait for firm power), while build-ready capacity has shifted to the interior — **Cheyenne, Omaha, and Tulsa score BUILD**. Try it above.
|
| 26 |
|
| 27 |
## 🔌 Connect in 30 seconds
|
| 28 |
|
| 29 |
+
This Space **is an MCP server** (7 tools). The full DC Hub MCP has **83 tools** — 10 calls/day free, no key needed.
|
| 30 |
|
| 31 |
```bash
|
| 32 |
# This Space (7 tools, free)
|
| 33 |
claude mcp add --transport sse dchub-power-index https://dchubcloud-dchub.hf.space/gradio_api/mcp/sse
|
| 34 |
|
| 35 |
+
# Full DC Hub MCP (83 tools)
|
| 36 |
claude mcp add --transport http dchub https://dchub.cloud/mcp
|
| 37 |
```
|
| 38 |
|
|
|
|
| 65 |
| `dcpi_score` | DCPI verdict + score + time-to-power for one U.S. market |
|
| 66 |
| `compare_markets` | Several markets ranked by power availability |
|
| 67 |
| `grid_scoreboard` | Live ranked grids (fuel mix, renewable share, demand) |
|
| 68 |
+
| `search_facilities` | Facility search across DC Hub's 20,400+ facility index |
|
| 69 |
| `rank_markets` | Markets ranked by capacity, power cost, operators, speed |
|
| 70 |
| `interconnection_queue` | US interconnection-queue capacity, per ISO |
|
| 71 |
+
| `hyperscaler_deals` | Recent hyperscaler / AI-capex deals (2,100+ tracked) |
|
| 72 |
|
| 73 |
+
## Want all 83 tools?
|
| 74 |
|
| 75 |
+
Connect the full server — **`https://dchub.cloud/mcp`** — 83 tools over 20,400+ facilities in 170+ countries, real-time grid telemetry (US ISOs + EU + GB + Taiwan + Japan + South Korea + Brazil), fiber, gas, water, tax incentives, and deal intelligence. 10 calls/day free anonymous; mint a free key with its `claim_free_key` tool. Or explore with zero setup at [dchub.cloud/playground](https://dchub.cloud/playground). Data is CC-BY-4.0 for citation.
|
| 76 |
+
|
| 77 |
+
> **On the numbers.** Counts on this card are DC Hub's published citation-safe floors — they round DOWN from the live measurement and are never above it. The app above renders them live from [`/api/v1/canon/phrases`](https://dchub.cloud/api/v1/canon/phrases); this card is static, so treat that endpoint as the source of truth.
|
|
@@ -5,10 +5,17 @@ A live demo of the DC Hub Power Index (DCPI) that ALSO runs as an MCP server
|
|
| 5 |
can query it. Seven tools: the two DCPI classics (dcpi_score, compare_markets)
|
| 6 |
plus five bridge tools (grid scoreboard, facility search, market ranking,
|
| 7 |
interconnection queue, hyperscaler deals) forwarded to DC Hub's canonical MCP
|
| 8 |
-
server. The complete DC Hub MCP —
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
Optional Space secret DCHUB_API_KEY (a dchub_ key) lifts the bridge tools to
|
| 14 |
full-tier responses; without it they ride the anonymous free tier.
|
|
@@ -20,6 +27,7 @@ never mint a duplicate MCP tool.
|
|
| 20 |
"""
|
| 21 |
import json
|
| 22 |
import os
|
|
|
|
| 23 |
import uuid
|
| 24 |
|
| 25 |
import requests
|
|
@@ -32,6 +40,58 @@ TIMEOUT = 20
|
|
| 32 |
API_KEY = (os.environ.get("DCHUB_API_KEY") or "").strip()
|
| 33 |
UA = "huggingface-space-dchub-bridge/1.0 (+https://dchub.cloud)"
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
def _verdict(score):
|
| 37 |
try:
|
|
@@ -78,7 +138,7 @@ def dcpi_score(market: str) -> str:
|
|
| 78 |
f"- Excess-power headroom: {d.get('excess_power_score', '?')}/100 · "
|
| 79 |
f"grid constraint: {d.get('constraint_score', '?')}/100\n\n"
|
| 80 |
f"_Modeled estimate from public ISO/EIA/queue data · DC Hub (dchub.cloud) · CC-BY-4.0._\n\n"
|
| 81 |
-
f"_Full grid headroom, interconnection queue, fiber
|
| 82 |
)
|
| 83 |
except Exception as e:
|
| 84 |
return f"DC Hub lookup failed ({e}). Query the full live MCP at {FULL_MCP}."
|
|
@@ -110,7 +170,7 @@ def compare_markets(markets: str) -> str:
|
|
| 110 |
for s, name, cost, ttp in rows:
|
| 111 |
ttp_s = f"~{int(ttp)}mo" if isinstance(ttp, (int, float)) else "n/a"
|
| 112 |
out.append(f"- {_verdict(s)} **{name}** — {s}/100 · {cost}¢/kWh · {ttp_s} to power")
|
| 113 |
-
out.append(f"\n_Full ranking across
|
| 114 |
return "\n".join(out)
|
| 115 |
|
| 116 |
|
|
@@ -166,7 +226,7 @@ def grid_scoreboard() -> str:
|
|
| 166 |
def search_facilities(query: str = "", country: str = "", state: str = "",
|
| 167 |
operator: str = "", min_capacity_mw: float = 0,
|
| 168 |
limit: int = 10) -> str:
|
| 169 |
-
"""Search DC Hub's index of
|
| 170 |
verified) across 170+ countries.
|
| 171 |
|
| 172 |
Args:
|
|
@@ -207,7 +267,7 @@ def interconnection_queue(iso: str = "") -> str:
|
|
| 207 |
|
| 208 |
|
| 209 |
def hyperscaler_deals(limit: int = 10) -> str:
|
| 210 |
-
"""Recent hyperscaler / AI-capex deals from DC Hub's
|
| 211 |
|
| 212 |
Args:
|
| 213 |
limit: Number of recent deals to return.
|
|
@@ -259,29 +319,35 @@ CSS = """
|
|
| 259 |
.dc-mcp-note { font-size: .9rem; margin: 2px 0 8px; }
|
| 260 |
"""
|
| 261 |
|
| 262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
<div class="dc-hero">
|
| 264 |
<h1><span class="amp">⚡</span> DC Hub — Power Index</h1>
|
| 265 |
<p class="sub"><strong>Can you actually get power to build a data center here?</strong>
|
| 266 |
-
Live 0–100 power-availability scores for
|
| 267 |
power cost, and modeled time-to-power — from <a href="https://dchub.cloud">dchub.cloud</a>.</p>
|
| 268 |
<div class="dc-chips">
|
| 269 |
<span class="dc-chip build">🟢 BUILD ≥ 60</span>
|
| 270 |
<span class="dc-chip caution">🟡 CAUTION 30–59</span>
|
| 271 |
<span class="dc-chip avoid">🔴 AVOID < 30</span>
|
| 272 |
-
|
| 273 |
-
<span class="dc-chip">21,900+ facilities · 4,900+ verified</span>
|
| 274 |
-
<span class="dc-chip">live grid telemetry</span>
|
| 275 |
-
<span class="dc-chip">1,400+ tracked deals</span>
|
| 276 |
-
<span class="dc-chip">CC-BY-4.0</span>
|
| 277 |
</div>
|
| 278 |
</div>
|
| 279 |
"""
|
| 280 |
|
| 281 |
-
|
|
|
|
|
|
|
|
|
|
| 282 |
claude mcp add --transport sse dchub-power-index {SPACE_MCP}
|
| 283 |
|
| 284 |
-
# Full DC Hub MCP
|
| 285 |
claude mcp add --transport http dchub {FULL_MCP}"""
|
| 286 |
|
| 287 |
JSON_SNIPPET = f"""{{
|
|
@@ -302,21 +368,21 @@ with MCPClient({{"url": "{SPACE_MCP}"}}) as tools:
|
|
| 302 |
with gr.Blocks(title="DC Hub — Power Index",
|
| 303 |
theme=gr.themes.Soft(primary_hue="amber", neutral_hue="slate"),
|
| 304 |
css=CSS) as demo:
|
| 305 |
-
gr.HTML(
|
| 306 |
|
| 307 |
with gr.Accordion("🔌 Connect via MCP — Claude Code · Claude Desktop · Cursor · smolagents",
|
| 308 |
open=False):
|
| 309 |
gr.Markdown(
|
| 310 |
f"<p class='dc-mcp-note'>This Space <strong>is an MCP server</strong> "
|
| 311 |
f"(7 tools) at <code>{SPACE_MCP}</code>. The full DC Hub MCP — "
|
| 312 |
-
f"
|
| 313 |
f"water, tax incentives, deal intelligence — is at "
|
| 314 |
f"<code>{FULL_MCP}</code> (10 calls/day free anonymous; mint a free "
|
| 315 |
f"key with its <code>claim_free_key</code> tool, or try it with zero "
|
| 316 |
f"setup at <a href='https://dchub.cloud/playground'>dchub.cloud/playground</a>).</p>")
|
| 317 |
with gr.Tabs():
|
| 318 |
with gr.Tab("Claude Code"):
|
| 319 |
-
gr.Code(
|
| 320 |
with gr.Tab("Desktop · Cursor"):
|
| 321 |
gr.Code(JSON_SNIPPET, language="json", label="mcp config (JSON) — any MCP client")
|
| 322 |
with gr.Tab("smolagents"):
|
|
@@ -361,7 +427,7 @@ with gr.Blocks(title="DC Hub — Power Index",
|
|
| 361 |
s_m = gr.Number(label="Min capacity (MW)", value=0)
|
| 362 |
s_l = gr.Number(label="Limit", value=10)
|
| 363 |
sout = gr.Code(language="json", label="facilities")
|
| 364 |
-
gr.Button("Search
|
| 365 |
search_facilities, [s_q, s_c, s_s, s_o, s_m, s_l], sout)
|
| 366 |
with gr.Tab("📊 Rank markets"):
|
| 367 |
with gr.Row():
|
|
@@ -382,7 +448,7 @@ with gr.Blocks(title="DC Hub — Power Index",
|
|
| 382 |
interconnection_queue, [q_i], qout)
|
| 383 |
with gr.Tab("💸 Hyperscaler deals"):
|
| 384 |
d_l = gr.Number(label="Limit", value=10,
|
| 385 |
-
info="Most recent hyperscaler / AI-capex deals from the
|
| 386 |
dout = gr.Code(language="json", label="deals")
|
| 387 |
gr.Button("Recent AI-capex deals", variant="primary").click(
|
| 388 |
hyperscaler_deals, [d_l], dout)
|
|
|
|
| 5 |
can query it. Seven tools: the two DCPI classics (dcpi_score, compare_markets)
|
| 6 |
plus five bridge tools (grid scoreboard, facility search, market ranking,
|
| 7 |
interconnection queue, hyperscaler deals) forwarded to DC Hub's canonical MCP
|
| 8 |
+
server. The complete DC Hub MCP — every facility, market and deal in the
|
| 9 |
+
index, plus real-time grid telemetry, fiber and gas — lives at
|
| 10 |
+
https://dchub.cloud/mcp. Connect that for the full dataset (10 calls/day free
|
| 11 |
+
anonymous; free key via its claim_free_key tool).
|
| 12 |
+
|
| 13 |
+
★ COUNTS ARE NOT TYPED IN THIS FILE. They resolve from DC Hub's canon endpoint
|
| 14 |
+
(/api/v1/canon/phrases) via _canon() below, because a typed count here rots
|
| 15 |
+
silently: this Space shipped a facilities figure ABOVE canon's citation-safe
|
| 16 |
+
floor — an OVER-claim, the one direction a floored count must never take. Docstrings are the exception and state no count at all: they are
|
| 17 |
+
the MCP tool schema, they are read once at import, and a network call in the
|
| 18 |
+
import path is its own defect.
|
| 19 |
|
| 20 |
Optional Space secret DCHUB_API_KEY (a dchub_ key) lifts the bridge tools to
|
| 21 |
full-tier responses; without it they ride the anonymous free tier.
|
|
|
|
| 27 |
"""
|
| 28 |
import json
|
| 29 |
import os
|
| 30 |
+
import time
|
| 31 |
import uuid
|
| 32 |
|
| 33 |
import requests
|
|
|
|
| 40 |
API_KEY = (os.environ.get("DCHUB_API_KEY") or "").strip()
|
| 41 |
UA = "huggingface-space-dchub-bridge/1.0 (+https://dchub.cloud)"
|
| 42 |
|
| 43 |
+
# ── Canon-derived public counts ────────────────────────────────────────────
|
| 44 |
+
# DC Hub publishes its own citation-safe floors at /api/v1/canon/phrases. They
|
| 45 |
+
# are floored DOWN from the live measurement and are never above reality, which
|
| 46 |
+
# is exactly the property a public, CC-BY-4.0 surface needs.
|
| 47 |
+
#
|
| 48 |
+
# Fail-open by construction: an unreadable canon yields "" for every phrase and
|
| 49 |
+
# the copy renders COUNT-FREE. That asymmetry is deliberate — a missing number
|
| 50 |
+
# is visible and self-correcting, a stale one is neither.
|
| 51 |
+
_CANON_TTL = 3600
|
| 52 |
+
_CANON_TIMEOUT = 6 # short: this runs once at Space boot, before the UI
|
| 53 |
+
_canon_cache = {"at": 0.0, "val": {}}
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def _canon():
|
| 57 |
+
"""Live public floors: {'facilities','deals','markets','tools'} or {}."""
|
| 58 |
+
now = time.time()
|
| 59 |
+
if _canon_cache["val"] and (now - _canon_cache["at"]) < _CANON_TTL:
|
| 60 |
+
return _canon_cache["val"]
|
| 61 |
+
try:
|
| 62 |
+
r = requests.get(f"{API}/api/v1/canon/phrases",
|
| 63 |
+
timeout=_CANON_TIMEOUT, headers={"User-Agent": UA})
|
| 64 |
+
d = r.json() if r.ok else {}
|
| 65 |
+
val = {k: str(d[k]) for k in ("facilities", "deals", "markets", "tools")
|
| 66 |
+
if d.get(k)}
|
| 67 |
+
except Exception:
|
| 68 |
+
val = {}
|
| 69 |
+
if val:
|
| 70 |
+
_canon_cache.update(at=now, val=val)
|
| 71 |
+
return _canon_cache["val"]
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def _phrase(key, noun):
|
| 75 |
+
"""'20,400+ facilities', or '' when canon cannot be read.
|
| 76 |
+
|
| 77 |
+
Callers must tolerate the empty string — that is the whole point. Build
|
| 78 |
+
sentences so an absent phrase leaves them grammatical, never mangled.
|
| 79 |
+
"""
|
| 80 |
+
v = _canon().get(key)
|
| 81 |
+
return f"{v} {noun}" if v else ""
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def _tools_clause():
|
| 85 |
+
"""' + 83 tools', or '' — a clause that may vanish without breaking prose."""
|
| 86 |
+
p = _phrase("tools", "tools")
|
| 87 |
+
return f" + {p}" if p else ""
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
def _tools_strong():
|
| 91 |
+
"""'<strong>83 tools</strong>, ' or '' — trailing comma travels with it."""
|
| 92 |
+
p = _phrase("tools", "tools")
|
| 93 |
+
return f"<strong>{p}</strong>, " if p else ""
|
| 94 |
+
|
| 95 |
|
| 96 |
def _verdict(score):
|
| 97 |
try:
|
|
|
|
| 138 |
f"- Excess-power headroom: {d.get('excess_power_score', '?')}/100 · "
|
| 139 |
f"grid constraint: {d.get('constraint_score', '?')}/100\n\n"
|
| 140 |
f"_Modeled estimate from public ISO/EIA/queue data · DC Hub (dchub.cloud) · CC-BY-4.0._\n\n"
|
| 141 |
+
f"_Full grid headroom, interconnection queue, fiber{_tools_clause()}: connect the DC Hub MCP → **{FULL_MCP}**._"
|
| 142 |
)
|
| 143 |
except Exception as e:
|
| 144 |
return f"DC Hub lookup failed ({e}). Query the full live MCP at {FULL_MCP}."
|
|
|
|
| 170 |
for s, name, cost, ttp in rows:
|
| 171 |
ttp_s = f"~{int(ttp)}mo" if isinstance(ttp, (int, float)) else "n/a"
|
| 172 |
out.append(f"- {_verdict(s)} **{name}** — {s}/100 · {cost}¢/kWh · {ttp_s} to power")
|
| 173 |
+
out.append(f"\n_Full ranking across {_phrase('markets', 'markets') or 'every scored market'}: DC Hub MCP → {FULL_MCP}._")
|
| 174 |
return "\n".join(out)
|
| 175 |
|
| 176 |
|
|
|
|
| 226 |
def search_facilities(query: str = "", country: str = "", state: str = "",
|
| 227 |
operator: str = "", min_capacity_mw: float = 0,
|
| 228 |
limit: int = 10) -> str:
|
| 229 |
+
"""Search DC Hub's global index of data-center facilities (many independently
|
| 230 |
verified) across 170+ countries.
|
| 231 |
|
| 232 |
Args:
|
|
|
|
| 267 |
|
| 268 |
|
| 269 |
def hyperscaler_deals(limit: int = 10) -> str:
|
| 270 |
+
"""Recent hyperscaler / AI-capex deals from DC Hub's deal tracker.
|
| 271 |
|
| 272 |
Args:
|
| 273 |
limit: Number of recent deals to return.
|
|
|
|
| 319 |
.dc-mcp-note { font-size: .9rem; margin: 2px 0 8px; }
|
| 320 |
"""
|
| 321 |
|
| 322 |
+
def _hero():
|
| 323 |
+
"""Built when the UI is constructed, so canon is read once per boot."""
|
| 324 |
+
_mk = _phrase("markets", "markets")
|
| 325 |
+
_fa = _phrase("facilities", "facilities")
|
| 326 |
+
_dl = _phrase("deals", "tracked deals")
|
| 327 |
+
_chips = "".join(
|
| 328 |
+
f'<span class="dc-chip">{c}</span>' for c in (_mk, _fa, "live grid telemetry", _dl, "CC-BY-4.0") if c)
|
| 329 |
+
return f"""
|
| 330 |
<div class="dc-hero">
|
| 331 |
<h1><span class="amp">⚡</span> DC Hub — Power Index</h1>
|
| 332 |
<p class="sub"><strong>Can you actually get power to build a data center here?</strong>
|
| 333 |
+
Live 0–100 power-availability scores for data-center markets worldwide, with a verdict,
|
| 334 |
power cost, and modeled time-to-power — from <a href="https://dchub.cloud">dchub.cloud</a>.</p>
|
| 335 |
<div class="dc-chips">
|
| 336 |
<span class="dc-chip build">🟢 BUILD ≥ 60</span>
|
| 337 |
<span class="dc-chip caution">🟡 CAUTION 30–59</span>
|
| 338 |
<span class="dc-chip avoid">🔴 AVOID < 30</span>
|
| 339 |
+
{_chips}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
</div>
|
| 341 |
</div>
|
| 342 |
"""
|
| 343 |
|
| 344 |
+
def _claude_code_snippet():
|
| 345 |
+
_t = _phrase("tools", "tools")
|
| 346 |
+
_full = f"({_t}; 10 calls/day free, no key needed)" if _t else "(10 calls/day free, no key needed)"
|
| 347 |
+
return f"""# This Space (7 tools, free)
|
| 348 |
claude mcp add --transport sse dchub-power-index {SPACE_MCP}
|
| 349 |
|
| 350 |
+
# Full DC Hub MCP {_full}
|
| 351 |
claude mcp add --transport http dchub {FULL_MCP}"""
|
| 352 |
|
| 353 |
JSON_SNIPPET = f"""{{
|
|
|
|
| 368 |
with gr.Blocks(title="DC Hub — Power Index",
|
| 369 |
theme=gr.themes.Soft(primary_hue="amber", neutral_hue="slate"),
|
| 370 |
css=CSS) as demo:
|
| 371 |
+
gr.HTML(_hero())
|
| 372 |
|
| 373 |
with gr.Accordion("🔌 Connect via MCP — Claude Code · Claude Desktop · Cursor · smolagents",
|
| 374 |
open=False):
|
| 375 |
gr.Markdown(
|
| 376 |
f"<p class='dc-mcp-note'>This Space <strong>is an MCP server</strong> "
|
| 377 |
f"(7 tools) at <code>{SPACE_MCP}</code>. The full DC Hub MCP — "
|
| 378 |
+
f"{_tools_strong()}real-time grid telemetry, fiber, gas, "
|
| 379 |
f"water, tax incentives, deal intelligence — is at "
|
| 380 |
f"<code>{FULL_MCP}</code> (10 calls/day free anonymous; mint a free "
|
| 381 |
f"key with its <code>claim_free_key</code> tool, or try it with zero "
|
| 382 |
f"setup at <a href='https://dchub.cloud/playground'>dchub.cloud/playground</a>).</p>")
|
| 383 |
with gr.Tabs():
|
| 384 |
with gr.Tab("Claude Code"):
|
| 385 |
+
gr.Code(_claude_code_snippet(), language="shell", label="terminal")
|
| 386 |
with gr.Tab("Desktop · Cursor"):
|
| 387 |
gr.Code(JSON_SNIPPET, language="json", label="mcp config (JSON) — any MCP client")
|
| 388 |
with gr.Tab("smolagents"):
|
|
|
|
| 427 |
s_m = gr.Number(label="Min capacity (MW)", value=0)
|
| 428 |
s_l = gr.Number(label="Limit", value=10)
|
| 429 |
sout = gr.Code(language="json", label="facilities")
|
| 430 |
+
gr.Button("Search facilities", variant="primary").click(
|
| 431 |
search_facilities, [s_q, s_c, s_s, s_o, s_m, s_l], sout)
|
| 432 |
with gr.Tab("📊 Rank markets"):
|
| 433 |
with gr.Row():
|
|
|
|
| 448 |
interconnection_queue, [q_i], qout)
|
| 449 |
with gr.Tab("💸 Hyperscaler deals"):
|
| 450 |
d_l = gr.Number(label="Limit", value=10,
|
| 451 |
+
info="Most recent hyperscaler / AI-capex deals from the DC Hub tracker.")
|
| 452 |
dout = gr.Code(language="json", label="deals")
|
| 453 |
gr.Button("Recent AI-capex deals", variant="primary").click(
|
| 454 |
hyperscaler_deals, [d_l], dout)
|