Skip to main content
Glama

πŸ” env-mcp - Environment Variable MCP Server

A Model Context Protocol (MCP) server for secure environment variable and configuration management with Claude Code integration

License: MIT MCP Built by BuildAppolis

Features

  • Secure Storage: Store environment variables with optional sensitive data protection

  • Categories: Organize variables by category for better management

  • Search & Filter: Find variables quickly with search functionality

  • Multiple Formats: Export/import support for .env, JSON, and YAML formats

  • MCP Integration: Seamlessly integrates with Claude Code for AI-assisted configuration management

  • CLI Tool: Powerful command-line interface for manual management

Related MCP server: empaya-mcp-server

Installation

# 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

Configuration

Add to Claude Code

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

Manual Configuration

If you need to reconfigure:

claude mcp add env-mcp "node" "/path/to/env-mcp/dist/index.js"

CLI Usage

Basic Commands

# 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

Import/Export

# 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

MCP Tools (Available in Claude)

When using Claude Code, the following tools are available:

  • env_get - Get an environment variable value

  • env_set - Set an environment variable with optional metadata

  • env_delete - Delete an environment variable

  • env_search - Search for variables by query

  • env_list - List all variables or filter by category

  • env_export - Export variables in different formats

  • env_import - Import variables from a file

Data Storage

Configuration is stored in: ~/.env-mcp/config.yaml

The storage format includes:

  • Variable key/value pairs

  • Optional descriptions

  • Categories for organization

  • Sensitive data flags

  • Creation/update timestamps

Examples

Setting up a development environment

# 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

Searching and filtering

# 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

JSON output for scripting

# 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

Security

  • Variables marked as --sensitive are redacted in normal output

  • Use --show-sensitive flag with get command to view sensitive values

  • Sensitive values are still exported normally (be careful with exports)

  • Configuration file permissions should be restricted (chmod 600)

Development

Project Structure

env-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

Scripts

# Build the project
pnpm run build

# Run in development mode
pnpm run dev

# Run CLI in development
pnpm run cli

Troubleshooting

MCP Server won't connect

  1. Check if the server is built:

    pnpm run build
  2. 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
  3. Reconnect with Claude:

    claude mcp list  # Check status

Variables not persisting

Check the configuration file:

cat ~/.env-mcp/config.yaml

Ensure write permissions:

mkdir -p ~/.env-mcp
chmod 755 ~/.env-mcp

License

MIT

Contributing

Feel free to submit issues and pull requests to improve the env-mcp server.

Available Tools

7 tools
env_deleteC

Delete an environment variable

ParametersJSON Schema
NameRequiredDescriptionDefault
keyYesVariable key to delete

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It states 'delete' but does not disclose irreversibility, authorization requirements, or behavior on nonexistent keys. Minimal behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single sentence is efficient but under-specified. It lacks actionable details, such as expected outcomes or error conditions. While not verbose, it sacrifices completeness for brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple delete operation with one parameter and no output schema, the description could hint at return behavior (e.g., success message or error handling). The current text is too sparse to fully inform an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (the 'key' parameter is documented). The description adds no extra meaning beyond the schema, meeting the baseline for high coverage. No additional context provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Delete an environment variable' clearly states the action (delete) and resource (environment variable). It distinguishes from sibling tools like env_set (create/update) and env_get (read). However, it could be more specific (e.g., 'Permanently removes') to avoid ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. The description does not mention prerequisites, such as ensuring the variable exists, or when to prefer env_set to modify instead of delete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

env_exportC

Export environment variables

ParametersJSON Schema
NameRequiredDescriptionDefault
formatNoExport format (env, json, yaml)

TDQS

C2.7/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description gives no behavioral details. It does not state what the export does (e.g., outputs to stdout, creates a file), whether it requires specific permissions, or what happens if the format parameter is invalid. The description adds no value beyond the tool name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no wasted words. However, it lacks structure such as bullet points or separate lines. It is efficient but could be more informative within the same length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema, the description should clarify what the tool returns or produces. It does not explain the effect (e.g., printed output, file generation, or return value). The tool has only one parameter, but the description is still incomplete for safe and correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (1 parameter with description), so baseline is 3. The description's 'Export format (env, json, yaml)' merely repeats the schema's description, adding no new semantic meaning. Baseline score is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Export environment variables' clearly states the verb and resource. However, it does not distinguish this tool from siblings like env_get or env_list, which could also retrieve environment data. The concept of 'export' versus 'get' or 'list' is not elaborated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use env_export versus alternatives. No conditions, prerequisites, or exclusions are mentioned. The agent must infer usage solely from the tool name and parameters.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

env_getC

Get an environment variable value

