
.env checker: dotenv, Node, Vite, Next.js
io.github.Lawatch由 GitHub 账号 Lawatch 发布v1.0.0更新于 Nov 17, 2026
Real value of each .env variable and the file:line that decides, for dotenv, node, Vite, Next.js
概览
说明每个 .env 变量最终得到的值以及决定它的文件与行号,覆盖 dotenv、node --env-file、Vite 和 Next.js。
- 可以做什么
- 按指定加载器和模式解析多个 .env 文件,给出每个变量的最终值、决定它的 file:line、失效的定义及原因
- 用真实的 dotenv 或 Node 解析器解析单个 .env 文件,显示被忽略的行、在 # 处截断的值、未闭合引号、多行值和重复键
- 对比 dotenv 与 Node 解析器对同一批变量的读取差异
- 列出发现的陷阱以及该模式下加载器根本不会读取的文件
- 适用场景
- 当某个环境变量为空、值不对或为 undefined,需要弄清哪个文件哪一行生效时;或在项目从 dotenv 切换到 node --env-file、Vite、Next.js 加载器之前使用。
- 运行要求
- 以 stdio 在本地运行:Claude Desktop 安装包、Docker 镜像,或 Node 18+ 从源码运行。未声明账号、密钥或环境变量。离线工作,.env 文件内容由你自行提供。
安装
在 SourceWeft 中
- 打开 控制台中的 .env checker: dotenv, Node, Vite, Next.js,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
dotenv-check — MCP server
Why is my environment variable empty, wrong or undefined?
The exact value each .env variable gets, and the file and line that decide it, with the four loaders developers use:
npm dotenv (+ dotenv-expand), node --env-file, Vite and Next.js. Offline.
One-click install for Claude Desktop, VS Code and Cursor: https://lawatch.github.io/10aday/mcp/dotenv-check/
Question, wrong answer or missing case? Open an issue — we read them.
AI assistants answer .env questions from memory, and the loaders disagree with each other:
PASSWORD=abc#123givesabc: an unquoted#starts a comment, even with no space before it.API_URL=(a trailing space) followed by a new line: Node and Vite 8 take the next line as the value, and that variable disappears.- Which file wins? dotenv and Next.js: the first file that defines it. Node and Vite: the last. The shell environment wins over all files.
$VARis expanded by dotenv-expand, Vite and Next.js, even inside single quotes, but never by Node or plain dotenv.- Vite only exposes
VITE_*to client code, Next.js onlyNEXT_PUBLIC_*, and.env.localis skipped by Next.js whenNODE_ENV=test. A=$A$Amakes Vite and dotenv-expand loop until the process runs out of memory.
Tools
Example
Result: VITE_API_URL = "VITE_TITLE=My app" (from .env.production:1, the .env:1 value loses), VITE_TITLE does not
exist, DB_PASSWORD is cut to abc and is not in import.meta.env anyway (no VITE_ prefix).
How exact is it?
The real code runs inside: npm dotenv 17.4.2 and dotenv-expand 12.0.3 (unchanged), the copy of dotenv-expand bundled
in Vite 8.3.8 (unchanged), @next/env 16.4.6 (unchanged, run with the files in memory), and a line-by-line port of
Node's C++ parser (src/node_dotenv.cc, identical in Node 22 to 25). The only addition: a guard that stops a value
growing without end, where the real loader would crash. test.js compares the server with util.parseEnv,
node --env-file, Vite's loadEnv, Next's loadEnvConfig and dotenv + dotenv-expand on thousands of random files
(quotes, #, $VAR, ${VAR:-default}, multi-line values, CRLF, export, several files, mode, shell variables): 0 differences.
Limits: .env.vault / dotenvx encryption and Docker Compose .env rules are not covered. Vite's envDir and
define are not read: give the files Vite would see.
Install
- Claude Desktop: open
dotenv-check-1.0.0.mcpbfrom the GitHub release. - Any MCP client (Docker):
{"command": "docker", "args": ["run", "-i", "--rm", "ghcr.io/lawatch/dotenv-check:1.0.0"]} - From source (Node 18+, no install):
{"command": "node", "args": ["/path/to/server.js"]}
Offline, read-only, no file access: you pass the file contents, nothing is sent anywhere.
Licenses
Server code: MIT. Bundled unchanged: dotenv and dotenv-expand (BSD-2-Clause, Scott Motte and contributors),
@next/env (MIT, Vercel). License texts in vendor/.
Built by AI agents (project 10aday).
来源:products/mcp/dotenv-check/README.md,提交 6e1ca13
工具
0版本历史
1- v1.0.0最新Nov 17, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。
其他 Check 集成
check.tattoo: tattoo size and placement guide
tattoo.check官方发布者
check.tattoo: tattoo size and placement guide 的托管 MCP 服务,由 check.tattoo 发布;无需登录;Streamable HTTP;5 个工具。
iva.pt — EU VAT check (VIES) and Portuguese VAT law
pt.iva官方发布者
在 VIES 中校验欧盟增值税号,并返回葡萄牙增值税法典(CIVA)与 RITI 条文,支持葡语和英语。
Racket Check
由 GitHub 账号 theharrisontruong-web 发布
为本地服务商的网站做“宰客”信号评分,检查套餐推销、合约绑定与价格透明度,返回判定结果和 0–100 分。

TaxCheck AU: Australian Tax Calculators
由 GitHub 账号 brettham70 发布
远程 MCP 服务器,提供带出处与日期的澳大利亚和新西兰税务计算器:到手工资、GST、HELP、MLS、养老金、KiwiSaver 与假期工资。

CheckMyTax NZ: New Zealand Tax Calculators
由 GitHub 账号 brettham70 发布
远程 MCP 服务器,提供带出处和日期的澳大利亚与新西兰税务计算器:到手工资、税码、GST、KiwiSaver、养老金、假期工资和工作日。