惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
博客园 - 司徒正美
C
Check Point Blog
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
IT之家
IT之家
B
Blog
博客园_首页
量子位
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
J
Java Code Geeks
H
Help Net Security
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News

Blog on 1Password Blog

Why secure-by-design is an incentives problem, with Bob Lord | 1Password NIST and AI agents: 1Password’s approach to agent identity | 1Password Go beyond device health with External Checks in 1Password Device Trust | 1Password Natoma and 1Password help enterprises scale AI securely with governed agent access | 1Password New integrations between 1Password SaaS Manager and EPM | 1Password A first step toward post-quantum security | 1Password RSA 2026: Leading the way to secure agentic AI | 1Password How 1Password is Building a Culture of AI Fluency Through AI Champions | 1Password 1Password vs. Keeper Security: A comparison | 1Password 1Password vs. LastPass: Which is right for you? | 1Password Secure MCP credentials with 1Password and Runlayer | 1Password The next layer of AI security | 1Password Building the next chapter of Go-to-Market in EMEA | 1Password Automating SOC workflows with 1Password Enterprise Password Manager | 1Password Automated Provisioning hosted by 1Password: A Simpler, Smarter Way to Manage Access | 1Password Introducing 1Password® Unified Access: Identity Security for Humans and Their AI Agents | 1Password Next-generation automated provisioning, without compromising zero-knowledge security | 1Password Bitwarden vs. 1Password: Which password manager is right for you? | 1Password Password Manager for Families, Enterprise & Business | 1Password | 1Password How to wrangle SaaS contract renewals | 1Password Stop trusting consumer browsers with work credentials | 1Password IAM stops at sign-in. Your credentials do not. | 1Password Your digital pit crew: a 10-minute pre-race security checklist | 1Password 1Password Device Trust is coming to EMEA | 1Password The identity transformation: Analyst and CIO insights | 1Password Why now is the moment to join 1Password Go-To-Market | 1Password Identity and Accountability in the Age of AI Agents | 1Password How 1Password secures agent architectures | 1Password 1Password becomes the first global partner to transact through Express Private Offers in AWS Marketplace | 1Password Start Learning on 1Password Academy | 1Password
Securing MCP servers with 1Password: Stop credential expo...
info@1password.com (Nancy Wang and Robert Menke) · 2025-11-19 · via Blog on 1Password Blog

If you’ve built anything with AI tools lately…

You’ve probably seen a file like this sitting in your project root:

{ "tools": {     "github": {       "endpoint": "https://api.github.com",       "auth": {         "token": "ghp_your-secret-token"       }     }   } }

That’s a typical mcp.json, the file many agentic development environments (like Cursor or Claude Code) use to tell an MCP server what APIs it can call and what credentials to use.

It’s handy. It works. It’s also a plaintext secret waiting to leak.

Push that repo to GitHub, sync it to a teammate, or even forget to .gitignore it, and your API key’s gone.

Shout-out: the developer who started a trend

One of the nicest parts of working in security is seeing the community invent safe patterns before vendors even document them.

A developer who goes by @codekiln wrote a great how-to showing how to secure Cursor’s mcp.json with the 1Password CLI.

Their approach is simple: instead of hardcoding tokens in your config, reference them from your 1Password vault and inject them at runtime using op run.

Here’s the core idea they shared:

op run --env-file=.env -- cursor mcp-server start

It’s small, but it changes everything. No plaintext credentials. No manual copy-paste. No tokens lying around in Git history.

You can read their full guide here: How to set up Cursor MCP with 1Password GitHub tokens.

“What 1Password is doing to secure agent configurations is exactly the future we envisioned when we created Hooks,” said Travis McPeak, Head of Security at Cursor. “Developers shouldn’t have to choose between security and productivity.” 

Pull secrets at runtime instead of storing them

This pattern works for any MCP or AI tool that uses environment variables for authentication: Cursor, Claude Code, local LangChain MCP servers, you name it.

You don’t have to wait for new SDKs or integrations. You can do it today with the 1Password CLI (op). Let’s walk through implementation: 

Step 1: Store your secrets in 1Password

Create a vault item for each token you need. For example:

  • Vault: AI

  • Item: GitHub Access Token

  • Field: token

Then grab that secret via a secret reference:

op read "op://AI/GitHub Access Token/token"

Format reminder:

op://<vault>/<item>/<field>

These are pointers, not real values. Only 1Password can resolve them when you launch a process with the CLI.

Step 2: Reference them in your .env

Your .env now looks like this:

GITHUB_TOKEN=op://AI/GitHub Access Token/token

OPENAI_API_KEY=op://AI/OpenAI Key/key

Each variable is a link to an encrypted secret, not the secret itself.

Step 3: Start your MCP server with op run

Wrap your command in op run to fetch and inject secrets at runtime:

op run --env-file=.env -- mcp-server start

Here’s what happens:

  1. op run reads your .env.

  2. It resolves any op:// references.

  3. It decrypts those secrets in memory.

  4. It sets them as environment variables for that process.

  5. When the process exits, the secrets disappear.

Verify it yourself:

op run --env-file=.env -- printenv | grep GITHUB_TOKEN

Outside of that shell, the token doesn’t exist.

Step 4: Keep mcp.json clean

Once your env variables are ready, your config can stay simple:

{   "tools": {     "github": {       "endpoint": "https://api.github.com",       "auth": { "token": "${GITHUB_TOKEN}" }     }   } }

You can safely version-control this file. No secrets, no cleanup commits.

Why this works

Common problem

Fixed by

Plaintext secrets in code

Store them in 1Password vaults

Shared .env files

Use secret references

Secrets hanging around in memory

Decrypt only during process runtime

Manual rotation

Centralized management in 1Password

Audit gaps

Built-in logging and access control

You’re not changing how your dev tools work. Just how they get credentials.