Skip to main content

Automatic Setup

The fastest way to set up Envark is using the built-in initialization command:
# Choose your IDE
npx envark init vscode    # VS Code
npx envark init claude    # Claude Desktop
npx envark init cursor    # Cursor
npx envark init windsurf  # Windsurf
This will:
  • Create the appropriate configuration directory
  • Generate the correct MCP configuration
  • Display instructions for the next steps
If a configuration file already exists, Envark will print the configuration to add manually rather than overwriting your existing setup.

Manual Configuration

If you prefer to configure manually or need to add Envark to an existing MCP setup, follow the instructions for your IDE:

VS Code with GitHub Copilot

1

Create MCP configuration

Create or edit .vscode/mcp.json in your project root:
.vscode/mcp.json
{
  "servers": {
    "envark": {
      "type": "stdio",
      "command": "npx",
      "args": ["envark"]
    }
  }
}
VS Code uses a project-local configuration (.vscode/mcp.json) rather than a global one.
2

Install Envark globally (optional)

For faster startup, install Envark globally:
npm install -g envark
Then update your configuration:
.vscode/mcp.json
{
  "servers": {
    "envark": {
      "type": "stdio",
      "command": "envark"
    }
  }
}
3

Reload VS Code

Press Cmd/Ctrl + Shift + P and run:
Developer: Reload Window
4

Verify integration

Open Copilot Chat and ask:
“Can you scan my project for environment variables?”
If configured correctly, Copilot will use the get_env_map tool.

Troubleshooting VS Code

  • Check that .vscode/mcp.json exists in your project root
  • Verify the file has valid JSON syntax
  • Restart VS Code completely (close all windows)
  • Check VS Code’s Output panel for MCP errors
If using npx envark, ensure Node.js and npm are in your PATH:
which npx
node --version
If using global install, verify:
which envark
envark --version
The first time Envark runs via npx, it downloads the package. Subsequent runs use the cached version.For faster startup, install globally:
npm install -g envark

Advanced Configuration

Using a Specific Node Version

If you use a Node version manager (nvm, fnm, etc.), specify the full path:
{
  "mcpServers": {
    "envark": {
      "command": "/Users/yourname/.nvm/versions/node/v20.10.0/bin/npx",
      "args": ["envark"]
    }
  }
}

Setting a Working Directory

Some IDEs support setting a working directory for MCP servers:
{
  "mcpServers": {
    "envark": {
      "command": "npx",
      "args": ["envark"],
      "cwd": "/path/to/your/project"
    }
  }
}

Environment Variables

You can pass environment variables to Envark:
{
  "mcpServers": {
    "envark": {
      "command": "npx",
      "args": ["envark"],
      "env": {
        "DEBUG": "true"
      }
    }
  }
}

Verifying Your Setup

After configuration, verify Envark is working:

Test via AI Assistant

Ask your AI assistant:
“Can you list the available MCP tools?”
You should see Envark’s 9 tools listed.

Test via Terminal

Run Envark directly to ensure it works:
npx envark scan
You should see a list of environment variables from your project.

Check MCP Logs

Most IDEs log MCP server activity. Check:
  • VS Code: Output panel → “MCP” or “Language Server”
  • Claude Desktop: Help → Developer Console
  • Cursor: View → Output → “MCP”

Common Issues

This means npx couldn’t download or find Envark. Solutions:
  1. Install globally: npm install -g envark
  2. Clear npm cache: npm cache clean --force
  3. Use full npx path: /usr/local/bin/npx envark
Envark might be scanning a very large project:
  1. Check that .gitignore excludes node_modules, .git, etc.
  2. Run npx envark scan manually to see scan time
  3. Increase timeout in IDE settings (if available)
This usually means Envark is running in the wrong directory:
  1. Verify your IDE opened the correct project folder
  2. Check the cwd setting in MCP config
  3. Run npx envark scan in your project directory to verify results
Fix file permissions:
chmod +x $(which npx)
chmod 644 ~/.claude/mcp.json  # or ~/.cursor/mcp.json, etc.

Next Steps

Tool Reference

Learn about all available MCP tools and their parameters

Usage Examples

See real-world examples of using Envark with AI assistants

Build docs developers (and LLMs) love