MCP ExplorerExplorer

Genaiscript Pac Az Mcp

@rajyramanon a year ago
4 MIT
FreeCommunity
AI Systems
#azure#genaiscript#mcp#power-apps
MCP for Azure CLI and Power Platform CLI

Overview

What is Genaiscript Pac Az Mcp

genaiscript-pac-az-mcp is a Model Context Protocol (MCP) toolset designed for integrating with Azure CLI and Power Platform CLI. It facilitates the use of Graph API, Azure REST API, and Power Platform Admin APIs/Dataverse APIs.

Use cases

Use cases include developing applications that require AI model context, automating data workflows in Azure, and leveraging Power Platform capabilities for enhanced data interactions.

How to use

To use genaiscript-pac-az-mcp, ensure you have VSCode Insiders (March 2025 version), Azure CLI, and Power Platform CLI installed and authenticated. You can run the MCP server locally and configure it using the mcp.json file. The GenAIScript CLI can be installed via npm or npx.

Key features

Key features include the ability to standardize communication with AI models, integration with various APIs, and the option to run within a Dev Container for isolated environments.

Where to use

genaiscript-pac-az-mcp can be used in software development, particularly in projects that involve AI model integration, data management, and automation within Azure and Power Platform environments.

Content

Power Platform CLI, Graph API and Azure REST API - MCP

This repository contains the Model Context Protocol (MCP) tools for using Graph API, Azure REST API using Azure CLI, and Power Platform Admin APIs/Dataverse APIs using Power Platform CLI.

Prerequisites

  1. VSCode Insiders - March 2025 version or Claude Desktop
  2. Azure CLI and Power Platform CLI installed, and authenticated on your local machine, if you are not using the DevContainer option.
  3. Dev Container CLI, if you want to run MCP inside a Dev Container.
  4. Docker, if you want to run Dev Containers.

What is GenAIScript? 🤖

GenAIScript is a framework that enables you to communicate with AI models (even local models). GenAIScript can use MCP tools, and can also act as the MCP server.

Model Context Protocol (MCP) 📋

This is how Anthropic, the creators of MCP specification, defines Model Context Protocol

MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.

Installation 🛠️

  • Install NodeJS
  • Install genaiscript CLI using npm install -g genaiscript, or use npx genaiscript

Usage 💻

If you install the March 2025 version of VSCode Insiders, you should be able to run the GenAIScript MCP server locally, to get the tool versions installed on your local machine.

mcp.json is where you would configure the MCP servers. You don’t even need to clone this repo with this approach, as GenAIScript can clone the repo in the background for you to just use the tools. If you are using the --remote flag, you don’t need to install the GenAIScript extension at all, as npx would pull in everything for you.

Known Issues - Copilot on Windows ⚠️

GitHub Copilot does not seem to like CLIs trying to authenticate in VSCode Insiders. If you try to do that Power Platform CLI would fail with The requested service provider could not be loaded or initialized. error.

You have two options:

  1. Run the whole repo in DevContainers. This repo has .devcontainer.json config file specified. If you use this option, you can create a new file called genaiscript.env in the .devcontainer folder. Use the below as a sample.
PAC_CLIENT_ID=2caa17e6-884b-473b-80c5-c05d8859a2fa
PAC_CLIENT_SECRET=
ENVIRONMENT_URL=https://abc.crm6.dynamics.com
TENANT_ID=
AZ_CLIENT_ID=aba9829f-6288-44d7-9168-53eca9a1f4a5
AZ_CLIENT_SECRET=
DOCKER_CONTAINER=true
  1. Use Claude Desktop to run the MCP. Claude Desktop does not suffer from this issue on Windows

Claude Desktop Configuration 🧠

Config for Windows

{
  "globalShortcut": "Ctrl+Space",
  "mcpServers": {
    "genaiscript-mcp": {
      "type": "stdio",
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "genaiscript",
        "mcp",
        "--remote",
        "https://github.com/rajyraman/genaiscript-pac-az-mcp/",
        "--remote-branch",
        "main",
        "--groups",
        "mcp",
        "--startup",
        "mcp_resources"
      ],
      "env": {
        "DEBUG": "*"
      }
    }
  }
}

Config for MacOS/Linux

{
  "globalShortcut": "Ctrl+Space",
  "mcpServers": {
    "genaiscript-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "genaiscript",
        "mcp",
        "--remote",
        "https://github.com/rajyraman/genaiscript-pac-az-mcp/",
        "--remote-branch",
        "main",
        "--groups",
        "mcp",
        "--startup",
        "mcp_resources"
      ],
      "env": {
        "DEBUG": "*"
      }
    }
  }
}

VSCode Configuration 🧩

MCP config inside VSCode Insiders is via in mcp.json file in the .vscode folder.
Config for Windows

Running npx directly seems to create problems in Windows. So, we have to use cmd to launch npx.

{
    "servers": {
        "genaiscript-mcp-remote": {
            "type": "stdio",
            "command": "cmd",
            "args": [
                "/c",
                "npx",
                "genaiscript",
                "mcp",
                "--remote",
                "https://github.com/rajyraman/genaiscript-pac-az-mcp/",
                "--remote-branch",
                "main",
                "--groups",
                "mcp"
            ],
            "env": {
                "DEBUG": "*"
            }
            // "envFile": "${workspaceFolder}/.env"
        }
    }
}

Config for MacOS/Linux

{
    "servers": {
        "genaiscript-mcp-remote": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "genaiscript",
                "mcp",
                "--remote",
                "https://github.com/rajyraman/genaiscript-pac-az-mcp/",
                "--remote-branch",
                "main",
                "--groups",
                "mcp"
            ],
            "env": {
                "DEBUG": "*"
            }
            // "envFile": "${workspaceFolder}/.env"
        }
    }
}

You can start the MCP Server by clicking the Start link. If it is already running, you would see a Running indicator.

MCP Server Start

MCP Tools

Prompt Files

Use az.prompt.md for any Azure REST API, or Graph API questions.

Use pac.prompt.md for any Power Platform questions.

You can use the prompt in VSCode like below.

Prompt1
Prompt2
Prompt3

In Claude Desktop, you can upload the prompt file to the session. The prompts are available as Resources. Choose the appropriate prompt for what you plan to ask Claude. You can choose both if needed, but it is better to choose one, test out the experience first before choosing both.

Claude file

PAC Prompt

AZ Prompt

Below is how you can use it in the GitHub Copilot chat.

Example 1 - Query Power Platform environment details

Copilot PAC

Exampe 2 - Query Azure subscription details

Copilot Azure REST API

Example 3 - Query details from Graph API

Copilot Graph API

Example 4 - Query about Power Platform environment in Claude Desktop

Claude Desktop

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers