Store an MCP server’s upstream API key in a secrets manager or vault and deliver it to the server at runtime—not in source code, a prompt, a container image, or a plaintext configuration file. Store OAuth tokens retained by a local MCP client in the operating system’s secure credential store. Keep those credentials separate: an OAuth token presented to an MCP server is not automatically an API credential for the server’s upstream service.
First, identify which credential you are protecting
“The MCP API key” can refer to different credentials in different parts of a deployment. Their storage and handling depend on who presents the credential and what resource it authorizes.
As an Amazon Associate I earn from qualifying purchases.
| Credential | Who holds or presents it | What it is for | Where it belongs |
|---|---|---|---|
| Upstream API key or credential | The MCP server | Authenticates the server to an upstream API it calls | A vault or secrets manager, injected into the server at runtime |
| MCP OAuth access or refresh token | The MCP client | Authorizes the client to access an MCP resource | The client platform’s secure credential store |
| Inbound credential for a remote MCP server | The MCP client presents it; the remote server validates it | Authenticates or authorizes access to that MCP server | Managed according to the client’s secure token-storage and the server’s validation requirements; it is not an upstream API key |
The Model Context Protocol’s Authorization Security Considerations, specification revision 2026-07-28, require a server to validate that a token is intended for that server and state that it must not pass the token received from the client through to an upstream service. If the MCP server needs access to an upstream API, it must obtain and use a separate upstream credential.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallStore server-side upstream credentials outside the application
Use a vault or secrets manager
Keep an upstream key in a secrets manager or vault, then make it available to the MCP server at runtime through a controlled mechanism. OWASP’s MCP01:2025 guidance gives AWS Secrets Manager and HashiCorp Vault as examples. Choose a store that fits the deployment and provides access controls appropriate to the credential; the examples are not a requirement to use either product.
#1 Best Overall
- POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
- WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
- FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
- TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
- BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
Do not commit the key to source control, bake it into a container image or build output, or leave it in a static configuration file that may be copied or checked in. Runtime injection reduces the number of places where a durable secret can persist, though it does not remove the need to control access to the running process and its diagnostics.
Use distinct, least-privilege credentials
- Where the upstream provider supports it, issue a distinct credential for each MCP server or agent so access can be attributed and contained without affecting unrelated services.
- Limit each credential to the operations and resources the server actually needs. Avoid broad permissions and scopes.
- Keep development, test, and production credentials separate. Do not use a developer’s personal identity as the production agent identity when the provider offers an appropriate workload or agent identity.
- Restrict who and what can read the secret, and review access as the deployment changes.
Google Cloud’s MCP authentication guidance is provider-specific: it explains that standard API keys can authenticate only to services that do not require a principal, while services that require IAM need an identity-based approach. Do not assume that an API key is accepted by every MCP service or apply Google Cloud’s service rules to other providers.
Rank #2
- POWERFUL SECURITY KEY: The YubiKey 5C NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
- WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5C NFC secures 100+ of your favorite accounts, including email, password managers, and more
- FAST & CONVENIENT LOGIN: Plug in your YubiKey 5C NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
- MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
- PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
Keep secrets out of prompts, outputs, and diagnostics
Never paste a key into a prompt or return it in a tool result. Redact secrets from logs and telemetry, and limit access to diagnostic traces that could contain sensitive context. OWASP’s MCP01:2025 guidance also identifies configuration, model context, logs, telemetry, and vector stores as places to check when investigating possible secret exposure.
Protect OAuth tokens held by a local MCP client
For access and refresh tokens retained by a local client, use the operating system’s secure credential storage rather than plaintext MCP configuration or application settings. The OWASP MCP Security Cheat Sheet names macOS Keychain, Windows Credential Manager, and Linux Secret Service. The appropriate store depends on the client’s platform and implementation.
Rank #3
- POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
- WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
- FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
- MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
- PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
The MCP authorization guidance calls for secure token storage and OAuth best practices. It recommends short-lived access tokens and says public clients must rotate refresh tokens. Clients should request tokens for the intended resource, and servers must validate the intended audience. These token rules do not turn the client’s MCP token into a reusable credential for an upstream API.
Rotate an upstream key with a controlled cutover
A safe rotation is a replacement followed by verification and invalidation of the old credential. The exact overlap behavior, reload method, and revocation mechanism are provider- and implementation-specific; the protocol does not prescribe a universal overlap window or guarantee that two keys can be active at once.
Rank #4
- POWERFUL SECURITY KEY: The Security Key NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
- WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key NFC secures 100 of your favorite accounts, including email, password managers, and more.
- FAST & CONVENIENT LOGIN: Plug in your Security Key NFC via USB-A and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
- TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
- BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
- Check the issuer’s current instructions. Confirm how to create a replacement, whether old and new credentials can coexist, how revocation works, and whether the server must reload or restart to use an updated secret.
- Create the replacement credential. Give it only the required scope and permissions, and issue it for the correct environment and server or workload identity.
- Update the controlled secret source. Put the replacement in the vault or secrets manager; do not move it into source, a prompt, or a static configuration file as a shortcut.
- Reload or restart the MCP server if required. Follow the server implementation’s documented behavior so its running process actually receives the updated value.
- Verify a safe authenticated request. Confirm the server can reach the intended upstream API and that the credential permits only the required operations.
- Disable or revoke the old credential. Do this once the replacement is confirmed, following the issuer’s supported process and documented overlap behavior.
Before a production cutover that depends on overlap for availability, test the provider’s actual behavior in a non-production environment. Do not assume every issuer allows two active keys or that every server reloads secrets without a restart.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Set a rotation policy without inventing a universal interval
The cited MCP and OWASP guidance does not establish one calendar interval for rotating static upstream API keys. Set a policy based on the issuer’s lifecycle capabilities, organizational risk, credential scope, and ability to automate replacement. Prefer short-lived, scoped OAuth credentials where the service supports them and they suit the integration. Treat suspected exposure as an immediate rotation and revocation trigger.
Best Value
- POWERFUL SECURITY KEY: The YubiKey 5 is a versatile physical passkey that protects your digital life from phishing attacks. It ensures only you can access your accounts.
- WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 secures 100+ of your favorite accounts, including email, password managers, and more.
- FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 via USB and tap it to authenticate. No batteries, no internet connection, and no extra fees required.
- MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it.
- BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
Keep an access-controlled inventory of each credential’s owner, purpose, scope, environment, issuing service, secret-store reference, rotation trigger or policy, and revocation procedure. Record the reference and metadata—not the secret value. OWASP MCP01:2025 calls for lifecycle governance and regular audits.
Quick Recap
Respond immediately to suspected exposure
- Contain the credential. Revoke or disable the affected key or token and issue a replacement immediately, using the issuer’s supported process.
- Update dependent services. Put the replacement in the controlled store, reload or restart dependent server processes as needed, and verify authentication and limited permissions.
- Look for copies. Check relevant source history, deployment artifacts, MCP configuration, prompts and model context, tool results, traces, logs, and other applicable storage such as telemetry or vector stores. Remove exposed copies where practical.
- Review activity. Examine authentication attempts and access logs for unexpected use. OWASP’s MCP07:2025 guidance recommends logging authentication attempts and authorization decisions and correlating actions with identities. Reduce or suspend permissions while investigating if needed to contain risk.
- Close the gap. Add or improve secret scanning and redaction controls, document the incident, and identify why the credential crossed its intended boundary.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




