# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: hs-sql-agent
spec:
    description: hs-sql-agent is an HTTP MCP server for relational databases with an integrated admin panel.
    coverImage: https://raw.githubusercontent.com/tse-wei-chen/hs-sql-agent/main/miscellaneous/coverImage.png
    icon: https://raw.githubusercontent.com/tse-wei-chen/hs-sql-agent/main/miscellaneous/logo.png
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Admin Panel Domain
          description: The custom domain for accessing the hs-sql-agent admin panel.
    tags:
        - MCP
        - MCP Server
        - SQL
        - PostgreSQL
        - SQL Agent
        - hs-sql-agent
    readme: |-
        # hs-sql-agent

        version: latest

        `hs-sql-agent` is an HTTP MCP server for relational databases with an integrated admin panel.
        It lets MCP clients call safe SQL tools while you manage access keys, audit logs, per-key database mapping, and global rate limits.

        ## How to Use

        ### First-time setup flow

        1. Deploy the template (you will need to enter a subdomain). Wait for the deployment to complete and the service to be running.
        2. Open the admin panel using the provided domain (shown in Zeabur Instructions).
        3. First run: create the first admin account.
        4. Sign in with that admin account.
        5. Go to Runtime MCP Keys page (`/runtime/mcp-keys`).
        6. Fill the form and click `Issue Key` to create a new MCP key.
        7. Copy the `One-time key value` immediately (it is only shown once).
        8. Paste that value into MCP client config headers: `"X-MCP-Server-Key": "<YOUR_MCP_KEY>"`.
        9. Replace `<YOUR_MCP_Endpoint>` with the actual MCP endpoint URL shown in Zeabur Instructions.

        ### Claude Desktop

        ```json
        {
          "mcpServers": {
            "hs-sql-agent": {
              "url": "<YOUR_MCP_Endpoint>",
              "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
            }
          }
        }
        ```

        ### VS Code

        ```json
        {
          "servers": {
            "hs-sql-agent": {
              "type": "http",
              "url": "<YOUR_MCP_Endpoint>",
              "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
            }
          }
        }
        ```

        ### Cursor

        ```json
        {
          "mcpServers": {
            "hs-sql-agent": {
              "type": "http",
              "url": "<YOUR_MCP_Endpoint>",
              "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
            }
          }
        }
        ```
    services:
        - name: hs-sql-agent
          icon: https://raw.githubusercontent.com/tse-wei-chen/hs-sql-agent/main/miscellaneous/logo.png
          template: PREBUILT_V2
          spec:
            source:
                image: ghcr.io/tse-wei-chen/hs-sql-agent:latest
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            instructions:
                - title: MCP Endpoint
                  content: ${ZEABUR_WEB_URL}/mcp
                - title: Admin Panel URL
                  content: ${ZEABUR_WEB_URL}
            env:
                AppConnectionString:
                    default: Data Source=hsqlagent.db
                    expose: false
                JwtSettings__AccessTokenExpirationMinutes:
                    default: "60"
                    expose: false
                JwtSettings__Audience:
                    default: ${PASSWORD}
                    expose: false
                JwtSettings__Issuer:
                    default: ${PASSWORD}
                    expose: false
                JwtSettings__RefreshTokenExpirationDays:
                    default: "30"
                    expose: false
                JwtSettings__SecretKey:
                    default: ${PASSWORD}
                    expose: false
                McpKeySettings__HmacSecretKey:
                    default: ${PASSWORD}
                    expose: false
                PORT:
                    default: ${WEB_PORT}
                    expose: false
                RateLimiting__PermitLimit:
                    default: "0"
                    expose: false
                RateLimiting__QueueLimit:
                    default: "0"
                    expose: false
                RateLimiting__WindowSeconds:
                    default: "0"
                    expose: false
          domainKey: PUBLIC_DOMAIN
localization:
    ja-JP:
        description: hs-sql-agent は、管理用コントロールパネルを内蔵した、リレーショナルデータベース向けの HTTP MCP サーバーです。
        readme: |-
            # hs-sql-agent

            version: latest

            `hs-sql-agent` は、管理用コントロールパネルを内蔵した、リレーショナルデータベース向けの HTTP MCP サーバーです。
            MCP クライアントから安全な SQL ツールを呼び出せる一方で、アクセスキー、監査ログ、キーごとのデータベースマッピング、グローバルなレート制限を管理できます。

            ## 利用手順

            ### 初回セットアップの流れ

            1. テンプレートをデプロイします（子ドメインの入力が必要です）。デプロイが完了し、サービスが起動するまで待ちます。
            2. 提供されたドメイン（Zeabur Instructions に表示）で管理パネルを開きます。
            3. 初回起動時に、最初の管理者アカウントを作成します。
            4. 作成した管理者アカウントでサインインします。
            5. Runtime MCP Keys ページ（`/runtime/mcp-keys`）へ移動します。
            6. フォームに入力し、`Issue Key` をクリックして新しい MCP キーを発行します。
            7. `One-time key value` をすぐにコピーします（この値は一度だけ表示されます）。
            8. MCP クライアントの設定ヘッダーにその値を貼り付けます: `"X-MCP-Server-Key": "<YOUR_MCP_KEY>"`。
            9. `<YOUR_MCP_Endpoint>` を Zeabur Instructions に表示される実際の MCP エンドポイント URL に置き換えます。

            ### Claude Desktop

            ```json
            {
              "mcpServers": {
                "hs-sql-agent": {
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```

            ### VS Code

            ```json
            {
              "servers": {
                "hs-sql-agent": {
                  "type": "http",
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```

            ### Cursor

            ```json
            {
              "mcpServers": {
                "hs-sql-agent": {
                  "type": "http",
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```
    zh-CN:
        description: hs-sql-agent 是一个面向关系型数据库的 HTTP MCP 服务器，集成了管理控制面板。
        readme: |-
            # hs-sql-agent

            version: latest

            `hs-sql-agent` 是一个面向关系型数据库的 HTTP MCP 服务器，集成了管理控制面板。
            它允许 MCP 客户端调用安全的 SQL 工具，同时您可以管理访问密钥、审计日志、每个密钥的数据库映射以及全局速率限制。

            ## 使用说明

            ### 首次设置流程

            1. 部署模板(需输入子域名)。等待部署完成并且服务运行。
            2. 使用提供的域名（在 Zeabur 使用说明中显示）打开管理面板。
            3. 首次运行：创建第一个管理员账户。
            4. 使用该管理员账户登录。
            5. 转到运行时 MCP 密钥页面（`/runtime/mcp-keys`）。
            6. 填写表单并点击 `Issue Key` 创建新的 MCP 密钥。
            7. 立即复制 `一次性密钥值`（只显示一次）。
            8. 将该值粘贴到 MCP 客户端配置头中：`"X-MCP-Server-Key": "<YOUR_MCP_KEY>"`。
            9. 将 `<YOUR_MCP_Endpoint>` 替换为 Zeabur 使用说明中显示的实际 MCP 端点 URL。

            ### Claude Desktop

            ```json
            {
              "mcpServers": {
                "hs-sql-agent": {
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```

            ### VS Code

            ```json
            {
              "servers": {
                "hs-sql-agent": {
                  "type": "http",
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```

            ### Cursor

            ```json
            {
              "mcpServers": {
                "hs-sql-agent": {
                  "type": "http",
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```
    zh-TW:
        description: hs-sql-agent 是一個針對關聯式資料庫所設計的 HTTP MCP 伺服器，並整合了管理控制面板。
        readme: |-
            # hs-sql-agent

            version: latest

            `hs-sql-agent` 是一個針對關聯式資料庫所設計的 HTTP MCP 伺服器，並整合了管理控制面板。
            它允許 MCP 客戶端調用安全的 SQL 工具，同時您可以管理訪問密鑰、審計日誌、每個密鑰的資料庫映射以及全局速率限制。

            ## 使用說明

            ### 首次設置流程

            1. 部署模板(需輸入子域名)。等待部署完成並且服務運行。
            2. 使用提供的域名（在 Zeabur 使用說明中顯示）打開管理面板。
            3. 首次運行：創建第一個管理員帳戶。
            4. 使用該管理員帳戶登錄。
            5. 轉到運行時 MCP 密鑰頁面（`/runtime/mcp-keys`）。
            6. 填寫表單並點擊 `Issue Key` 創建新的 MCP 密鑰。
            7. 立即複製 `一次性密鑰值`（只顯示一次）。
            8. 將該值粘貼到 MCP 客戶端配置頭中：`"X-MCP-Server-Key": "<YOUR_MCP_KEY>"`。
            9. 將 `<YOUR_MCP_Endpoint>` 替換為 Zeabur 使用說明中顯示的實際 MCP 端點 URL。

            ### Claude Desktop

            ```json
            {
              "mcpServers": {
                "hs-sql-agent": {
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```

            ### VS Code

            ```json
            {
              "servers": {
                "hs-sql-agent": {
                  "type": "http",
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```

            ### Cursor

            ```json
            {
              "mcpServers": {
                "hs-sql-agent": {
                  "type": "http",
                  "url": "<YOUR_MCP_Endpoint>",
                  "headers": { "X-MCP-Server-Key": "<YOUR_MCP_KEY>" }
                }
              }
            }
            ```
