Edit

Share via


Use an MCP tool in Visual Studio Code

This article shows you how to add Microsoft Sentinel's Model Context Protocol (MCP) collection of security tools or your own custom tools to your AI agents in Visual Studio Code.

For information about how to get started with MCP tools, see the following articles:

Add a Microsoft Sentinel or custom tool collection

To add a Microsoft Sentinel tool collection or your own custom tools in Visual Studio Code, follow these steps:

  1. Add MCP server:

    1. Press Ctrl + Shift + P then type or choose MCP: Add Server.

      Screenshot of Visual Studio Code with Add server highlighted.

    2. Choose HTTP (HTTP or Server-Sent Events).

      Screenshot of Visual Studio Code with HTTP or Server-Sent Events highlighted.

    3. Enter the URL of the MCP server of the tool collection you want to access, which can be from the available Sentinel collection or your own custom one, then press Enter.

    4. Assign a friendly Server ID (for example, Microsoft Sentinel MCP server)

    5. Choose whether to make the server available in all Visual Studio Code workspaces or just the current one.

  2. Allow authentication. When prompted, select Allow to authenticate using an account with at least a Security reader role.

    Screenshot of a Visual Studio Code dialog box prompting the user to authenticate.

  3. Open Visual Studio Code's chat. Select View > Chat, select the Toggle Chat icon beside the search bar, or press Ctrl + Alt + I.

  4. Verify connection. Set the chat to Agent mode then confirm by selecting the Configure Tools icon that you see added under the MCP server.

    Screenshot of a Visual Studio Code Agent menu with the Agent mode and tool icon highlighted.