envmcp

by griffithsbs

31 6.3k downloads Not rated yet MIT license

About

A lightweight way to use environment variables in your Cursor MCP server definitions.

Details

License
MIT license

Explore

- Loads environment variables from .env.mcp files.
- Looks for .env.mcp in current, parent, and home directories.
- Replaces $VARIABLE_NAME references in command arguments.
- Supports comments and quoted values in env file.
- Works with any MCP server command.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name envmcp
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository


Prefix your server command with envmcp.

_Before (secrets exposed in config)_:

json
{
"my_database": {
"command": "my-mcp-server",
"args": ["postgresql://user:password@hostname/db"]
}
}
_After (secrets in ~/.env.mcp)_:
json
{
"my_database": {
"command": "npx",
"args": ["envmcp", "my-mcp-server", "$DATABASE_URL"]
}
}


DATABASE_URL=postgresql://user:password@localhost/db
API_KEY=your-secret-api-key

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "envmcp": {
            "envmcp": {
                "command": "npx",
                "args": [
                    "envmcp",
                    "your-mcp-server",
                    "$DATABASE_URL"
                ]
            }
        }
    }
}

McpServers

{
    "envmcp": {
        "command": "npx",
        "args": [
            "envmcp",
            "your-mcp-server",
            "$DATABASE_URL"
        ]
    }
}
npm version total downloads

Use environment variables in your Cursor MCP server definitions.

> 💡 Looking for more features? Consider mcpipe (npm) which includes envmcp's functionality as well as debugging tools and other capabilities.

Quick Start

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.