ParametersJSON Schema
NameRequiredDescriptionDefault
keyYesVariable key

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description must define behavior. It fails to mention what is returned (value only or full object), error handling if key is missing, or whether it is read-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence without waste, but extremely minimal. It could be slightly expanded to include return type or usage hints without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (1 required param, no output schema), the description is borderline adequate. It lacks information on return value and error behavior, which would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a single 'key' parameter described as 'Variable key'. The description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get an environment variable value', indicating a read operation for a single variable by key. It is specific but does not explicitly differentiate from sibling tools like env_list or env_search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives (e.g., env_list for listing all, env_search for pattern matching). The agent is left to infer from the name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

env_importC

Import environment variables from file

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesPath to .env file

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description fails to disclose critical behaviors: whether imported variables overwrite existing ones, what happens on file errors, or if the operation is persistent. The description is inadequate for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no filler, but it is overly brief and sacrifices necessary detail for conciseness. Slightly below perfect because it omits essential behavioral context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With one parameter, no output schema, and no annotations, the description should provide more context (e.g., load into current process, behavior on duplicate keys). The current description is insufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single parameter 'path', which is described as 'Path to .env file'. The main description adds no additional meaning beyond the schema, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the action (import) and resource (environment variables from file). However, it does not explicitly differentiate from sibling tools like env_export, though the 'from file' phrasing hints at the opposite direction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as env_set or env_export. Lacks context on prerequisites, file format expectations, or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

env_listA

List all environment variables or by category

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNoOptional category filter

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description only states the basic function. It lacks details on behavior such as pagination, authentication requirements, or what happens when no category is specified. More transparency is needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single efficient sentence, front-loaded with the primary action and optional filter. No superfluous words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list operation with one optional parameter, the description is mostly complete. It could mention that listing all is the default, but it's implied. Lacks output schema details, but acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the description does not add meaning beyond the schema's 'Optional category filter'. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and resource 'environment variables', and the optional category filter implicitly distinguishes from siblings like env_get (single get) and env_search (search).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description covers when to use: to list all or by category. It does not explicitly exclude alternatives or provide when-not-to-use guidance, but the context is clear given sibling names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

env_setC

Set an environment variable

ParametersJSON Schema
NameRequiredDescriptionDefault
keyYesVariable key
valueYesVariable value
descriptionNoOptional description
categoryNoOptional category
sensitiveNoMark as sensitive

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavioral traits. It does not mention whether the tool overwrites existing variables, requires specific permissions, or has side effects. The single sentence is insufficient for transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise at one sentence, but it is too minimal. It front-loads the purpose but does not earn its place by providing additional useful context. For a tool with 5 parameters, slightly more detail would improve clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters, no annotations, and no output schema, the description is undercomplete. It does not explain persistence, scope, or behavior when setting an environment variable, leaving agents uninformed about crucial details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description does not add meaning beyond the schemaβ€”it merely restates the purpose. No extra semantic value is provided for parameters like 'sensitive' or 'category'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Set an environment variable' clearly states the verb 'set' and resource 'environment variable', distinguishing it from siblings like env_delete and env_get. However, it is brief and could benefit from specifying scope or behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use env_set versus alternatives such as env_import or env_edit (if it exists). The description lacks context for choosing this tool over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv1.0.0
    • First observedenv_delete
    • First observedenv_export
    • First observedenv_get
    • First observedenv_import
    • First observedenv_list
    • First observedenv_search
    • First observedenv_set

TDQS

B3.4/5.0

Scored across 7 tools

Disambiguation5/5

Each tool has a clear, distinct action (delete, export, get, import, list, search, set) on environment variables, with no overlapping functionality.

Naming Consistency5/5

All tools follow the consistent pattern 'env_<verb>' using snake_case, making them predictable and easy to distinguish.

Tool Count5/5

With 7 tools covering CRUD, listing, searching, export, and import, the count is well-scoped for environment variable management.

Completeness5/5

The tool set covers all essential operations (create/set, read/get, update/set, delete/list/search, plus import/export), leaving no obvious gaps for typical workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    B
    maintenance
    Enterprise-grade MCP server for persistent, intelligent memory management across Claude Code sessions.
    -
  • F
    license
    B
    quality
    D
    maintenance
    MCP server for Cloudways enabling server management, app deployment, backups, SSL, environment variables, and monitoring via Claude Code.
    12
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Secure MCP server for Boomi Platform API integration with Claude Code. Enables natural language interaction with Boomi Platform APIs, including managing accounts, processes, components, deployments, schedules, and more.
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server for LobsterVault, enabling AI agents to securely store, retrieve, manage, and share encrypted secrets with KMS envelope encryption, including environment variable injection.
    11
    6 npm
    MIT