AI Agents - MCP Tool Configured


Description

This query identifies AI agents that have Model Context Protocol (MCP) tools configured. MCP tools extend agent capabilities but introduce additional security considerations because they can execute advanced operations and interact with external resources. If misconfigured or unnecessary, these tools may increase the attack surface and expose sensitive data or functionality. Recommended Action: Confirm with the agent owner whether the MCP tool is still required. If it is, review its configuration for compliance with security best practices and ensure least privilege access. Remove any unused or unnecessary MCP tools to reduce risk.

Query · kql

let IdentityIdtoUPN = materialize (
    IdentityInfo
    | where isnotempty(AccountObjectId) and isnotempty(AccountUpn)
    | summarize arg_max(Timestamp, AccountUpn) by AccountObjectId
    | project AccountObjectId = tostring(AccountObjectId), AccountUpn);
AgentsInfo
| summarize arg_max(Timestamp, *) by AgentId
| where LifecycleStatus != "Deleted"
| where array_length(McpServers) > 0
| extend OwnerId = tostring(Owners[0])
| join kind=leftouter IdentityIdtoUPN on $left.OwnerId == $right.AccountObjectId
| project-rename OwnerUpn = AccountUpn
| mv-expand Mcp = McpServers
| extend McpName = tostring(Mcp.name)
| where isnotempty(McpName)
| summarize McpServersConfigured = make_set(McpName) by AgentId, Name, Platform, CreatedDateTime, OwnerUpn
| project-reorder CreatedDateTime, AgentId, Name, Platform, McpServersConfigured, OwnerUpn
Raw source AI Agents - MCP Tool Configured · KQL
Esc
Published by Azure/Azure-Sentinel ↗, licensed under MIT ↗. Reproduced here unmodified.
id: a4e48491-6ed6-4064-bac2-385ef0e41afe
name: AI Agents - MCP Tool Configured
description: |
  This query identifies AI agents that have Model Context Protocol (MCP) tools configured.
  MCP tools extend agent capabilities but introduce additional security considerations because they can execute advanced operations and interact with external resources.
  If misconfigured or unnecessary, these tools may increase the attack surface and expose sensitive data or functionality.
  Recommended Action: Confirm with the agent owner whether the MCP tool is still required. If it is, review its configuration for compliance with security best practices and ensure least privilege access.
  Remove any unused or unnecessary MCP tools to reduce risk.
requiredDataConnectors: []
tactics:
  - Execution
relevantTechniques:
  - T1059
query: |
  let IdentityIdtoUPN = materialize (
      IdentityInfo
      | where isnotempty(AccountObjectId) and isnotempty(AccountUpn)
      | summarize arg_max(Timestamp, AccountUpn) by AccountObjectId
      | project AccountObjectId = tostring(AccountObjectId), AccountUpn);
  AgentsInfo
  | summarize arg_max(Timestamp, *) by AgentId
  | where LifecycleStatus != "Deleted"
  | where array_length(McpServers) > 0
  | extend OwnerId = tostring(Owners[0])
  | join kind=leftouter IdentityIdtoUPN on $left.OwnerId == $right.AccountObjectId
  | project-rename OwnerUpn = AccountUpn
  | mv-expand Mcp = McpServers
  | extend McpName = tostring(Mcp.name)
  | where isnotempty(McpName)
  | summarize McpServersConfigured = make_set(McpName) by AgentId, Name, Platform, CreatedDateTime, OwnerUpn
  | project-reorder CreatedDateTime, AgentId, Name, Platform, McpServersConfigured, OwnerUpn
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: OwnerUpn
  - entityType: Host
    fieldMappings:
      - identifier: HostName
        columnName: Name
version: 1.0.0

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.