This repository provides a Model Context Protocol (MCP) server for interacting with Graph API, Azure REST API, and Power Platform/Dataverse APIs through their respective command-line tools. It enables AI models to access and utilize these services through a standardized protocol.
Before getting started, ensure you have:
To install the necessary components:
npm install -g genaiscript
Alternatively, you can use it without installation:
npx genaiscript
If you're experiencing authentication issues with GitHub Copilot on Windows, you can use DevContainers:
genaiscript.env
file in the .devcontainer
folder with the following content: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
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": "*"
}
}
}
}
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": "*"
}
}
}
}
Create or modify the .vscode/mcp.json
file:
For Windows:
{
"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": "*"
}
}
}
}
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": "*"
}
}
}
}
In VSCode Insiders, you can start the MCP Server by clicking the Start link in the MCP panel. If it's already running, you'll see a Running indicator.
There are two main prompt files available:
az.prompt.md
- For Azure REST API or Graph API questionspac.prompt.md
- For Power Platform questionsUse the prompts directly in the VSCode interface by selecting them from the MCP resources panel.
You can use the MCP server to:
The server will execute the appropriate CLI commands based on your queries and return the results through the MCP protocol.
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.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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.
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.