Microsoft Defender MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Microsoft Defender MCP or direct API to investigate alerts, manage incidents, query hunting results, and review secure scores through natural language.

Microsoft Defender logoMicrosoft Defender
Oauth2S2s Oauth2

Microsoft Defender is Microsoft's cloud security service for detecting and investigating cyber threats. It provides unified visibility into alerts, incidents, devices, vulnerabilities, and threat intelligence.

89 Tools

Try Microsoft Defender now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Microsoft Defender
Try asking
TOOLS

Supported Tools

Every Microsoft Defender action and event your agent gets out of the box.

Add Alert Comment

Append a comment to a Microsoft Defender security alert.

Add Incident Comment

Append an analyst comment to a Microsoft Defender incident; comments cannot be removed by this action.

Create Email Submission Policy

Create an email threat-submission policy with the supplied settings.

Create Simulation

Create an attack simulation using payload, login-page, and landing-page resource IDs; acceptance is asynchronous.

Delete Email Submission Policy

Delete an email threat-submission policy by its Microsoft Graph identifier.

Delete Simulation

Delete an attack simulation campaign.

Get Alert

Retrieve the documented properties of a Microsoft Defender security alert.

Get Article Indicator

Read a Microsoft Defender Threat Intelligence article indicator.

Get Email Submission Policy

Get one email threat-submission policy by its Microsoft Graph identifier.

Get Host Component

Read a web component observed on a threat-intelligence host.

Get Host Cookie

Read a cookie observed on a Microsoft Defender Threat Intelligence host.

Get Host Pair

Read a parent-child host relationship observed by Microsoft Defender Threat Intelligence.

Get Host Port

Read a port observed on a Microsoft Defender Threat Intelligence host.

Get Host Reputation

Get the reputation properties and relationships for a threat-intelligence host.

Get Host Tracker

Read an internet tracker observed on a Microsoft Defender Threat Intelligence host.

Get Host WHOIS

Get the WHOIS record associated with a threat-intelligence host.

Get Incident

Retrieve a Microsoft Defender incident by its identifier.

Get Intelligence Profile

Get a Microsoft Defender threat-intelligence profile by identifier.

Get Intelligence Profile Indicator

Get a Microsoft Defender intelligence profile indicator by identifier.

Get Landing Page

Get a landing page associated with an attack simulation campaign.

Get Login Page

Get a login page associated with an attack simulation campaign.

Get Passive DNS Record

Get a Microsoft Defender passive DNS record by identifier.

Get Payload

Get an attack simulation campaign payload.

Get Payload Detail

Get detailed content for an attack simulation campaign payload.

Get Secure Score

Retrieve a Microsoft secure score by its provider-generated identifier.

Get Secure Score Control Profile

Retrieve a Microsoft secure score control profile by its identifier.

Get Simulation

Get an attack simulation campaign.

Get Simulation Automation

Get an attack simulation automation.

Get Simulation Landing Page

Get the landing page associated with an attack simulation campaign.

Get Simulation Login Page

Get the login page associated with an attack simulation campaign.

Get Simulation Operation

Get an attack simulation operation to track a long-running request.

Get Simulation Payload

Get the payload associated with an attack simulation campaign.

Get Simulation Report Overview

Get an overview of an attack simulation and training campaign.

Get Subdomain

Get a Microsoft Defender threat-intelligence subdomain by identifier.

Get Threat Article

Read a Microsoft Defender Threat Intelligence article by ID.

Get Threat Host

Read a hostname or IP address detected by Microsoft Defender Threat Intelligence.

Get Threat Submission

Get one email, file, or URL threat submission by its Microsoft Graph identifier.

Get Training

Get an attack simulation training resource.

Get Training Language Detail

Get localized language details for an attack simulation training.

Get Vulnerability

Get a Microsoft Defender threat-intelligence vulnerability by identifier.

Get Vulnerability Component

Get a component associated with a Microsoft Defender vulnerability.

Get WHOIS History Record

Get a Microsoft Defender WHOIS history record by identifier.

Get WHOIS Record

Get a Microsoft Defender WHOIS record by identifier.

List Alerts

Get a page of Microsoft Defender security alerts and their properties.

List Article Indicators

List indicators of threat or compromise associated with a threat article.

List Attack Simulation Repeat Offenders

Get one page of tenant users who yielded to attacks more than once in attack simulation campaigns.

List Email Submission Policies

Get the email threat-submission policies and their current settings.

List End User Notifications

Get one page of attack simulation end-user notification templates.

