envspeak
EnvSpeak
.env ファイル、Docker Compose、Kubernetes にまたがる設定・環境変数のカスケードを解決する MCP サーバー兼 CLI — 変数がランタイムで実際に何に評価されるのか、そしてその理由を AI エージェント(とあなた)に伝えます。
CSS カスケードと同じ問題構造 — 複数のソース、わかりにくい優先順位ルール、そして定義された場所だけで「勝つ」値 — を、スタイルシートではなくアプリケーション設定に適用したものです。stylesafe と stylespeak の兄弟プロジェクトで、これらは CSS に対して同じことを行います。
問題
実際のアプリの設定は、.env、.env.local、.env.production、docker-compose.yml(environment: と env_file:)、Kubernetes の ConfigMap/Secret オブジェクト、そしてコード内のハードコードされたフォールバックから得られます — 5 つ以上のレイヤーがあり、それぞれが独自の優先順位ルールを持ち、それらは直感どおりには合成されません。最もよく知られた落とし穴: 通常の .env.local は .env.production を上書きします。ただし .env.production.local も存在する場合は別です — 従来の dotenv カスケードでは「local」が「環境固有」より優先されるためです。設定を編集するエージェントは、変数が実際に何に解決されるのか、あるいは 1 つのレイヤーを変更したら何が壊れるのかを知る方法がありません。
Related MCP server: @mcpx-digital/env-check
ツール
resolve_variable—DATABASE_URLは実際に何に評価されるのか、そしてどのファイルが勝つのか?trace_variable— この変数が設定されているすべての場所を、すべてのドメインと環境にわたって確認する。impact_preview— このファイルのこの値を変更したら、下流で実際に何が変わるのか — そして、より優先順位の高いものによって守られているものは何か?config_manifest— 圧縮されたプロジェクト全体のサマリー: すべての変数、そのソース、そしてリスクのホットスポット(追跡対象ファイルにあるシークレット、フォールバックもソースもなくコード内で読み取られる変数)。diff_environments— 2 つの環境/サービス/ワークロードの下で全変数を解決し、それらの間で実際に何が異なるかを確認する。
インストール
npm install -g @patrizzos/envspeakMCP サーバーとして
{
"mcpServers": {
"envspeak": {
"command": "envspeak"
}
}
}CLI として
envspeak resolve DATABASE_URL --environment production
envspeak trace LOG_LEVEL
envspeak impact --file .env --variable LOG_LEVEL --newValue debug
envspeak manifest
envspeak diff --a '{"nodeEnv":"development"}' --b '{"nodeEnv":"production"}'--files を省略すると、envspeak は --projectRoot(デフォルト: カレントディレクトリ)の下にある .env*、Compose、Kubernetes マニフェストファイルを自動検出します。明示的にスコープを指定するには --files a,b,c を渡します — MCP 呼び出しでは推奨されます。エージェントが正確に何を読むかを制御できるためです。
組み込まれている優先順位の規約
dotenv(Next.js/Vite スタイル、事実上の標準): process.env(シェル)> .env.[env].local > .env.local > .env.[env] > .env > コードのフォールバック(process.env.X || 'default')。.env.local が .env.[env] より優先されることに注意 — 上記の落とし穴です。
Docker Compose: docker compose run -e(CLI)> environment: > env_file:(競合時はリストの最後のファイルが勝つ)> Dockerfile ENV(分析対象外)。
Kubernetes: インラインの env: は常に envFrom:(ConfigMap/Secret の一括インポート。リスト内では最後のエントリが勝つ)を上書きします。環境変数の値はポッド起動時に固定されます — 参照されている ConfigMap/Secret を編集しても、再起動やロールアウトなしでは実行中のポッドには届きません。impact_preview はこれをフラグで示します。
すべての結果には confidence レベルと caveat 文字列が含まれます。シェルでエクスポートされたり CLI で渡されたりする上書きは常に可能であり、静的解析には決して見えないためです — envspeak は、持ち得ない確実性を装うのではなく、そのことを明示的に述べます。
セキュリティ
ランタイム依存関係ゼロ。 Compose/Kubernetes ファイルに使用される YAML サブセットパーサーは npm から取得するのではなく手書きされているため、サードパーティのサプライチェーン面がありません。
npm auditは構造上クリーンです。パストラバーサルをガード。 ファイル読み取りは
projectRootに対して解決され、それを逃れることを拒否します。ツール呼び出しに細工された相対パスが渡された場合でも同様です。プロトタイプ汚染をガード。 YAML コンテンツから解析されたオブジェクトキー(
__proto__、constructor、prototype)は、プロパティ代入に決して使用されません。シークレットはデフォルトでマスクされます。 Kubernetes の
Secret値は、どのツールが表示する場合でも、ab***yzとしてのみ表示され、完全な形では決して表示されません。シークレットらしさのヒューリスティック。 変数名と値の形状(AWS キー、GitHub トークン、PEM ブロック、高エントロピーの認証情報らしき文字列)がフラグされ、
.gitignoreと照合され、黙って素通しされるのではなくsecretFlag/ リスクのホットスポットとして表面化されます。境界付き・非バックトラッキングの正規表現。 コードデフォルトのスキャンに使用されるパターンマッチングは、マッチ長に上限を設け、ネストされた量指定子を避けることで、大きなファイルでの ReDoS を防ぎます。
これらのガードに関係なく、envspeak はあなたが指定したファイルを読み取ります — エージェントが渡せる
filesリストをスコープしてください。ファイルシステムアクセスを持つあらゆるツールをスコープするのと同じように。
開発
npm test # zero dependencies — no install step neededライセンス
MIT
Available Tools
5 toolsconfig_manifestB
Compressed, project-wide summary of every config variable found — sources, domains, and risk hotspots (likely secrets in tracked files, variables read in code with no source). Load once per session instead of repeated resolve_variable calls.
Inputs: files (required), projectRoot, maxVariables.
diff_environmentsA
Resolves every variable under two different environment/service/workload selectors and reports what differs between them.
Inputs: files (required), environmentA (required), environmentB (required), variables, +1 more.
impact_previewB
Predicts which environments/services/workloads are actually affected if a variable's value in one file is changed (or removed) — including which contexts are shielded by a higher-precedence source.
Inputs: file (required), files (required), variable (required), newValue, +1 more.
resolve_variableA
Resolves what a config/env variable actually evaluates to across dotenv, docker-compose, and Kubernetes sources, and which source wins.
Inputs: files (required), variable (required), service, workload, +3 more.
trace_variableA
Lists every place a variable is defined or read across dotenv, compose, k8s, and code, and what wins in each discovered environment/service/workload context.
Inputs: files (required), variable (required), projectRoot.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Most tools are clearly separated by purpose: manifest summarizes, impact previews, diff compares, and trace enumerates. The only real overlap is between resolve_variable and trace_variable, since both explain precedence and 'what wins,' though one targets the final value and the other targets all definition/read locations.
resolve_variable and trace_variable follow a clean verb_noun pattern, but config_manifest and impact_preview are noun compounds, and diff_environments uses a terse verb. The names are readable and descriptive, but the naming convention is not uniform across the set.
Five tools is well-scoped for a read-only environment/config analysis server. Each tool covers a distinct analytical need without redundancy or bloat, and the count feels intentional rather than thin or excessive.
The set covers the full analysis workflow: resolving a single variable, tracing all usages, generating a project-wide manifest, predicting change impact, and diffing environments. No obvious missing operation is needed for the stated domain.
Maintenance
Related MCP Connectors
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Investigate alerts, run root-cause analysis, and ask production questions with Resolve.
Find your AI agent's likely failure mode, get runtime settings, and clarify ambiguous prompts.
Approved test intent, reviewed Playwright automation and run evidence, inside your editor.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides AI coding agents with structured, evidence-based diagnostics about the local development environment, detecting tech stack, runtime mismatches, dependency state, services, ports, and Git status without exposing secrets or using network calls.10Apache 2.0
- AlicenseAqualityCmaintenanceCompares a project's .env file against its .env.example template to surface missing, extra, and empty keys, flag empty required variables, and produce paste-safe key inventories for tickets or sharing. Runs entirely on local files with every value redacted, so secrets are never echoed or uploaded.3MIT
- AlicenseNot gradedqualityBmaintenanceChecks which .env, .git, keys and source maps Cloudflare Pages, Vercel, Netlify or Firebase would publish, before and after deploy. CLI, live probe, Claude Code hook, MCP server and GitHub Action.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables scanning a repository's source files for actual environment variable reads and diffing those names against .env.example or .env.sample. Returns a deterministic JSON report with the sync verdict, counts, and findings for used-but-undocumented, documented-but-unused, and missing-example vars, without ever reading values.60 npmMIT