Skip to main content

Security Copilot and Sentinel MCP Server

A Python-based MCP server using FastMCP library that provides integration with Microsoft Security Copilot and Microsoft Sentinel using Azure Identity Authentication. Diagram

Overview

This project implements an MCP server that enables:

  • Running KQL queries against Microsoft Sentinel
  • Uploading/Updating Microsoft Security Copilot skillsets/plugins
  • Running prompts and skills in Microsoft Security Copilot

The server acts as a bridge between development environments and Microsoft Security Copilot, allowing for testing, deployment, and execution of skills and plugins. It uses SSE as transport layer for the MCP server. There are many use cases for the current integration. One of the most interesting ones is to support the development, test and deployment of Security Copilot KQL Skills.

AgentFlow1 AgentFlow2

Features

  • Sentinel Integration: Execute KQL queries against your Sentinel workspace
  • Security Copilot Management:
    • List existing skillsets/plugins
    • Upload new or update existing skillsets/plugins
    • Run prompts or skills within Security Copilot
  • Authentication Support: Multiple authentication methods including interactive browser, client secret, and managed identity

Roadmap

The next features will include:

  • Promptbook test and Update
  • Run Advance Hunting queries in Defender XDR

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:

    #Add App Reg to use ClientID and Secret authentication
    #AZURE_TENANT_ID=your_tenant_id
    #AZURE_CLIENT_ID=your_client_id
    #AZURE_CLIENT_SECRET=your_client_secret
    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
    

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 in Sentinel
  2. get_skillsets: List skillsets in Security Copilot
  3. upload_plugin: Upload or update a skillset/plugin
  4. run_prompt: Run a prompt or skill in Security Copilot

MCP Client Config for Cursor

You can use this MCP server from the Client of your choice. In this repo you can find intructions and config files for Cursor.

Add the .cursor folder inside your client project to enable the MCP tools. This folder contains two files:

  1. Cursor Project Rules (securitycopilotdev.mdc): This file include some Custom Cursor Rules to help the agents in the process definition and understanding user prompts.
  2. MCP Client Configuration (mcp.json): File that connects Cursor to the MCP server.

You can invoke the tool directly using /tool_name parameter1="Value of the tool parameter" For example: /run_prompt content="List the most recent risky users"

More info: https://docs.cursor.com/context/model-context-protocol#configuring-mcp-servers

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for iflow-mcp_securitycopilotmcpserver 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_securitycopilotmcpserver 0.1.0
File Size Uploaded
iflow_mcp_securitycopilotmcpserver-0.1.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_securitycopilotmcpserver 0.1.0
File Interpreter ABI Platform
iflow_mcp_securitycopilotmcpserver-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 kB

Release files / iflow_mcp_securitycopilotmcpserver-0.1.0.tar.gz

Download URL iflow_mcp_securitycopilotmcpserver-0.1.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
779092bdf3e4aa9c37175910ffba5f4b5ca5e1191cebb9b36eeeb3aba549ef82
BLAKE2b-256 checksum
How to use checksums
e89dc0e647a9f65ba5505c2e16c2c677c8ffe5423d83dbf22d5191b63805fe9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_securitycopilotmcpserver-0.1.0-py3-none-any.whl

Download URL iflow_mcp_securitycopilotmcpserver-0.1.0-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c7d44a6bd7a535f1c8f53998750463ab3736a4f7a095e1b457dd3a372183220
BLAKE2b-256 checksum
How to use checksums
e0f55ae373fd3e30aba91dc936b5dc064f5bed5584420f694d5c451a5b4aec33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page