StackQL MCP Server

io.github.stackql由 GitHub 帳號 stackql 發布v1.0.888更新於 Nov 5, 2026

SQL-native query and provisioning engine for cloud infrastructure, served over MCP.

概覽

AI 產生的概覽

StackQL MCP 讓助手以 SQL 查詢與配置 40 多個雲端與 SaaS 供應商的資源,並提供供應商、服務、資源與方法的階層式探索工具。

可以做什麼
  • 探索供應商、服務、資源與方法,並檢視每個方法的輸入輸出契約
  • 依意圖搜尋精選查詢庫並產生已驗證的 SQL 範本
  • 對即時雲端與 SaaS API 執行唯讀 SELECT 查詢
  • 在伺服器模式允許時執行 INSERT、UPDATE、REPLACE、DELETE 變更與 EXEC 生命週期操作
  • 在不執行的情況下驗證 SELECT,並從設定的 env 檔重新載入供應商憑證
  • 回報伺服器版本、SQL 方言、登錄檔位置與運作模式
適用情境
適合需要以 SQL 而非各廠商專屬 API 檢視或變更雲端與 SaaS 基礎設施(AWS、Google、Azure、GitHub、Okta 等)的情境,也適合唯讀的跨雲稽核與 CI 檢查。
執行需求
以本機 stdio 程序執行,可透過 npm、PyPI、Docker、GitHub Action 或各平台 .mcpb 套件安裝。供應商憑證由維運人員在伺服器環境或 env 檔中設定,用戶端不提供憑證。需要連線至供應商 API 與供應商登錄檔的網路。
安裝前請注意
變更與生命週期工具會對雲端造成實際影響,並受伺服器模式限制;預設 safe 模式與 CI 的唯讀模式會加以約束。憑證存放於維運人員的 env 檔並在查詢時解析,設定不當可能帶來過大的雲端權限。pull_provider 會寫入本機供應商快取。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 StackQL MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Deploy, manage and query cloud resources and interact with APIs using SQL

The Universal Interface for the Agentic Era. Configuration-as-Data. Infrastructure-as-Context.

Read the docs »
Raise an Issue · Request a Feature · Developer Guide · BYO Providers

Contents
  1. About The Project
  2. MCP Server
  3. Installation
  4. Usage
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

StackQL is an open-source project built with Golang that allows you to create, modify and query the state of services and resources across different local and remote interfaces, using SQL semantics. Such interfaces canonically include, but are not limited to, cloud and SaaS providers (Google, AWS, Azure, Okta, GitHub, etc.).

[stackql-shell] [stackql-shell]

How it works

StackQL is a standalone application that can be used in client mode (via exec or shell) or accessed via a Postgres wire protocol client (psycopg2, etc.) using server mode (srv).

StackQL parses SQL statements and transpiles them into API requests to the (cloud) resource provider. The API calls are then executed and the results are returned to the user.

StackQL provider interfaces are canonically defined in OpenAPI extensions to the providers' specification. These definitions are then used to generate the SQL schema and the API client. The source for the provider definitions are stored in the StackQL Registry. The semantics of provider interactions are defined in our any-sdk library. For more detail on nuts and bolts, please see the local AGENTS.md file and that of any-sdk.

StackQL Context Diagram
The following context diagram describes the StackQL architecture at a high level:
mermaid
flowchart LR  subgraph StackQL    direction BT    subgraph ProviderDefs        Registry[Provider Registry Docs]        end    subgraph App        Proc[$ stackql exec\n$ stackql shell\n$ stackql srv]        style Proc fill:#000,stroke:#000,color:#fff,text-align:left;
        %% ,font-family:'Courier New', Courier, monospace    end  end  User((User)) <--> StackQL <--> Provider[Cloud Provider API]  ProviderDefs --> App

More detailed design documentation can be found in the here.

MCP Server

StackQL is an MCP server - SQL over 40+ cloud and SaaS providers for AI agents. Point any MCP-capable client (Claude, VS Code, Cursor, etc.) at StackQL and it can query and provision cloud resources using SQL.

Run it over stdio:

sh
stackql mcp --mcp.server.type=stdio

StackQL MCP is published to the Official MCP Registry as io.github.stackql/stackql-mcp and distributed via npm, PyPI, Docker, a GitHub Action and .mcpb bundles. Pick an install vector and add the matching block to your MCP client config:

