MCP Server

EnvNest exposes an MCP (Model Context Protocol) endpoint so AI coding tools can read and write secrets on your behalf. Requests are token-authenticated and RBAC-gated — the token's permissions determine exactly which tools are available and which resources can be accessed.

Endpoint

All MCP calls use a single HTTP endpoint:

POST https://app.envnest.dev/mcp

JSON-RPC 2.0 over HTTP. The bearer token in the Authorization header controls which tools are registered and what resources can be accessed.

Authentication

Generate a service account token from the EnvNest dashboard and pass it as a bearer token in every request:

Authorization: Bearer <your-service-account-token>

The fastest way to configure this for your project is:

$ envnest ai init

This writes your active profile token into the MCP config for every detected AI tool in the current project directory.

Available Tools

All 11 tools are automatically available through any MCP-compatible AI coding tool. Read-only tokens only see read tools in the tool list — write tools are hidden entirely.

ToolDescriptionRequired permission
envnest_list_projectsList all projects accessible to the tokenenvironment.secrets.read
envnest_list_environmentsList environments in a projectenvironment.secrets.read
envnest_list_secretsList secret keys in an environment (values masked by default)environment.secrets.read
envnest_get_secretFetch the decrypted value of a single secretenvironment.secrets.read
envnest_set_secretCreate or update a secretenvironment.secrets.write
envnest_delete_secretSoft-delete a secretenvironment.secrets.write
envnest_sync_pullExport secrets as .env / JSON / YAMLenvironment.secrets.export
envnest_sync_pushImport secrets from a local file into an environmentenvironment.secrets.write
envnest_sync_diffShow differences between local and remote secret stateenvironment.secrets.export
envnest_analyzeAI risk analysis and secret grouping (uses EnvNest AI quota)environment.secrets.read
envnest_create_environmentCreate a new environment in a projectenvironment.secrets.write

Manual Setup

If you prefer to configure your AI tool manually instead of using envnest ai init:

Claude Code

Add to .claude/settings.json:

{
  "mcpServers": {
    "envnest": {
      "url": "https://app.envnest.dev/mcp",
      "headers": {
        "Authorization": "Bearer <your-token>"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "envnest": {
    "url": "https://app.envnest.dev/mcp",
    "headers": {
      "Authorization": "Bearer <your-token>"
    }
  }
}

Windsurf

Add to .windsurf/mcp.json:

{
  "envnest": {
    "url": "https://app.envnest.dev/mcp",
    "headers": {
      "Authorization": "Bearer <your-token>"
    }
  }
}

Codex

Add to .codex/mcp.json:

{
  "envnest": {
    "url": "https://app.envnest.dev/mcp",
    "headers": {
      "Authorization": "Bearer <your-token>"
    }
  }
}

Self-Hosted

For self-hosted EnvNest instances, replace the endpoint URL with your instance domain:

{
  "envnest": {
    "url": "https://your-instance.com/mcp",
    "headers": {
      "Authorization": "Bearer <your-token>"
    }
  }
}

The MCP endpoint is enabled by default. To disable it, set ENVNEST_MCP_ENABLED=false in your instance .env.

When using envnest ai init, the URL is taken from your active profile automatically — no manual URL configuration needed.