The Model Context Protocol (MCP) is an open standard that enables AI assistants to connect with external data sources and tools through a universal interface. In security operations, MCP servers bridge AI models with security platforms, enabling intelligent query, analysis, and response across your entire security ecosystem.
Bridge AI models with security tools via a standardized protocol for seamless data exchange
Build custom tools, resources, and prompts that AI assistants can discover and use dynamically
Run MCP servers locally or in the cloud with stdio or SSE transport for production readiness
MCP follows a client-server architecture where AI applications (hosts) communicate with MCP servers that expose tools, resources, and prompts through standardised transports.
Executable functions that AI models can invoke. query Sentinel, run KQL, analyze alerts, trigger playbooks, or interact with any security API.
Structured data that AI models can read. threat intelligence feeds, configuration files, incident reports, compliance documents, and log data.
Reusable prompt templates with arguments. pre-built investigation workflows, hunting procedures, and analysis frameworks for common security tasks.
Query Log Analytics workspaces, run KQL hunting queries, manage incidents, and trigger playbooks through AI-driven natural language interactions.
Investigate incidents, run advanced hunting queries, manage alerts, and perform device actions through a unified AI interface.
Aggregate threat intelligence from multiple sources, enrich IOCs, and provide contextual threat information to AI-powered SOC workflows.
Query compliance status, check policy adherence, generate compliance reports, and recommend configurations via Purview integration.
Get started with MCP using TypeScript or Python. Here's a minimal example of a security-focused MCP server.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({
name: "security-mcp",
version: "1.0.0"
});
// Define a tool for querying security alerts
server.tool(
"query_alerts",
"Query security alerts from Microsoft Sentinel",
{
severity: z.enum(["High", "Medium", "Low"]).describe("Alert severity"),
timeRange: z.string().describe("Time range, e.g. '24h', '7d'"),
limit: z.number().default(10).describe("Max results to return")
},
async ({ severity, timeRange, limit }) => {
// Call Microsoft Graph Security API or Sentinel API
const alerts = await querySecurityAlerts(severity, timeRange, limit);
return {
content: [{ type: "text", text: JSON.stringify(alerts, null, 2) }]
};
}
);
const transport = new StdioServerTransport();
await server.connect(transport);from mcp.server.fastmcp import FastMCP
mcp = FastMCP("security-mcp")
@mcp.tool()
async def query_alerts(
severity: str,
time_range: str = "24h",
limit: int = 10
) -> str:
"""Query security alerts from Microsoft Sentinel.
Args:
severity: Alert severity. High, Medium, or Low
time_range: Time range, e.g. '24h', '7d'
limit: Maximum results to return
"""
# Call Microsoft Graph Security API or Sentinel API
alerts = await query_security_alerts(severity, time_range, limit)
return json.dumps(alerts, indent=2)
@mcp.resource("sentinel://incidents/{incident_id}")
async def get_incident(incident_id: str) -> str:
"""Retrieve a specific Sentinel incident by ID."""
incident = await fetch_incident(incident_id)
return json.dumps(incident, indent=2)
if __name__ == "__main__":
mcp.run()Build real MCP servers from scratch. implement security tools, deploy to production, and create multi-server AI agents for enterprise SOC operations.
Scaffold a TypeScript MCP server project, implement tools for running KQL queries against a Sentinel workspace, add Azure AD authentication with MSAL, test interactively with the MCP Inspector, and connect the server to Claude Desktop for natural-language querying.
Build an MCP server exposing Defender XDR incident management and advanced hunting capabilities, implement Zod input validation and structured error handling, add resource endpoints for security baselines and device inventory, and configure multi-user access with scoped permissions.
Containerize your MCP server with Docker, deploy to Azure Container Apps with managed identity, configure SSE transport with token-based authentication, set up Azure Monitor health checks and structured logging, and integrate with a production AI application.
Create an AI agent that connects to Sentinel, XDR, and Threat Intelligence MCP servers simultaneously, implement cross-server correlation logic for unified investigations, build automated triage workflows that span multiple security products, and deploy as an enterprise-ready security copilot.