---
title: Datadog Extension for VS Code & Cursor
description: >-
  Integrate Datadog telemetry and insights into your source code in VS Code and
  other code editors.
breadcrumbs: Docs > Datadog IDE Plugins > Datadog Extension for VS Code & Cursor
---

# Datadog Extension for VS Code & Cursor

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com



{% alert level="danger" %}
The Datadog extension for Visual Studio Code is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md) ().
{% /alert %}


{% /callout %}

## Overview{% #overview %}

The Datadog extension for VS Code and Cursor brings Datadog to your code editor to accelerate your development.

{% image
   source="https://docs.dd-static.net/images/ide_plugins/vscode/datadog-vscode-3.8c4c5fcdbd039c2dbe27432da26f3267.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/ide_plugins/vscode/datadog-vscode-3.8c4c5fcdbd039c2dbe27432da26f3267.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Datadog extension for VS Code and Cursor" /%}

The extension includes these features:

- **Model Context Protocol (MCP) Server**: Connect the editor's AI agent to production telemetry, tools, and context from Datadog.

- **Logs**: Gauge log volumes and search logs from your code.

- **Code Insights**: Stay informed about runtime errors, vulnerabilities, and flaky tests without leaving the code.

- **View in IDE**: Jump directly from code references in Datadog to your source files.

- **Code Security**: Detect and fix security issues before you commit, and write custom rules.

- **Exception Replay**: Debug your production code.

- **Fix in Chat**: Fix code errors, vulnerabilities, and flaky tests with AI-powered suggestions and explanations.

{% alert level="info" %}
Unless stated otherwise, all extension features are available for both VS Code and any other IDEs based on VS Code forks, such as Cursor.
{% /alert %}

## Requirements{% #requirements %}

