env-manager-mcp
v1.0.5
Published
Env Manager MCP server — read, write, and validate .env files
Maintainers
Readme
env-manager-mcp
Env Manager MCP server. Read, write, and validate .env files.
No external dependencies. Pure Node.js fs.
Install
npm install -g env-manager-mcpUsage
Claude Desktop / Cursor / OpenCode
Add to your MCP config:
{
"mcpServers": {
"env-manager": {
"command": "npx",
"args": ["-y", "env-manager-mcp"]
}
}
}Tools
read_env — Read Env File
Read and parse a .env file into a key-value object.
Input:
{
"path": ".env"
}Output:
{
"path": "/path/to/project/.env",
"count": 5,
"variables": {
"DB_HOST": "localhost",
"DB_PORT": "5432",
"API_KEY": "sk-test-12345",
"APP_NAME": "My Application",
"DEBUG": "true"
}
}write_env — Write Env Variables
Write environment variables to a .env file. Preserves existing comments and format.
Input:
{
"path": ".env",
"variables": {
"NEW_KEY": "new_value",
"API_KEY": "updated_key"
},
"append": true
}Output:
{
"success": true,
"path": "/path/to/project/.env",
"written": 2,
"variables": ["NEW_KEY", "API_KEY"]
}validate_env — Validate Env File
Check if required keys exist in a .env file. Returns missing keys.
Input:
{
"path": ".env",
"required_keys": ["DB_HOST", "API_KEY", "MISSING_KEY"]
}Output:
{
"path": "/path/to/project/.env",
"valid": false,
"present": ["DB_HOST", "API_KEY"],
"missing": ["MISSING_KEY"],
"total_required": 3
}Features
| Feature | Description | |---------|-------------| | Parse .env files | Handles comments, quoted values, inline comments | | Preserve format | Keeps existing comments and structure when writing | | Multi-env support | Works with .env.local, .env.development, etc. | | Validation | Check for required keys before deployment |
Design
| Feature | Why |
|---------|-----|
| Zero runtime deps | Only @modelcontextprotocol/sdk and zod |
| Native fs | No dotenv dependency — pure parsing |
| Format preservation | Comments and structure kept intact |
| Multi-env | Any .env file path supported |
License
MIT
