---
title: Access Control for MCP
description: >-
  Control who can use the Datadog MCP Server, whether agents can write, and
  which actions each AI client can perform.
breadcrumbs: Docs > Account Management > Access Control > Access Control for MCP
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Access Control for MCP

The [Datadog MCP Server](https://docs.datadoghq.com/mcp_server.md) lets AI agents and clients, such as Claude Code, Cursor, and ChatGPT, read and act on Datadog data on behalf of a signed-in user. You can control which users can access the MCP Server, whether they can write through it, and which actions each AI client can perform, even when the user can perform those actions elsewhere in Datadog.

Datadog evaluates MCP access in layers. A request through the MCP Server succeeds only if every layer allows it:

| Layer | Control                                                                               | Scope                              | Default                                                                                         |
| ----- | ------------------------------------------------------------------------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------- |
| 1     | MCP Access organization setting                                                       | Entire organization                | On                                                                                              |
| 2     | MCP Write Access organization setting                                                 | Entire organization                | Off                                                                                             |
| 3     | IP allowlist                                                                          | Entire organization                | Off                                                                                             |
| 4     | MCP Read and MCP Write role permissions                                               | Per role                           | - Datadog Read Only role: MCP Read- Datadog Standard and Admin roles: MCP Read and MCP Write    |
| 5     | OAuth application scopes, or access token scopes for connections that don't use OAuth | Per AI client (OAuth) or per token | - OAuth: All requested scopes allowed- Access tokens: Scopes selected when the token is created |
| 6     | Standard Datadog access controls                                                      | Per user, resource, and dataset    | Same as in the Datadog UI and API                                                               |

The MCP Server never grants a user more access than they already have in Datadog. Each layer can only narrow access further.

## Enable or disable the Datadog MCP Server{% #enable-or-disable-the-datadog-mcp-server %}

The MCP Access organization setting controls whether anyone in your organization can use the Datadog MCP Server. It is enabled by default.

When MCP Access is disabled, no user can access any MCP functionality, regardless of their role permissions.

To change this setting, you must be an organization administrator.

1. Navigate to [Organization Settings > MCP](https://app.datadoghq.com/organization-settings/mcp).
1. Toggle MCP Access on or off.

## Enable or disable MCP write access{% #enable-or-disable-mcp-write-access %}

The MCP Write Access organization setting controls whether agents can create, modify, or delete resources through the MCP Server. It is disabled by default.

When MCP Write Access is disabled, the MCP Server hides write tools from all users, regardless of their role permissions. Read tools remain available to users with the MCP Read permission.

To change this setting, you must be an organization administrator.

1. Navigate to [Organization Settings > MCP](https://app.datadoghq.com/organization-settings/mcp).
1. Toggle MCP Write Access on or off.

{% alert level="info" %}
Enabling MCP Write Access does not let every user write. Each user also needs the MCP Write permission and the standard write permission for the resource, such as Monitors Write.
{% /alert %}

## Restrict network access{% #restrict-network-access %}

To control which networks can connect to the Datadog MCP Server, enable the [IP allowlist](https://docs.datadoghq.com/account_management/org_settings/ip_allowlist.md). When the IP allowlist is enabled, users cannot connect to the MCP Server from IP addresses outside the allowlist, even if they have the required permissions.

## Control MCP access for specific users{% #control-mcp-access-for-specific-users %}

Use role permissions to give specific users different MCP access from the rest of your organization. To turn off MCP access or MCP write access for every user, use the organization settings instead.

Two role permissions control MCP access:

| Permission | Internal name | Grants                                                                                                       |
| ---------- | ------------- | ------------------------------------------------------------------------------------------------------------ |
| MCP Read   | `mcp_read`    | Use MCP tools that read data.                                                                                |
| MCP Write  | `mcp_write`   | Use MCP tools that create or modify resources. Requires MCP Write Access to be enabled for the organization. |

By default, the Datadog Read Only role has MCP Read, and the Datadog Standard and Admin roles have both MCP Read and MCP Write.

To give specific users MCP access that differs from the managed roles, assign them a [custom role](https://docs.datadoghq.com/account_management/rbac.md?tab=datadogapplication#custom-roles). For example, to let a group of users write in Datadog but only read through the MCP Server, create a custom role that includes MCP Read but not MCP Write, and assign it to those users.

1. Navigate to [Organization Settings > Roles](https://app.datadoghq.com/organization-settings/roles).
1. Select a custom role, or click New Role to create one.
1. Click Edit Role.
1. Under MCP, select or clear MCP Read and MCP Write.
1. Click Save.

## Restrict actions for a specific AI client{% #restrict-actions-for-a-specific-ai-client %}

Each AI client that connects to the MCP Server through OAuth, such as Claude Code, is registered as an OAuth application in your organization. Each application requests a set of scopes, which correspond to Datadog permissions.

Use [Application Scope Management](https://docs.datadoghq.com/account_management/org_settings/mobile_third_party_access.md#application-scope-management) to remove scopes from an AI client's OAuth application. A removed scope blocks that action through the AI client, even if the user has permission to perform it elsewhere in Datadog. For example, a user with Dashboards Write can still edit dashboards in the Datadog UI, but cannot edit them through Claude Code if you remove the `dashboards_write` scope from the Claude Code OAuth application.

Scope changes apply to every user in your organization who uses that AI client.

### Prerequisites{% #prerequisites %}

You need the Datadog Admin role, or a role with both the Org Authorized Apps Read (`org_authorized_apps_read`) and Org Authorized Apps Write (`org_authorized_apps_write`) permissions.

### Manage scopes{% #manage-scopes %}

1. Navigate to [Organization Settings > Mobile and Third-Party Access](https://app.datadoghq.com/organization-settings/oauth-applications).
1. Click the OAuth application for the AI client you want to restrict.
1. Click the Scopes tab.
1. Clear the Allowed checkbox for each scope you want to block.
1. Clear Automatically allow new scopes so that scopes the AI client requests in the future are blocked until an administrator allows them.
1. Click Save.

**Note**: Removing a scope revokes existing authorizations that include that scope. Affected users must reauthorize the AI client to regain access with the remaining allowed scopes. Adding a scope does not add it to existing authorizations; users must reauthorize to receive it.

### Example: Allow agents to write only to Notebooks{% #example-allow-agents-to-write-only-to-notebooks %}

To let agents read data across Datadog but only write to Notebooks:

1. Enable MCP Write Access for your organization.
1. Confirm that users have both the MCP Read and MCP Write permissions.
1. On the AI client's OAuth application, keep all read scopes and `notebooks_write` allowed, and clear the Allowed checkbox for every other write scope.
1. Clear Automatically allow new scopes, then click Save.

Users can still perform other write actions in the Datadog UI, subject to their role permissions.

### Limit connections that don't use OAuth{% #limit-connections-that-dont-use-oauth %}

Application scopes restrict MCP connections that authenticate through OAuth. A user who configures an AI client with a personal or service access token, or with an API key and application key, bypasses the OAuth application's scopes. That connection has the access of the token or key instead.

When an AI client cannot use OAuth, such as on a server or in a CI environment, connect it with an access token:

- Use a [Personal Access Token (PAT)](https://docs.datadoghq.com/account_management/personal-access-tokens.md) for an individual user. Every PAT requires scopes and an expiration date, so the token carries only the permissions the agent needs and stops working when it expires.
- Use a [Service Access Token (SAT)](https://docs.datadoghq.com/account_management/service-access-tokens.md) for a [service account](https://docs.datadoghq.com/account_management/org_settings/service_accounts.md) that has only the required permissions. Select only the scopes the agent needs. SATs can be created with no expiration, so set an expiration date unless the workflow requires a long-lived token.

{% alert level="warning" %}
Datadog does not recommend API and application keys for MCP connections. Application keys are unscoped by default and never expire. If an AI client uses an API key and application key, replace them with a PAT or SAT.
{% /alert %}

To limit who can create these credentials, restrict the User App Keys and Org App Keys Write [permissions](https://docs.datadoghq.com/account_management/rbac/permissions.md#api-and-application-keys). These permissions control PATs as well as application keys. Creating SATs also requires Service Account Write.

## Keep credentials out of AI agent conversations{% #keep-credentials-out-of-ai-agent-conversations %}

Never share a token, API key, or application key with an AI agent. This includes pasting a credential into a prompt, or asking an agent to write one into a configuration file. Anything you send to an agent becomes part of its context. The agent can repeat it in output, write it to files or logs, or send it to its model provider.

Instead:

- **Use OAuth** where your AI client supports it. The client obtains and stores credentials for you, so you never handle a secret.
- **Enter tokens in your MCP client's configuration yourself**, not through the agent. If your client can read header values from environment variables, store the token in an environment variable or a secrets manager and reference it from the configuration.
- **In CI and other automated environments**, store the token in the platform's secret store and inject it at runtime.

If a credential is exposed to an agent, revoke it and create a new one. See [What to do if an API or application key was exposed](https://docs.datadoghq.com/account_management/api-app-keys.md#what-to-do-if-an-api-or-application-key-was-exposed).

## Standard access controls apply to MCP{% #standard-access-controls-apply-to-mcp %}

In addition to the MCP-specific controls on this page, the MCP Server follows the same access controls the user has everywhere else in Datadog. The MCP Server calls Datadog APIs with the caller's credentials: the signed-in user's, or the service account's when the connection uses a SAT. As a result:

- **Role permissions**: A user needs the standard permission for the underlying resource in addition to MCP Read or MCP Write. For example, creating a monitor through the MCP Server requires Monitors Write. See [Role Based Access Control](https://docs.datadoghq.com/account_management/rbac.md).
- **Restricted datasets**: [Data Access Control](https://docs.datadoghq.com/account_management/rbac/data_access.md) and [log restriction queries](https://docs.datadoghq.com/logs/guide/logs-rbac-permissions.md?tab=ui#create-a-restriction-query) limit which logs, spans, and other telemetry the MCP Server returns to a user.
- **Restricted assets**: [Granular access controls](https://docs.datadoghq.com/account_management/rbac/granular_access.md) on dashboards, monitors, notebooks, and other resources apply to MCP requests. A user cannot view or edit a resource through the MCP Server if they cannot view or edit it in the Datadog UI.

## Audit MCP activity{% #audit-mcp-activity %}

Every MCP Server tool call is recorded in [Audit Trail](https://docs.datadoghq.com/account_management/audit_trail.md) with the tool name, arguments, user identity, and client. See [Track tool calls in Audit Trail](https://docs.datadoghq.com/mcp_server.md#track-tool-calls-in-audit-trail).

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Datadog MCP Server](https://docs.datadoghq.com/mcp_server.md)
- [Set up the Datadog MCP Server](https://docs.datadoghq.com/mcp_server/setup.md)
- [Datadog Role Permissions](https://docs.datadoghq.com/account_management/rbac/permissions.md)
- [Mobile and Third-Party Access](https://docs.datadoghq.com/account_management/org_settings/mobile_third_party_access.md)