List Host Components

List web components observed on a Microsoft Defender Threat Intelligence host.

List Host Cookies

List cookies observed on a Microsoft Defender Threat Intelligence host.

List Host Pairs

List all, child, or parent host-pair relationships for a threat-intelligence host.

List Host Passive DNS

List passive-DNS records associated with a Microsoft Defender Threat Intelligence host.

List Host Ports

Get one page of ports associated with a Microsoft Defender threat-intelligence host.

List Host Reverse Passive DNS

Get one page of passive DNS records that resolve to the specified host.

List Host Subdomains

Get one page of subdomain resources associated with a threat-intelligence host.

List Host Trackers

Get one page of trackers associated with a threat-intelligence host.

List Host WHOIS History

Get one page of historical WHOIS records associated with a host.

List Incidents

Get one page of Microsoft Defender incidents and an opaque continuation cursor.

List Intelligence Profile Indicators

Get one page of indicators associated with a Microsoft Defender intelligence profile.

List Intelligence Profiles

Get one page of Microsoft Defender threat-intelligence profiles.

List Landing Pages

Get one page of landing pages for attack simulation campaigns.

List Login Pages

Get one page of login pages for attack simulation campaigns.

List Payloads

Get one page of payloads for attack simulation campaigns.

List Secure Score Control Profiles

Return one page of Microsoft secure score control profiles and an opaque continuation cursor.

List Secure Scores

Return one page of daily Microsoft secure scores and an opaque continuation cursor.

List Simulation Automation Runs

Get one page of runs for an attack simulation automation.

List Simulation Automations

Get one page of attack simulation automations.

List Simulations

Get one page of attack simulation campaigns.

List Simulation User Coverage

Get one page of attack simulation coverage records for tenant users.

List Simulation Users

List users and their recorded actions in an attack simulation campaign.

List Threat Articles

List Microsoft Defender Threat Intelligence articles one page at a time.

List Threat Submissions

List one page of email, file, or URL threat submissions visible to the connected account.

List Trainings

Get one page of attack simulation training resources.

List Training User Coverage

Get one page of training coverage records for tenant users in attack simulation campaigns.

List Vulnerability Components

Get one page of components associated with a Microsoft Defender vulnerability.

List WHOIS Record History

Get one page of historical records for a Microsoft Defender WHOIS record.

List WHOIS Records

Get one page of WHOIS records from Microsoft Defender threat intelligence.

Merge Incidents

Merge at least two Microsoft Defender incidents into one incident.

Move Alerts

Move one or more Microsoft Defender alerts to a new or existing incident.

Review Email Threat Submission

Record the administrator's review category for an email threat submission.

Run Hunting Query

Run a Kusto Query Language query against Microsoft Defender advanced-hunting data for the requested time span or workspace.

Submit Email Threat

Submit email content or a Microsoft Graph message URL for security analysis; this starts an external review workflow and cannot be undone here.

Submit File Threat

Submit base64 file content for security analysis; this starts an external review workflow and cannot be undone here.

Submit URL Threat

Submit a URL for security analysis; this starts an external review workflow and cannot be undone here.

Update Alert

Update one or more mutable properties of a Microsoft Defender security alert.

Update Email Submission Policy

Update one or more settings on an email threat-submission policy.

Update Incident

Update one or more editable properties of a Microsoft Defender incident.

Update Secure Score Control Profile

Update tenant state, assignment, comments, and required vendor information for a Microsoft secure score control profile.

Update Simulation

Update a draft attack simulation, optionally binding a payload by resource ID; acceptance does not mean completion.

SETUP GUIDE

Connect Microsoft Defender MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["microsoft_defender"],
  mcp: true,
});
Create a session scoped to Microsoft Defender and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "List high-severity Microsoft Defender incidents and summarize the affected devices.",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a Microsoft Defender request
SETUP GUIDE

Connect Microsoft Defender API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["microsoft_defender"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to Microsoft Defender
3

Run Microsoft Defender tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "List high-severity Microsoft Defender incidents and summarize the affected devices." }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the Microsoft Defender tool calls through the session, and print the final answer

Why Use Composio?

AI Native Microsoft Defender Integration

  • Supports both Microsoft Defender MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Microsoft Defender data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Microsoft Defender access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Microsoft Defender
  • Scoped, least privilege access to Microsoft Defender resources
  • Full audit trail of agent actions to support review and compliance

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

Start with Microsoft Defender.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Microsoft Defender tool your agent needs.Free to start.

Start building