
Envspeak
io.github.Patrizzos由 GitHub 帳號 Patrizzos 發布v0.1.0更新於 Oct 24, 2026
MCP server and CLI that resolves config/env-var cascade across .env, docker-compose, and Kubernetes
概覽
本機 MCP 伺服器兼命令列工具,解析環境變數在 .env 檔案、Docker Compose 與 Kubernetes 之間的設定優先順序,並說明最終取值來源。
- 可以做什麼
- 解析單一變數的實際生效值,指出勝出的檔案或層級,並在靜態分析無法確定時提供信心程度與注意事項。追蹤某個變數在所有檔案、環境與服務中的設定位置。預覽在某個檔案中修改取值後的下游影響,包括被更高優先順序來源遮蔽的部分,以及 Kubernetes 中於 Pod 啟動時凍結的值。產生整個專案的變數清單、來源與風險熱點,例如受追蹤檔案中的密鑰,或程式碼中讀取卻沒有任何來源的變數。比對兩個環境、服務或工作負載解析後的設定差異。
- 適用情境
- 適合助理編輯或審查應用程式設定時,需要知道變數在執行時實際取什麼值、哪一層生效,或修改某個值會影響什麼。也適合在部署前稽核環境差異、找出密鑰或未設定的變數。
- 執行需求
- 以本機程序透過 stdio 執行;需全域安裝 npm 套件 @patrizzos/envspeak 並註冊 envspeak 指令。讀取專案根目錄下的 .env 檔案、Compose 檔案與 Kubernetes 清單,預設自動探索,也可用檔案清單限定範圍。未宣告帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Envspeak,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
EnvSpeak
MCP server and CLI that resolves config/env-var cascade across .env files, Docker Compose, and Kubernetes — tells AI agents (and you) what a variable actually evaluates to at runtime, and why.
Same problem shape as CSS cascade — several sources, non-obvious precedence rules, and a value that "wins" only because of where it's defined — applied to application configuration instead of stylesheets. A sibling project to stylesafe and stylespeak, which do the same thing for CSS.
The problem
A real app's config comes from .env, .env.local, .env.production, docker-compose.yml (environment: vs env_file:), Kubernetes ConfigMap/Secret objects, and hard-coded fallbacks in code — five-plus layers, each with its own precedence rules that don't compose the way you'd guess. The best-known gotcha: a plain .env.local overrides .env.production unless you also have a .env.production.local — because "local" outranks "environment-specific" in the conventional dotenv cascade. An agent editing config has no way to know what a variable actually resolves to, or what breaks if it changes one layer.
Tools
resolve_variable— what doesDATABASE_URLactually evaluate to, and which file wins?trace_variable— every place this variable is set, across every domain and environment.impact_preview— if I change this value in this file, what actually changes downstream — and what's shielded by something higher-precedence?config_manifest— a compressed, whole-project summary: every variable, its sources, and risk hotspots (secrets sitting in a tracked file, variables read in code with no fallback and no source anywhere).diff_environments— resolve every variable under two environments/services/workloads and see what's actually different between them.
Install
As an MCP server
As a CLI
If --files is omitted, envspeak auto-discovers .env*, Compose, and Kubernetes manifest files under --projectRoot (default: current directory). Pass --files a,b,c to scope it explicitly — recommended for MCP calls, so the agent controls exactly what's read.
Precedence conventions encoded
dotenv (Next.js/Vite-style, the de facto standard): process.env (shell) > .env.[env].local > .env.local > .env.[env] > .env > code fallback (process.env.X || 'default'). Note .env.local outranks .env.[env] — the gotcha above.
Docker Compose: docker compose run -e (CLI) > environment: > env_file: (last file in the list wins on conflicts) > Dockerfile ENV (not analyzed).
Kubernetes: inline env: always overrides envFrom: (bulk ConfigMap/Secret import; last entry in the list wins among those). Env values are frozen at pod start — editing a referenced ConfigMap/Secret does not reach a running pod without a restart or rollout. impact_preview flags this.
Every result includes a confidence level and a caveat string, because a shell-exported or CLI-passed override is always possible and never visible to static analysis — envspeak says so explicitly rather than pretending certainty it doesn't have.
Security
- Zero runtime dependencies. The YAML subset parser used for Compose/Kubernetes files is hand-written rather than pulled in from npm, so there's no third-party supply-chain surface.
npm auditis clean by construction. - Path-traversal guarded. File reads are resolved against
projectRootand refuse to escape it, even if a tool call is given a crafted relative path. - Prototype-pollution guarded. Object keys parsed from YAML content (
__proto__,constructor,prototype) are never used for property assignment. - Secrets are redacted by default. Kubernetes
Secretvalues are shown only asab***yz, never in full, regardless of which tool surfaces them. - Secret-likelihood heuristics. Variable names and value shapes (AWS keys, GitHub tokens, PEM blocks, high-entropy credential-shaped strings) are flagged, cross-referenced against
.gitignore, and surfaced as asecretFlag/ risk hotspot rather than silently passed through. - Bounded, non-backtracking regexes. Pattern matching used for code-default scanning caps match length and avoids nested quantifiers to avoid ReDoS on large files.
- Regardless of these guards, envspeak reads whatever files you point it at — scope the
fileslist an agent can pass, the same way you'd scope any tool with filesystem access.
Development
License
MIT
來源:README.md,提交 e35621e
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分