MCP.so
登录

envmcp MCP Server

@griffithsbs

基本信息

分类

其他

许可证

MIT

传输方式

stdio

作者

griffithsbs

关于 envmcp MCP Server

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

envmcp MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

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

envmcp MCP Server 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

点击上方按钮,在临时沙箱中运行此服务器并实时获取工具列表。

概览

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

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.

常见问题

1

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.

2

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`.

3

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.

4

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.

5

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"`).

评论

其他 分类下的更多 MCP 服务器