- **Datadog account**: Most features require a Datadog account.

  - New to Datadog? [Learn more](https://www.datadoghq.com/) about Datadog's monitoring and security tools and sign up for a free trial.
  - If your organization uses a [custom sub-domain](https://docs.datadoghq.com/account_management/multi_organization.md#custom-sub-domains) such as `myorg.datadoghq.com`, you must indicate it using the `datadog.connection.oauth.setup.domain` setting in the IDE.

- **Git**: The extension works better when Git is enabled in the IDE. Ensure this is enabled by checking the `git.enabled` setting.

## Installation{% #installation %}

Installation steps may vary for other VS Code-based editors.

{% tab title="VS Code" %}
Install the extension either directly in the IDE, or from the web:

- **In VS Code**: Open the Extensions view (`Shift` + `Cmd/Ctrl` + `X`), search for `datadog`, and select the official extension from Datadog.

- **From the web**: Install from the extension's page on [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Datadog.datadog-vscode).

### MCP Server setup{% #mcp-server-setup %}

The extension includes access to the [Datadog Model Context Protocol (MCP) Server](https://docs.datadoghq.com/bits_ai/mcp_server.md). Ensure the MCP Server is enabled to enhance the editor's AI capabilities with your specific Datadog environment:

1. Open the chat panel, select agent mode, and click the **Configure Tools** button.

   {% image
      source="https://docs.dd-static.net/images/bits_ai/mcp_server/vscode_configure_tools_button.7aad216e77d1a7d4648e55299f613f04.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/bits_ai/mcp_server/vscode_configure_tools_button.7aad216e77d1a7d4648e55299f613f04.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="Configure Tools button in VS Code" /%}

1. Find the Datadog server and tools in the list and check the boxes to enable them (expand or refresh if necessary).

{% /tab %}

{% tab title="Cursor" %}
Install the extension either directly in the IDE, or from the web:

- **In Cursor**: Open the Extensions view (`Shift` + `Cmd/Ctrl` + `X`), search for `datadog`, and select the official extension from Datadog.

- **From the web**: Download the VSIX file from [Open VSX Registry](https://open-vsx.org/extension/datadog/datadog-vscode), and install with `Extensions: Install from VSIX` in the command palette (`Shift` + `Cmd/Ctrl` + `P`).

### Datadog MCP Server setup{% #datadog-mcp-server-setup %}

Install the Datadog Plugin to enable the [Datadog MCP Server](https://docs.datadoghq.com/bits_ai/mcp_server/setup.md?tab=cursor). You can install the plugin from the [Cursor Marketplace](https://cursor.com/marketplace/datadog) or in **Cursor Settings** > **Plugins**.
{% /tab %}

## Core features{% #core-features %}

### Logs{% #logs %}

Use **Logs** to gauge the volume of logs generated by a given log line in your code. The extension adds annotations above your code to detected logging patterns that match log records in Datadog.

{% video
   url="https://docs.dd-static.net/images//ide_plugins/vscode/logs_navigation.mp4" /%}

Find out more in the [Logs](https://docs.datadoghq.com/ide_plugins/vscode/logs.md) sub-section.

### Code insights{% #code-insights %}

**Code insights** keep you informed with Datadog-generated insights relevant to your code base, including runtime errors, code vulnerabilities, and flaky tests.

{% image
   source="https://docs.dd-static.net/images/ide_plugins/vscode/code-insights-2.cd9cbbf80e91d4be930f0706593da3e7.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/ide_plugins/vscode/code-insights-2.cd9cbbf80e91d4be930f0706593da3e7.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="The Code Insights view." /%}

Find out more in the [Code Insights](https://docs.datadoghq.com/ide_plugins/vscode/code_insights.md) sub-section.

### Code Security{% #code-security %}

The [**Code Security**](https://docs.datadoghq.com/ide_plugins/vscode/code_security.md) features analyze your code locally against predefined rules to detect and fix security issues and vulnerabilities before you commit changes.

{% video
   url="https://docs.dd-static.net/images//ide_plugins/vscode/static_analysis.mp4" /%}

Find out more in the [Code Security](https://docs.datadoghq.com/ide_plugins/vscode/code_security.md) sub-section.

### Exception Replay{% #exception-replay %}

**Exception Replay** allows you to inspect the stack trace frames of any Error Tracking code insight and get information about the values of the variables of the code running in production.

{% video
   url="https://docs.dd-static.net/images//ide_plugins/vscode/exception_replay.mp4" /%}

Find out more in the [Exception Replay](https://docs.datadoghq.com/ide_plugins/vscode/exception_replay.md) sub-section.

## Other features{% #other-features %}

### View in IDE{% #view-in-ide %}

{% alert level="info" %}
This feature is only available for VS Code and Cursor. Other forks of VS Code are not supported.
{% /alert %}

The **View in VS Code** or **View in Cursor** feature provides a link from Datadog directly to your source files. Look for the button next to frames in stack traces displayed in the UI (for example, in [Error Tracking](https://docs.datadoghq.com/tracing/error_tracking.md)):

{% image
   source="https://docs.dd-static.net/images/ide_plugins/vscode/view-in-vscode-2.e38c2373b437f01c847673b86bf8ec41.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/ide_plugins/vscode/view-in-vscode-2.e38c2373b437f01c847673b86bf8ec41.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A stack trace in Datadog showing the View in VS Code button" /%}

You can also use this feature to open your source files from an insight (such as an error from Error Tracking):

{% image
   source="https://docs.dd-static.net/images/ide_plugins/vscode/view-in-vscode-error.e772031d2373555fe33be8e8c9a87a5e.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/ide_plugins/vscode/view-in-vscode-error.e772031d2373555fe33be8e8c9a87a5e.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="An Error Tracking issue in Datadog showing the View in VS Code button" /%}

{% alert level="info" %}
To use this feature, first configure [source code integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md) for your service.
{% /alert %}

### Fix in Chat{% #fix-in-chat %}

The **Fix in Chat** button appears in several contexts when the extension identifies errors or issues. Click the button to generate an AI chat prompt that summarizes the problem, includes relevant details and context, and gives specific instructions for the agent.

{% video
   url="https://docs.dd-static.net/images//ide_plugins/vscode/cursor_fix_in_chat.mp4" /%}

## Data and telemetry{% #data-and-telemetry %}

Datadog collects certain information about your usage of this IDE, including how you interact with it, whether errors occurred while using it, what caused those errors, and user identifiers in accordance with the [Datadog Privacy Policy](https://www.datadoghq.com/legal/privacy/) and Datadog's [VS Code extension EULA](https://www.datadoghq.com/legal/eula/). This data is used to help improve the extension's performance and features, including transitions to and from the extension and the applicable Datadog login page for accessing the Services.

If you don't wish to send this data to [Datadog](https://www.datadoghq.com/), you can disable this at any time in the extension's settings: `Datadog > Telemetry > Setup > Enable Telemetry` and select `disabled`.

{% alert level="info" %}
The Datadog extension also honors the [VS Code telemetry](https://code.visualstudio.com/docs/configure/telemetry#_output-channel-for-telemetry-events) setting.
{% /alert %}

## Help and feedback{% #help-and-feedback %}

To share your feedback, email [team-ide-integration@datadoghq.com](mailto:team-ide-integration@datadoghq.com) or create an issue in the extension's [public repository](https://github.com/DataDog/datadog-for-vscode).

Check out the [issues](https://github.com/DataDog/datadog-for-vscode/issues?q=is%3Aissue+label%3A%22known+issue%22) section to discover known issues.

Do you use [Cursor](https://www.cursor.com/), or another fork of VS Code? Find the extension on the [Open VSX Registry](https://open-vsx.org/extension/datadog/datadog-vscode).

## License{% #license %}

Read the [End-User License Agreement](https://www.datadoghq.com/legal/eula/) carefully before downloading or using this extension.

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

- [Learn about Continuous Testing](https://docs.datadoghq.com/continuous_testing.md)
- [Learn about Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md)
- [Learn about the Datadog Model Context Protocol (MCP) Server](https://docs.datadoghq.com/bits_ai/mcp_server.md)
- [Reduce context switching while troubleshooting with Datadog's IDE plugins](https://www.datadoghq.com/blog/datadog-ide-plugins/)
- [Simplify production debugging with Datadog Exception Replay](https://www.datadoghq.com/blog/exception-replay-datadog/)
- [Debug live production issues with the Datadog Cursor extension](https://www.datadoghq.com/blog/datadog-cursor-extension/)
