envmcp
@griffithsbs
About envmcp
A lightweight way to use environment variables in your Cursor MCP server definitions.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"envmcp": {
"command": "npx",
"args": [
"envmcp",
"your-mcp-server",
"$DATABASE_URL"
]
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is envmcp?
envmcp is a command-line tool that loads environment variables from a file and substitutes $VARIABLE_NAME references in MCP server command arguments. It is designed for users of Cursor MCP servers who want to keep secrets out of configuration files.
How to use envmcp?
Prefix your MCP server command with envmcp. Use npx envmcp or install globally with npm install -g envmcp. Specify an optional custom env file with --env-file (or -e) flag. Example: npx envmcp --env-file .env my-mcp-server $DATABASE_URL. In MCP client config, change the command to npx and arguments to ["envmcp", "your-mcp-server", "$VARIABLE"].
Key features of envmcp
- Loads environment variables from
.env.mcpfiles. - Looks for
.env.mcpin current, parent, and home directories. - Replaces
$VARIABLE_NAMEreferences in command arguments. - Supports comments and quoted values in env file.
- Works with any MCP server command.
Use cases of envmcp
- Avoid exposing database passwords in MCP client configuration.
- Use different environment variables across development and production.
- Securely pass API keys without storing them in version control.
- Simplify switching between multiple service endpoints by changing one env file.
FAQ from envmcp
What does envmcp do?
envmcp reads a .env.mcp file, loads defined environment variables, and substitutes any $VARIABLE_NAME references in the command arguments before executing the MCP server.
How do I specify a custom environment file?
Use the --env-file <path> or -e <path> option to point to a specific file, e.g., npx envmcp --env-file /path/to/secrets.env my-mcp-server $API_KEY.
What if I need more features beyond envmcp?
The README suggests mcpipe which includes envmcp's functionality along with debugging tools and other capabilities.
Where does envmcp look for the env file?
By default, it searches for .env.mcp in the current directory, then parent directories, and finally in the home directory (~/.env.mcp). If --env-file is given, it uses that file directly.
What format does the environment file use?
Each line is a KEY=VALUE pair. Lines starting with # are comments. Values can be quoted (e.g., QUOTED_VALUE="value with spaces").
Frequently asked questions
What does envmcp do?
envmcp reads a `.env.mcp` file, loads defined environment variables, and substitutes any `$VARIABLE_NAME` references in the command arguments before executing the MCP server.
How do I specify a custom environment file?
Use the `--env-file <path>` or `-e <path>` option to point to a specific file, e.g., `npx envmcp --env-file /path/to/secrets.env my-mcp-server $API_KEY`.
What if I need more features beyond envmcp?
The README suggests [mcpipe](https://github.com/griffithsbs/mcpipe) which includes envmcp's functionality along with debugging tools and other capabilities.
Where does envmcp look for the env file?
By default, it searches for `.env.mcp` in the current directory, then parent directories, and finally in the home directory (`~/.env.mcp`). If `--env-file` is given, it uses that file directly.
What format does the environment file use?
Each line is a `KEY=VALUE` pair. Lines starting with `#` are comments. Values can be quoted (e.g., `QUOTED_VALUE="value with spaces"`).
Basic information
More Other MCP servers

Lemon.io
lemon-ioRequest dedicated senior developers to work on your project, write job descriptions, and prep technical interviews — all without leaving your Claude chat. Just describe what you need, and Lemon.io MCP does the rest. 1–3

Glasswarp
GlasswarpSee and control a real Windows PC you own — from any MCP client, locally or remotely. Observe (UIA + screenshots), click/type/drag/scroll, launch apps, owner Live View. BYOH: your machine, your key.
Awesome Mlops
visengerA curated list of references for MLOps
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
Inbox Zero AI
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Comments