npm (npx)
json
{  "mcpServers": {    "stackql": {      "command": "npx",      "args": ["-y", "@stackql/mcp-server"]    }  }}
PyPI (uvx)
json
{  "mcpServers": {    "stackql": {      "command": "uvx",      "args": ["stackql-mcp-server"]    }  }}
Docker
json
{  "mcpServers": {    "stackql": {      "command": "docker",      "args": ["run", "-i", "--rm", "stackql/stackql-mcp"]    }  }}
.mcpb bundle

Download the bundle for your platform from the latest release and install it in your MCP client (one-click in clients that support .mcpb).

  • stackql-mcp-linux-x64.mcpb
  • stackql-mcp-linux-arm64.mcpb
  • stackql-mcp-windows-x64.mcpb
  • stackql-mcp-darwin-universal.mcpb
GitHub Actions

Wire StackQL MCP into agentic CI workflows. Defaults to read_only mode, the safe default for CI.

yaml
- uses: stackql/setup-stackql-mcp@v1  with:    mode: read_only

For client-specific setup, authentication and server modes, see the full MCP install and usage docs.

Installation

StackQL is available for Windows, MacOS, Linux, Docker, GitHub Actions and more. See the installation instructions below for your platform.

Installing on MacOS
  • Homebrew (amd64 and arm64)
    • brew install stackql or brew tap stackql/tap && brew install stackql/tap/stackql
  • MacOS PKG Installer (amd64 and arm64)
Installing on Windows
  • MSI Installer
  • Chocolatey
  • ZIP Archive
    • download the latest Windows ZIP archive for StackQL
    • extract the archive (code signed stackql.exe file) to a directory of your choice
    • add the directory to your PATH environment variable (optional)
Installing on Linux
  • ZIP Archive
    • download the latest Linux ZIP archive for StackQL
      • or via curl -L https://bit.ly/stackql-zip -O && unzip stackql-zip
    • extract the archive (stackql file) to a directory of your choice
    • add the directory to your PATH environment variable (optional)
Getting StackQL from DockerHub

View all available StackQL images on DockerHub. Images available include stackql, stackql-jupyter-demo and more. Pull the latest StackQL base image using:

bash
docker pull stackql/stackql

Want findings, not infrastructure? Run a read-only cross-cloud security & FinOps audit with the standard image in one command — see the Docker audit quickstart.

Using StackQL with GitHub Actions

Use StackQL in your GitHub Actions workflows to automate cloud infrastructure provisioning, IaC assurance, or compliance/security. Available GitHub Actions include: setup-stackql, stackql-exec and more

Usage

Caller authentication and permissions: configuration and four tested walkthroughs.

StackQL can be used via the interactive REPL shell, or via the exec command or ran as a server using the Postgres wire protocol.

ℹ️ StackQL does not require or install a database.

  • Interactive Shell

    sh
    # run interactive stackql queriesstackql shell --auth="${AUTH}"
  • Execute a statement or file

    sh
    stackql exec --auth="${AUTH}" -i myscript.iql --iqldata vars.jsonnet --output json
    # or
    stackql exec --auth="${AUTH}" "SELECT id, status FROM aws.ec2.instances WHERE region = 'us-east-1'"

    ℹ️ output options of json, csv, table and text are available for the exec command using the --output flag

    ℹ️ StackQL supports passing parameters using jsonnet or json, see Using Variables

  • Server

    sh
    # serve client requests over the Postgres wire protocol (psycopg2, etc.) # clients are not authenticated unless mTLS is configured via --pgsrv.tls, so keep the listener on loopback otherwisestackql srv --pgsrv.address=127.0.0.1 --auth="${AUTH}"

For more examples, please check our Blog

Contributing

Contributions are welcome and encouraged. For more information on how to contribute, please see our contributing guide.

License

Distributed under the MIT License. See LICENSE for more information. Licenses for third party software we are using are included in the /docs/licenses directory.

Contact

Get in touch with us via Twitter at @stackql, email us at [email protected] or start a conversation using discussions.

Acknowledgements

Forks of the following support our work:

We gratefully acknowledge these pieces of work.

來源:README.md,提交 610fc4c

工具

15

describe_method

Describe Method

