Doppler Logo
Dec 02, 2026
6 min read

How to choose MCP servers for secrets management

How to choose MCP servers for secrets management

Giving an AI agent access to a secret also gives it a path to whatever that credential can reach. The level of access you give the agent determines how much control it has over those credentials and the systems they can access.

While some workflows only need credentials available to the running process, others require an agent to retrieve them during a task. There are also workflows that need the agent to create or rotate those credentials.

This article compares three credential access models for Model Context Protocol (MCP) servers: read-write access, read-only secret retrieval, and context-only access. It explains where each model fits, what it enables, and how to choose the credential access level that matches the agent's job.

Credential access models for MCP servers

MCP servers connect AI agents to real infrastructure through delegated credentials. The permissions attached to that access determine what the agent can do with those systems and how easy it is to secure and audit its actions. Broader credential access gives an agent more capability to act on a connected system, so the access model becomes part of how you control those actions.

The three access models support different workflows, from managing credentials to retrieving them for authenticated requests or working with the structure of a secrets environment. Choosing a model should be based on the work you need the agent to do and the access level that work requires.

The differences become clearer when you look at how each model handles credentials.

Model 1: Read-write secret access

A read-write MCP server exposes tools that allow an agent to create, retrieve, update, and delete secrets in a secrets manager.

Tasks such as credential provisioning, secret rotation, and the generation of ephemeral tokens for CI/CD systems rely on this access model. What's common among them is that they require an agent to make some sort of change to credentials. However, access should still be limited to the resources required for the task.

Write access, for example, increases the impact of an agent being manipulated. A prompt injection could cause the agent to misuse a tool, potentially deleting or updating secrets in ways that benefit an attacker. It is important that high-impact credential changes require an approval step.

This level of access, though, is often unnecessary for coding agents or general-purpose assistants, where instructions can come from untrusted input. They typically work with existing project configuration, and their tasks may involve understanding which credentials a project expects or retrieving a value to run a task, rather than managing credentials themselves. The other models may be better if the agent does not need write access. The table below summarizes when to use the read-write access model.

When to useWhat it enablesWhat it requires

Automated credential provisioning

Create credentials for services as part of a deployment workflow

Least-privilege credentials and narrowly scoped tools

Secret rotation

Update credentials through an automated rotation workflow

Scoped permissions and controlled write operations

CI/CD credential management

Create short-lived credentials during CI/CD workflows

Environment-specific credentials and protected write access

Model 2: Read-only secret retrieval

A read-only MCP server can retrieve secret values but cannot create, update, or delete them. This gives the agent access to the credentials it needs for a task while preventing it from modifying stored secrets.

This model fits workflows where the agent needs a credential value but does not need to manage that credential. For example, an agent may retrieve an environment-specific API key through the MCP server and use it to make an authenticated request to an external service. While read-write access can support the same task, it also gives the agent permission to modify credentials.

However, once a secret value is retrieved, it becomes part of the execution path for that task. While read-only access limits what the agent can do to the secrets store, it does not govern what happens to values once they are in the agent context. The agent can still use the retrieved value through its other tools or disclose it through their outputs. So, the credential itself should be scoped to the relevant resources and environment. Deliberately separating credentials between environments can further limit access.

It is also important to keep the retrieved value out of logs and traces. Audit records should capture the access event, such as who accessed a credential, what was accessed, and when, without recording the secret itself.

The Doppler MCP server supports this model with a --read-only mode that hides write tools while retaining tools that read secret values and download configs. This prevents the agent from modifying secrets through the exposed MCP tools.

The table below gives a quick overview of when to use this model.

When to useWhat it enablesWhat it requires

Application workflows requiring secret values

Retrieve database credentials, API keys, or other secrets required for an application to run

Access limited to the required secret and environment

Authenticated service access

Retrieve an existing credential so an agent or workflow can authenticate with an external service

Secure handling of retrieved values and redacted logs

CI/CD workflows using existing credentials

Retrieve credentials needed by a deployment or automation job without allowing the workflow to modify them

Separate, scoped credentials and clear access boundaries

Model 3: Context-only access

A context-only MCP server gives the agent read-only access to the structure and metadata of a secrets configuration. It can inspect which projects and configurations exist and which keys are defined, but it does not return secret values.

This model is useful when an agent needs to work solely with an application's configuration. For example, an agent working on a deployment can inspect the project configuration to confirm that the application expects DATABASE_URL, API_KEY, and REDIS_URL. It can then write or update the deployment configuration using those key names without accessing their values. This limits credential exposure through the MCP interface: for example, a prompt injection cannot retrieve live credentials through an interface that doesn't expose them.

For coding agents, this model works well when the main task is understanding how an application is set up and writing code around it. It becomes limiting when the agent itself needs the credential value to make an authenticated API request. In that case, the credential must reach the agent through another mechanism, or the workflow needs a read-only model that lets the MCP server retrieve the value.

With the three access models in view, the choice comes down to what the agent needs to do with the credentials.

How to choose

The right access model depends on what the agent needs to do during the workflow. Start with the task, then give the agent only the credential access required to complete it.

Task typeAgent needsRight model

Coding and configuration work

Understand the available projects, configs, and keys without accessing their values

Context-only

Authenticated API calls

Retrieve the credential needed to make a request

Read-only

Automated credential provisioning

Create, update, or rotate credentials as part of the workflow

Read-write

For an AI coding agent, begin with the lowest access level that supports the task. If the workflow requires the agent to retrieve a secret value, use read-only access and keep the retrieval path scoped and audited. If it needs to create, update, or rotate credentials, the workflow requires read-write access with approval gates for destructive operations.

Final thoughts

Credential access should stay tied to the agent's actual workflow. For an AI coding agent, keeping secret values outside the agent context limits what the agent can access. It can still understand the project's configuration and work with the keys it needs. Read-only access becomes necessary when the agent needs to retrieve a credential for an authenticated workflow. Read-write access becomes necessary when the workflow requires the agent to create or rotate credentials, with appropriate gates.

Credential access matters, but it's only one part of selecting an MCP server. Before connecting a third-party MCP server, verify its source and credential handling, and review how it authenticates to backend services.

FAQ

An MCP server for secrets management connects an AI agent to a secrets manager through the MCP. Depending on its access model, it can let the agent manage secrets, retrieve existing secret values, or inspect configuration structure and metadata.

Enjoying this content? Stay up to date and get our latest blogs, guides, and tutorials.

Related Content

Explore More

Top Content

Explore More

The secrets manager built for the agentic age

Protect secrets across your entire stack with centralized management, automated workflows, and the flexibility to deploy in the cloud or on-prem.