Twinkle HubTwinkle Hub

Docs

10 分鐘接通

Twinkle Hub 是一個 MCP endpoint,任何 MCP client 都能接。下面分兩條路徑 — 看你比較像哪種人。

1. 取得 API key

/login → Google 或 GitHub 一鍵登入。第一次登入會自動發給你一支 LiteLLM virtual API key (`sk-...`)。Alpha 階段預設餘額 0,要儲值才能呼叫 — 先聯繫管理員人工加值 (M3b 上線 NewebPay 後可以信用卡自助儲值)。

2. Claude Desktop(最快路徑)

直接把下面這段對話貼給 Claude Desktop,它會幫你修設定檔:

text
幫我把 Twinkle Hub 加到 Claude Desktop(編輯
~/Library/Application Support/Claude/claude_desktop_config.json,
Windows 是 %APPDATA%\Claude\claude_desktop_config.json)。

加入這段:
{
  "mcpServers": {
    "twinkle-hub": {
      "type": "http",
      "url": "https://api.twinkleai.tw/mcp/",
      "headers": {
        "Authorization": "Bearer 我等下從 https://hub.twinkleai.tw/dashboard 給你貼"
      }
    }
  }
}

如果原本就有 mcpServers 區塊,請保留並合併進去。
裝完請我重啟 Claude,然後測試列出新增的 5 個 opendata-* tools。

想自己改設定?編輯這個檔:

  • macOS:~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:%APPDATA%\Claude\claude_desktop_config.json
  • Linux:~/.config/Claude/claude_desktop_config.json
text
{
  "mcpServers": {
    "twinkle-hub": {
      "type": "http",
      "url": "https://api.twinkleai.tw/mcp/",
      "headers": {
        "Authorization": "Bearer sk-..."
      }
    }
  }
}

記得把 sk-... 換成你dashboard 上看到的 key。重啟 Claude 後,5 個 opendata-* tool 就會出現。

3. Cursor

Cursor 用的是 ~/.cursor/mcp.json, 格式跟 Claude Desktop 一樣:

text
{
  "mcpServers": {
    "twinkle-hub": {
      "type": "http",
      "url": "https://api.twinkleai.tw/mcp/",
      "headers": {
        "Authorization": "Bearer sk-..."
      }
    }
  }
}

編輯完之後,Cursor 內 Settings → MCP → 點 Twinkle Hub 旁邊的 reload。

4. Claude Code(CLI)

Claude Code 內建 claude mcp add 指令:

text
claude mcp add --transport http twinkle-hub https://api.twinkleai.tw/mcp/ \
  --header "Authorization: Bearer sk-..."

5. 裝完之後可以問什麼?

隨便挑一個問問看(中英文都通):

  • 查一下臺北市最近 30 天的 PM2.5 紀錄,畫個趨勢圖→ environment domain
  • 列出某地段的不動產實價登錄,超過 5000 萬的→ realestate_land domain
  • 幫我整理今年公開的政府採購案前 10 大金額→ procurement domain

/catalog 有完整 19 個 domain 的 scope 與典型問題。

6. 計費

Tool每次用途
opendata-list_domains$0.0005列出 19 個 domain(給 Claude 用來規劃)
opendata-search_datasets$0.001在 domain 內找 dataset
opendata-get_dataset$0.001拿一個 dataset 的 metadata + schema
opendata-query_rows$0.005下 SQL-like filter 拿資料列
opendata-materialize_dataset$0.010整個 dataset 物化(大筆)

每 call 完幾秒內就能在 /usage 看到。儲值用完 LiteLLM 自動 reject — 不會跳意外帳單。