Home / Servers / Netlify API / set_env_var_value

Set a value on an environment variable

An MCP tool from the Netlify API server, hosted on mcp.hjlabs.in.

Set a value on an environment variable Updates or creates a new value for an existing environment variable. [PATCH /accounts/{account_id}/env/{key}]

Name on the gateway: netlify_api__set_env_var_value · may change things.

Parameters

NameTypeDescription
account_id requiredstringScope response to account_id
key requiredstringThe existing environment variable key name (case-sensitive)
site_idstringIf provided, update an environment variable set on this site
contextall | dev | dev-server | branch-deploy | deploy-preview | production | branchThe deploy context in which this value will be used. dev refers to local…
context_parameterstringAn additional parameter for custom branches. Currently, this is used for…
valuestringThe environment variable's unencrypted value

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "netlify_api__set_env_var_value",
  "arguments": {
    "account_id": "…",
    "key": "…"
  }
}

Or connect the Netlify API server directly, which lists 188 tools including this one:

Run in your terminal
claude mcp add --transport http hj-netlify-api https://mcp.hjlabs.in/mcp/netlify-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the set a value on an environment variable tool with account_id set to ….

More from Netlify API