Full I/O contract for one method: every input with its param_type (input_required params become exact-match WHERE predicates; input_optional ones may be added) and every output field, which are the columns a SELECT or RETURNING can reference. Call it after list_methods and before the first query against a method; there is no resource-level equivalent because each method returns its own shape. Requires provider, service, resource, method.

輸入參數formatmethodserviceproviderresourcerow_limit

list_methods

List Methods

Access methods for a resource with their SQL verb and required params. Pick the method whose verb matches the intent and whose required params you can supply, then describe_method it. Call when composing SQL from scratch against an unfamiliar resource; not needed when executing a vetted query library template. Requires provider, service, resource.

輸入參數formatmethodserviceproviderresourcerow_limit

list_providers

List Providers

Available cloud/SaaS providers (top of the hierarchy). No inputs.

無需輸入參數。

list_registry

List Registry Providers

Providers (and their versions) available in the configured registry. Distinct from list_providers, which lists only providers already pulled. Optional provider arg lists versions for that provider.

輸入參數formatversionprovider

list_resources

List Resources

Resources under a provider.service. Requires provider and service.

輸入參數formatmethodserviceproviderresourcerow_limit

list_services

List Services

Services under a provider. Requires provider.

輸入參數formatmethodserviceproviderresourcerow_limit

pull_provider

Pull Provider

Install a single provider from the registry into the local approot cache. Requires provider; version is optional (latest published is pulled when empty). Writes only local cache state; no cloud control/data plane effect.

輸入參數formatversionprovider

query_library_get

Get Query Library Entry

Retrieve a query library entry by id. Without params: returns the raw template, param declarations and notes (adapt from it when no exact match exists). With params: the server validates values and returns rendered SQL plus which tool to execute it with (run_select_query or run_mutation_query). Read-only, no credentials.

輸入參數id必填formatparams

reload_credentials

Reload Credentials

Live-reload provider credentials: re-sources the server's configured env file into the process environment, invalidates cached auth contexts, and reports resolution status for every installed provider (optional provider arg filters the report; changed field flags values that differ from before). Never returns secret values. Credentials resolve automatically at query time - never call this at session start or before queries. Call only after a query fails with a credential resolution error (fix the env file first, then reload, then retry) or when the user says credentials have been rotated or changed. If the report shows changed: false after a failure, the file was not updated - ask the user rather than retrying.

輸入參數formatprovider

run_lifecycle_operation

Run Lifecycle Operation

Execute a stackql EXEC lifecycle operation (eg EXEC aws.ec2.instances.start_instances ...). Real cloud side effects. Discover available operations and required params via list_methods and describe_method. Returns {messages, timestamp}. Gated by server mode.

輸入參數sql必填formatsourcerow_limit

run_mutation_query

Run Mutation Query

Execute INSERT/UPDATE/REPLACE/DELETE against the provider. Real side effects. Returns {messages, timestamp}. Gated by server mode. Consult query_library_search for a vetted template before composing SQL from scratch; when the SQL came from a library entry, pass its id as source.

輸入參數sql必填formatsourcerow_limit

run_select_query

Run SELECT Query

Execute a SELECT. Returns {rows}. Reads only; INSERT, UPDATE, DELETE and EXEC are refused in every mode. Consult query_library_search for a vetted template before composing SQL from scratch; when the SQL came from a library entry, pass its id as source.

輸入參數sql必填formatsourcerow_limit

server_info

Server Info

Get server identity and runtime: stackql version, backing SQL engine, provider registry location, mode, read-only flag. Call on demand - eg to diagnose a refused/gated operation or check version-specific behavior. Not needed at session start or before queries.

無需輸入參數。

validate_select_query

Validate SELECT Query

Parse and plan a SELECT without executing; the provider's credentials must still resolve, as for execution. Returns {valid, errors}. Use when iterating on syntax or plan errors, or pre-flighting complex/expensive queries - don't validate routinely; run_select_query surfaces the same errors.

輸入參數sql必填formatsourcerow_limit

版本歷史

6
  1. v1.0.888最新Nov 5, 2026
  2. v0.12.824Oct 22, 2026
  3. v0.12.778Oct 12, 2026
  4. v0.12.732Sep 30, 2026
  5. v0.12.718Sep 22, 2026
  6. v0.11.669Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分