loading…
Search for a command to run...
loading…
Secure environment variable and configuration management MCP server with Claude Code integration for storing, managing, and retrieving environment variables.
Secure environment variable and configuration management MCP server with Claude Code integration for storing, managing, and retrieving environment variables.
A Model Context Protocol (MCP) server for secure environment variable and configuration management with Claude Code integration
License: MIT MCP Built by BuildAppolis
# Clone the repository
git clone https://github.com/buildappolis/env-mcp.git
cd env-mcp
# Install dependencies
pnpm install
# Build the project
pnpm run build
The server is already configured with Claude Code. To verify:
claude mcp list
You should see:
env-mcp: node /home/cory-ubuntu/coding/env-mcp/dist/index.js - ✓ Connected
If you need to reconfigure:
claude mcp add env-mcp "node" "/path/to/env-mcp/dist/index.js"
# Set a variable
./env-mcp-cli set KEY "value" --description "Description" --category "category"
# Set a sensitive variable (will be redacted in output)
./env-mcp-cli set API_KEY "secret" --sensitive --category "secrets"
# Get a variable
./env-mcp-cli get KEY
# List all variables
./env-mcp-cli list
# List by category
./env-mcp-cli list --category "secrets"
# Search variables
./env-mcp-cli search "api"
# Delete a variable
./env-mcp-cli delete KEY
# List categories
./env-mcp-cli categories
# Export to .env format
./env-mcp-cli export --format env --output .env
# Export to JSON
./env-mcp-cli export --format json --output config.json
# Export to YAML
./env-mcp-cli export --format yaml --output config.yaml
# Import from .env file
./env-mcp-cli import .env
When using Claude Code, the following tools are available:
env_get - Get an environment variable valueenv_set - Set an environment variable with optional metadataenv_delete - Delete an environment variableenv_search - Search for variables by queryenv_list - List all variables or filter by categoryenv_export - Export variables in different formatsenv_import - Import variables from a fileConfiguration is stored in: ~/.env-mcp/config.yaml
The storage format includes:
# Database configuration
./env-mcp-cli set DB_HOST "localhost" --category "database"
./env-mcp-cli set DB_PORT "5432" --category "database"
./env-mcp-cli set DB_NAME "myapp" --category "database"
./env-mcp-cli set DB_USER "admin" --category "database"
./env-mcp-cli set DB_PASS "secret" --sensitive --category "database"
# API Keys
./env-mcp-cli set OPENAI_API_KEY "sk-..." --sensitive --category "api-keys"
./env-mcp-cli set STRIPE_API_KEY "sk_test_..." --sensitive --category "api-keys"
# Application settings
./env-mcp-cli set NODE_ENV "development" --category "app"
./env-mcp-cli set PORT "3000" --category "app"
./env-mcp-cli set LOG_LEVEL "debug" --category "app"
# Export for use in application
./env-mcp-cli export --format env --output .env
# Find all database-related variables
./env-mcp-cli search "db"
# List all API keys
./env-mcp-cli list --category "api-keys"
# Show all categories
./env-mcp-cli categories
# Get JSON output for parsing
./env-mcp-cli list --json | jq '.[] | select(.category == "database")'
# Export specific category to JSON
./env-mcp-cli list --category "app" --json > app-config.json
--sensitive are redacted in normal output--show-sensitive flag with get command to view sensitive valuesenv-mcp/
├── src/
│ ├── index.ts # MCP server implementation
│ ├── cli.ts # CLI tool implementation
│ ├── store.ts # Storage layer
│ └── types.ts # TypeScript type definitions
├── dist/ # Compiled JavaScript
├── package.json # Dependencies and scripts
└── tsconfig.json # TypeScript configuration
# Build the project
pnpm run build
# Run in development mode
pnpm run dev
# Run CLI in development
pnpm run cli
Check if the server is built:
pnpm run build
Test the server manually:
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}},"id":1}' | node dist/index.js
Reconnect with Claude:
claude mcp list # Check status
Check the configuration file:
cat ~/.env-mcp/config.yaml
Ensure write permissions:
mkdir -p ~/.env-mcp
chmod 755 ~/.env-mcp
MIT
Feel free to submit issues and pull requests to improve the env-mcp server.
Run in your terminal:
claude mcp add env-mcp -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.