salt-api-cli MCP server
2026년 11월 4일 커밋SaltStack 인프라 관리, 모듈 실행 및 minion key 관리를 위한 CLI와 MCP server를 제공합니다.
다른 이름 laurentL/salt-api-cli
- 스타
- 1
- Tools
- 12
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 4일
- 라이선스
- MIT
salt-api-cli MCP란?
salt-api-cli은(는) MCP server입니다. SaltStack 인프라 관리, 모듈 실행 및 minion key 관리를 위한 CLI와 MCP server를 제공합니다. 12개 도구를 제공합니다. 예: salt_list_profiles, salt_ping, salt_run.
프로젝트 README에서 생성된 요약
salt-api-cli MCP server 정보
salt-api-cli를 사용하면 AI agent를 통해 SaltStack 인프라를 관리할 수 있습니다. 이 도구는 Go 기반으로 제작되었으며 CLI와 전체 권한을 가진 MCP server를 모두 제공합니다. SaltStack의 netapi를 래핑하여 사용자가 rest_cherrypy 또는 rest_tornado를 통해 Salt Master와 상호작용할 수 있도록 돕습니다. 또한 설정 파일을 통해 운영(production)이나 스테이징(staging)과 같은 다양한 환경을 위한 여러 프로필을 지원합니다.
사용자는 mcp 명령어를 실행하여 stdio 기반의 서버를 시작함으로써 Claude Code, Cursor 또는 Gemini CLI와 같은 AI 클라이언트를 연결할 수 있습니다. 서버는 agent가 state 적용, master runner 실행, minion key 관리와 같은 복잡한 작업을 수행할 수 있도록 12개의 특정 도구를 노출합니다. 인증은 보안 로컬 파일에 토큰을 캐싱하여 처리하며, 환경 변수나 외부 secret 도구를 사용하여 자격 증명을 해결할 수 있습니다. 이러한 설정을 통해 AI 채팅 인터페이스에서 직접 자동화된 인프라 관리가 가능합니다.
활용 사례
- 1자동화된 인프라 상태 적용AI agent는 state apply 도구를 사용하여 대상 minion에 특정 Salt state 또는 highstate를 적용할 수 있습니다.
- 2Minion key 생명주기 관리개발자는 보안 유지를 위해 AI에게 minion key를 승인, 거부 또는 삭제하도록 지시할 수 있습니다.
- 3인프라 인벤토리 조사AI에게 알려진 모든 minion 목록을 요청하거나 특정 grains 또는 온라인 상태를 조회할 수 있습니다.
- 4Master 측 함수 실행AI 클라이언트는 오케스트레이션 작업을 수행하기 위해 Salt Master Runner 모듈 또는 Wheel 함수를 트리거할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
salt-api-cli MCP 도구 12
README에서 감지됨salt_list_profilessalt_pingsalt_runsalt_state_applysalt_list_minionssalt_get_minion_grainssalt_list_jobssalt_get_jobsalt_runnersalt_wheelsalt_keys_managesalt_send_hook
| salt_list_profiles | — | |
| salt_ping | — | |
| salt_run | — | |
| salt_state_apply | — | |
| salt_list_minions | — | |
| salt_get_minion_grains | — | |
| salt_list_jobs | — | |
| salt_get_job | — | |
| salt_runner | — | |
| salt_wheel | — | |
| salt_keys_manage | — | |
| salt_send_hook | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능laurentl/salt-api-cli is public and reachablegithub.com/laurentl/salt-api-cli ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-04github.com/laurentl/salt-api-cli ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음12 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨No tool named like delete, drop or exec통과
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기sapi — SaltStack salt-api CLI & Full-Access MCP Server
sapi is a fast, zero-dependency Go command-line client that wraps SaltStack's salt-api (netapi: rest_cherrypy / rest_tornado) and embeds a Full-Access Model Context Protocol (MCP) server (stdio) for AI coding and operations agents (Claude Code, Gemini CLI, Cursor, Google Antigravity).
Key Features
- Hybrid CLI Experience:
- Drop-in
saltShortcut Mode: Runsapi '*' test.ping,sapi -G 'os:Debian' cmd.run 'uptime', orsapi -b 25% '*' state.highstatedirectly without verbose subcommands. - Structured Subcommands:
run,async,batch,job,minion,runner,wheel,key,event,profile,auth,stats, andmcp.
- Drop-in
- Multi-Profile & Flexible Secret Resolution:
- Manage multiple Salt Masters (
prod,staging,dev) in~/.config/sapi/config.toml. - Resolve credentials via
password_env,password_cmd(e.g.,pass,secret-tool,1password), environment variables (SALT_API_*), or interactive terminal prompt.
- Manage multiple Salt Masters (
- Automatic Token Caching & Renewal:
- Caches
X-Auth-Tokenin~/.cache/sapi/tokens.jsonwith strict0600permissions. - Proactively refreshes tokens before expiration and transparently retries once on
HTTP 401 Unauthorized.
- Caches
- Rich Output Renderers:
pretty(colorized tree output matching native Salt CLI + automaticstate.apply/highstatesummary table),json,yaml, andtable.
- Built-in Full-Access MCP Server (
sapi mcp):- Exposes 12 MCP tools over
stdioallowing AI agents to inspect minions/grains/jobs, run execution modules, apply states, execute Master runners/wheel functions, manage minion keys (list,accept,reject,delete,finger), and trigger Salt webhooks across any configured profile.
- Exposes 12 MCP tools over
Architecture
flowchart LR
subgraph Inputs["Interfaces"]
CLI_Sub["Structured CLI\nsapi run / job / key..."]
CLI_Short["Native Shortcut\nsapi '*' test.ping"]
MCP_Stdio["MCP Server (stdio)\nsapi mcp"]
end
subgraph Core["Go Core (internal/)"]
Cfg["Config & Profiles\nconfig.toml + SALT_API_*"]
Auth["Token Cache (0600)\nAuto-renew /login"]
Client["NetAPI HTTP Client\nlocal, async, batch, runner, wheel, SSE"]
Out["Output Renderers\nPretty / JSON / YAML / Table"]
end
subgraph SaltMasters["Salt Infrastructure"]
M1["Salt Master (Prod)\nhttps://salt-prod:8000"]
M2["Salt Master (Staging)\nhttps://salt-stg:8000"]
end
CLI_Sub --> Cfg
CLI_Short --> Cfg
MCP_Stdio --> Cfg
Cfg --> Auth
Auth --> Client
Client --> Out
Client --> M1
Client --> M2
Installation
Via go install
go install github.com/laurentL/salt-api-cli/cmd/sapi@latest
Debian / Ubuntu Package (.deb)
Build and install the native .deb package (includes /usr/bin/sapi, man pages sapi(1) + sapi-*(1), and bash/zsh/fish completions):
make deb
sudo dpkg -i dist/sapi_1.0.0-1_amd64.deb
# Or using standard debhelper:
dpkg-buildpackage -us -uc -b
From Source (Makefile)
git clone https://github.com/laurentL/salt-api-cli.git
cd salt-api-cli
make all
make install
# Installs binary to ~/bin/sapi and man pages to ~/.local/share/man/man1/
Man Pages
man sapi
man sapi-run
man sapi-key
man sapi-mcp
Configuration (~/.config/sapi/config.toml)
Initialize a sample configuration file:
sapi profile init
Or create/update a profile directly from the CLI:
sapi profile set prod \
--url https://salt-master.prod.example.com:8000 \
--user saltadmin \
--eauth pam \
--password-env SALT_PROD_PASSWORD \
--default
Example ~/.config/sapi/config.toml (see config.example.toml):
default_profile = "prod"
default_output = "pretty" # pretty | json | yaml | table
[profiles.prod]
url = "https://salt-master.prod.example.com:8000"
username = "saltadmin"
password_env = "SALT_PROD_PASSWORD" # or password_cmd = "secret-tool lookup service salt-prod"
eauth = "pam" # pam | ldap | file | sharedsecret | auto
verify_ssl = true
timeout = "60s"
[profiles.staging]
url = "https://salt-master.staging.example.com:8000"
username = "saltadmin"
password_env = "SALT_STAGING_PASSWORD"
eauth = "pam"
verify_ssl = false
timeout = "30s"
Environment Variable Overrides
CLI flags take precedence over environment variables, which take precedence over config.toml:
SALT_API_PROFILE: Active profile nameSALT_API_URL: Salt Mastersalt-apiURLSALT_API_USER: UsernameSALT_API_PASSWORD: PasswordSALT_API_EAUTH: External auth backend (pam,ldap,file,sharedsecret)SALT_API_TOKEN: Pre-existingX-Auth-TokenSALT_API_INSECURE: Skip TLS verification (true/1)
CLI Usage
1. Native salt Shortcut Mode
Any command whose first positional argument is not a reserved subcommand is automatically executed against targeted minions:
# Connectivity check
sapi '*' test.ping
# Target by Grain (-G), PCRE (-E), List (-L), Pillar (-I), Compound (-C), Nodegroup (-N), Subnet (-S)
sapi -G 'os_family:Debian' pkg.install htop refresh=True
sapi -L 'web-01,web-02' service.restart nginx
sapi -C 'G@os:Ubuntu and E@db-.*' cmd.run 'df -h'
# Asynchronous execution with live job polling
sapi --async --wait '*' state.apply common test=True
# Progressive batch execution
sapi -b 20% '*' state.highstate
2. Structured Subcommands
# Authentication & token cache inspection
sapi auth login -p prod
sapi auth status
sapi auth logout
# Jobs management
sapi job list --limit 15 --function state.apply
sapi job get 20261015130000123456 --info
sapi job wait 20261015130000123456 --interval 2s --timeout 5m
sapi job active
# Minions & Grains inventory
sapi minion list
sapi minion grains web-01 os ipv4 mem_total
sapi minion status
# Master Runners & Wheel modules
sapi runner manage.up
sapi runner state.orchestrate orch.deploy pillar='{"version":"2.1.0"}'
sapi wheel config.values
# Minion Keys management (via Wheel)
sapi key list
sapi key accept web-new-01
sapi key reject web-unwanted-01
sapi key delete web-old-01
sapi key finger '*'
# Real-time Event Bus (SSE) & Webhooks
sapi event listen --tag 'salt/job/*' --count 10
sapi event hook deploy/app -d '{"env":"staging","version":"1.2.3"}'
# Salt-API server statistics
sapi stats
MCP Server Integration (Claude Code / Gemini CLI / Antigravity / Cursor)
sapi mcp (or sapi --mcp) starts a Model Context Protocol server over stdio. Technical logs are written to /tmp/sapi_mcp.log so stdout remains strictly reserved for JSON-RPC frames.
Add the following entry to your mcp_config.json (or .mcp.json):
{
"mcpServers": {
"salt": {
"command": "sapi",
"args": ["mcp"]
}
}
}
Exposed MCP Tools (Full Access)
Every tool accepts an optional profile parameter so the AI agent can dynamically target prod, staging, or dev:
| Tool Name | Description |
|---|---|
salt_list_profiles |
List configured Salt Master profiles from ~/.config/sapi/config.toml and show the default profile. |
salt_ping |
Test connectivity (test.ping) against targeted minions (tgt, tgt_type). |
salt_run |
Execute any Salt execution module (local, local_async with optional wait, or local_batch). |
salt_state_apply |
Apply a Salt state or highstate (state, test, pillar, saltenv, wait). |
salt_list_minions |
List known minions and their grains or online/offline status (manage.status). |
salt_get_minion_grains |
Fetch full or filtered grains for a specific minion (minion_id, grain). |
salt_list_jobs |
List historical jobs (/jobs) or currently running jobs (active_only=true). |
salt_get_job |
Retrieve full return data for a jid (with optional wait=true polling). |
salt_runner |
Execute any Salt Master Runner module (fun, args, kwargs, async). |
salt_wheel |
Execute any Salt Master Wheel function (fun, args, kwargs, async). |
salt_keys_manage |
Manage minion keys (list, accept, reject, delete, finger). |
salt_send_hook |
Trigger a Salt-API webhook (POST /hook/<tag>) with a JSON payload. |
License
Released under the MIT License.
salt-api-cli MCP 질문
salt-api-cli MCP는 어떤 도구를 제공하나요?
12개 도구를 제공합니다. 예: salt_list_profiles, salt_ping, salt_run, salt_state_apply, salt_list_minions.
여러 개의 Salt Master를 관리할 수 있나요?
네, ~/.config/sapi/config.toml에 프로필을 정의하여 여러 Salt Master(예: prod, staging, dev)를 관리할 수 있습니다.