Microsoft Security Copilot MCP server

Integrates Microsoft Security Copilot with Microsoft Sentinel for running KQL queries, managing skillsets, and executing prompts using Azure Identity Authentication
Back to servers
Setup instructions
Provider
Jaime Guimera Coll
Release date
Apr 09, 2025
Language
Python
Stats
15 stars

The Security Copilot and Sentinel MCP server provides integration between development environments and Microsoft Security services. It allows you to run KQL queries against Sentinel, manage Security Copilot skillsets/plugins, and execute prompts or skills within Security Copilot using the Model Context Protocol (MCP).

Prerequisites

  • Python 3.8+
  • Microsoft Sentinel workspace
  • Microsoft Security Copilot access
  • Appropriate Azure permissions for Sentinel and Security Copilot

Installation

  1. Clone the repository:

    git clone https://github.com/jguimera/SecurityCopilotMCPServer.git
    cd SecurityCopilotMCPServer
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Create a .env file with the following configuration:

    SENTINEL_SUBSCRIPTION_ID=your_subscription_id
    SENTINEL_RESOURCE_GROUP=your_resource_group
    SENTINEL_WORKSPACE_NAME=your_workspace_name
    SENTINEL_WORKSPACE_ID=your_workspace_id
    #Authentication Options: interactive, client_secret
    AUTHENTICATION_TYPE=interactive
    
    #Add App Reg to use ClientID and Secret authentication (optional)
    #AZURE_TENANT_ID=your_tenant_id
    #AZURE_CLIENT_ID=your_client_id
    #AZURE_CLIENT_SECRET=your_client_secret
    

Usage

Starting the Server

Run the MCP server:

python server.py

To run tests before starting the server:

python server.py --run-tests

Available Tools

The MCP server provides the following tools:

1. Run Sentinel Query

Execute KQL queries against your Microsoft Sentinel workspace:

/run_sentinel_query query="SecurityIncident | where TimeGenerated > ago(7d) | limit 10"

2. Get Skillsets

List existing skillsets/plugins in Security Copilot:

/get_skillsets

3. Upload Plugin

Upload a new or update an existing skillset/plugin to Security Copilot:

/upload_plugin path="/path/to/skillset/folder"

4. Run Prompt

Execute a prompt or skill within Security Copilot:

/run_prompt content="List the most recent risky users"

MCP Client Configuration for Cursor

To use this MCP server with Cursor:

  1. Add the .cursor folder inside your client project to enable the MCP tools
  2. The folder contains two important files:
    • securitycopilotdev.mdc: Custom Cursor Rules to help agents understand user prompts
    • mcp.json: Configuration that connects Cursor to the MCP server

You can invoke tools directly using the syntax:

/tool_name parameter1="Value of the tool parameter"

For example:

/run_prompt content="List the most recent risky users"

For more information on configuring MCP servers with Cursor, visit: https://docs.cursor.com/context/model-context-protocol#configuring-mcp-servers

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "security-copilot-mcp-server" '{"command":"python","args":["server.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "security-copilot-mcp-server": {
            "command": "python",
            "args": [
                "server.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "security-copilot-mcp-server": {
            "command": "python",
            "args": [
                "server.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later