Use the local 1Password MCP server for all environment variable configuration. Its tools return variable names, never secret values, so secrets stay in 1Password.
Use When
- The user mentions 1Password Environments, 1Password Developer Environments, the 1Password MCP server, or local
.envfiles from 1Password. - The user asks to set up, mount, create, or sync a project
.envfile from a secret manager and 1Password is available. - The user asks to configure repo environment variables, API keys, tokens, credentials, or secrets securely with 1Password.
- The user wants to list or compare Environment variable names without exposing secret values.
Do not use this skill for unrelated password-manager tasks, arbitrary local .env file parsing, or non-1Password secret stores unless the user asks to migrate that configuration into 1Password.
Requirements
This skill depends on the local 1Password MCP server. If its tools are not available in the current session, help the user finish setup instead of improvising:
-
Install the 1Password desktop app and enable the MCP server in Settings > Developer. On business accounts, the setting is unavailable until an administrator enables the feature in the "Sharing & Permissions" policies section of the admin dashboard.
-
The desktop app installs the
1password-mcpalias on thePATH(supported on macOS, Windows, and Linux). -
Configure the client to launch
1password-mcpas a local MCP server. For Codex, add this to~/.codex/config.toml:[mcp_servers.1password] command = "1password-mcp"
The 1Password desktop app asks the user to approve each client connection, and environment access can require additional approval.
Tools
The local server exposes these tools:
authenticate: authenticate with the 1Password desktop app and return the account ID.list_environments: list Developer Environments for an account.create_environment: create a new Developer Environment.rename_environment: rename an existing Developer Environment.list_variables: list variable names in an Environment without returning values.append_variables: add or update Environment variables.create_local_env_file: mount an Environment as a local.envfile on macOS or Linux.list_local_env_files: list local.envmounts for an Environment.
It also exposes these documentation resources:
1password://docs/getting-started1password://docs/environments-guide
Workflow
- Call
authenticatefirst when you do not already have an account ID for this turn. The 1Password desktop app will ask the user to approve the connection. - Use
accountIdfor subsequent calls. Server docs may spell the returned value asaccount_id; MCP tool calls use camelCase parameters such asaccountIdandenvironmentId. - Call
list_environmentswith the returnedaccountIdbefore operating on an Environment, unless the user already provided a currentenvironmentId. - If the target Environment is ambiguous, ask the user which Environment to use instead of guessing.
- Use the
environmentIdreturned by the server for environment-level calls. - Prefer
list_variableswhen the user wants to inspect an Environment. It returns names only, not secret values. - Use
append_variablesonly when the user explicitly asks to add or update variables. - Use
create_local_env_filefor local.envmounts on macOS or Linux, and pass the absolutemountPaththe user wants. - Use
list_local_env_filesto check existing local mounts before creating a duplicate.
Common Flows
Mount 1Password as this repo's .env
- Call
authenticate. - Call
list_environments. - Ask the user to choose an Environment if the request does not identify one clearly.
- Call
list_local_env_filesfor the selected Environment to avoid duplicate mounts. - If the user says "here", "this repo", or "this project", use the current workspace's absolute
.envpath asmountPath. - Call
create_local_env_filewithaccountId,environmentId,environmentName, and the absolutemountPath. - Report the mount path and Environment name, but do not read the mounted
.envfile to verify it.
Inspect variables
- Call
authenticate. - Call
list_environmentsunless the user already gave anenvironmentId. - Use the
environmentIdreturned by the server for environment-level calls. - Call
list_variablesand summarize variable names only.
Add or update variables
- Confirm the user explicitly wants to create or update variables, and collect any missing names or values.
- Call
authenticateand resolve the target Environment. - Prefer calling
list_variablesfirst so you can tell whether the requested variable names already exist. - Call
append_variablesusing the active MCP tool schema exactly as exposed in the current session. - When the active schema accepts structured variable objects, use
{ "name": "API_KEY", "value": "...", "concealed": true }for secrets andconcealed: falseonly for non-sensitive values such as URLs or feature flags. - When the active schema exposes
variablesasstring[], do not send unsupported object fields. Use the string format required by that schema, and ask for clarification if the user's requested variable format is ambiguous.
Error Handling
- If authentication or environment access fails, tell the user the 1Password desktop app may need approval, unlocking, or account access.
- If the MCP tools are unavailable, follow the Requirements section above to help the user enable and configure the local MCP server.
- Local
.envmounts are documented for macOS and Linux only.
Safety
- Do not reveal, log, or echo secret values.
- Do not read a mounted
.envfile just to verify it exists; use the MCP tools instead. - Ask before creating or modifying Environment variables unless the user's request is already explicit.
- Treat local
.envmounts as sensitive even though 1Password does not persist plaintext secret contents to disk. - If a user pasted a secret into the chat, avoid repeating it back; refer to it by variable name.
Notes
- Official docs: https://www.1password.dev/environments and https://www.1password.dev/environments/mcp-codex-server
- This skill is also distributed as part of the 1Password Codex plugin (https://github.com/1Password/1password-codex-plugin), which configures the MCP server automatically.