- An MCP configuration for the 1Password MCP server, which allows Claude Code to manage your Environments with secure authorization prompts.
- An agent skill that supplies Claude Code with end-to-end workflows for interacting with 1Password Environments.
- A hook that runs before Claude Code executes shell commands to confirm your locally mounted
.envfiles are set up correctly.
Requirements
- 1Password subscription
- 1Password for Mac, Windows, or Linux
- Claude Code
sqlite3installed and available in your PATH, for the validation hook. It’s pre-installed on Mac, and available through your package manager on Linux.
Platform supportThe 1Password MCP server and locally mounted
.env files are currently only supported on Mac and Linux. On Windows, the validation hook exits without a decision, so it never blocks Claude Code from running commands.Step 1: Set up your Environments
Before you get started, you can set up the Environments that Claude Code will interact with.- Create one or more Environments in 1Password to store your project secrets.
- Configure locally mounted
.envfiles for them.
.env file and mount a local .env file destination on your behalf.
Step 2: Install the plugin
The 1Password plugin is distributed from its GitHub repository . To install the plugin:-
Open your terminal, go to your project directory, then enter
claudeto start a Claude Code session. -
Add the 1Password marketplace:
-
Install the plugin:
-
To confirm the plugin installed correctly, enter
/plugin listand look for1Password.
1password-environments agent skill, and the MCP server configuration at the same time.
Step 3: Turn on the MCP server in 1Password
1Password Enterprise Password Manager admins can turn the MCP server feature on and off. To do so, sign in to your account on 1Password.com, then go to Policies > Agentic permissions and turn the Local MCP server option on or off as needed.
- Open the 1Password desktop app.
- Select your account or collection at the top of the sidebar, then navigate to Settings > Labs.
- Turn on the Enable local MCP server option.
- Go to Settings > Developer and select Integrate with MCP clients.
/mcp to open the MCP panel and check the status of the 1Password server.
Step 4: Use Claude Code to manage your Environments
Now that you have the plugin installed, you can ask Claude Code to manage your Environments on your behalf. When you first prompt Claude Code to access an Environment, you’ll get a secure authorization prompt from the 1Password desktop app that allows you to choose whether Claude Code has permission to list and create Environments.Have Claude Code import an Environment and make it available in your project
If you have a plaintext.env file in your codebase, you can ask Claude Code to import its variables into a 1Password Environment. Claude Code will create the Environment then mount it at the same file path as the original file, so your project secrets are available without being tracked by Git or stored in plaintext on your device.
The 1password-environments agent skill directs Claude Code to take the following steps when you prompt it to import an existing .env file into 1Password:
- Read the
.envfile to get its variable names and values, then pass the values to 1Password without printing them in chat. - Create the Environment, or resolve the one you named. If an Environment with the name already exists, Claude Code stops and asks how you want to proceed instead of creating a duplicate. You can choose to merge the new variables into the existing Environment or create a new Environment with a different name.
- Add the variables, with API keys, tokens, passwords, private keys, and connection strings set to concealed in 1Password.
- Mount the Environment at the original
.envfile’s path, then verify the resulting local.envfile.

Learn more about how local .env files work
The contents of locally mounted
.env files aren’t tracked by Git or stored on your device, and are only available at the moment you access them.Validate your local .env file setup
When Claude Code tries to run a command, the 1Password hook makes sure any locally mounted.env files from 1Password Environments are properly set up before the agent executes. If any required .env files are missing or invalid, the hook prevents the agent from running and the agent provides instructions for how to fix the issue.
By default, the hook checks the 1Password desktop app to find locally mounted .env files related to your project based on the file path destinations configured in your Environments.
To validate only specific files instead, create a .1password/environments.toml file at the root of your project with a mount_paths array.
Learn more about the local .env file validation hook
See how the hook discovers your mounted files, the validation modes you can configure, and how to use it with other agents and IDEs.
Manage your Environments from Claude Code
The 1Password MCP server lets you use Claude Code to manage your 1Password Environments with secure authorization prompts. The MCP server only sees variable names, and never returns secret values stored in 1Password to the agent. Your secrets stay safe in 1Password and are only accessed by authorized processes. You can prompt Claude Code to perform tasks like:- “List my 1Password Environments”
- “Create an Environment from my project
.envfile” - “Import
.envinto 1Password and mount it here” - “Mount my staging Environment as
.envin this repo” - “What variables are in my production Environment?”
- “Add a placeholder for my OpenAI API key”
- “Create a new Environment called
my-app-dev”
Learn more about the 1Password MCP server
See how the MCP server handles authorization, why your secrets stay out of the agent’s context, and how to use it with other MCP clients.
Telemetry
The validation hook emits opt-in telemetry so 1Password can understand plugin adoption and how often common failure modes happen, like a missing file or a disabled mount. Events are only recorded if you’ve turned on product telemetry in the 1Password desktop app. They include the hook name and version, the client, the validation mode, the number of mounts checked, and whether the hook allowed or blocked the command. They don’t include file paths, file contents, Environment names, or workspace paths. Telemetry runs after the hook returns its decision to Claude Code, so it can never change whether a command is allowed. To turn telemetry off:- Open the 1Password desktop app.
- Select your account or collection at the top of the sidebar, then select Manage Accounts.
- Select Usage data then deselect Share information about your usage.