TLDR InfoSec · STRATEGIES & TACTICS

SECURING MCP SERVERS WITH 1PASSWORD

1password.com3 min read

Summary from the TLDR InfoSec newsletter

MCP (Model Context Protocol) server configurations used by AI development tools like Cursor and Claude Code typically store plaintext API keys in mcp.json files, creating a risk of credential exposure when repositories are pushed to version control or shared with teammates. Developers can eliminate this risk by storing secrets in 1Password vaults, referencing them using op://vault/item/field syntax in .env files, and launching MCP servers with the 1Password CLI command op run --env-file=.env to dynamically inject credentials at runtime without persisting them on disk. This pattern ensures secrets are decrypted only in memory during process execution and automatically disappear when the process exits, preventing accidental exposure in Git history while maintaining developer productivity.