Install Lokka
To get started with Lokka you need to
- Create an Entra app and
- Configure it with your AI agent (VS Code GitHub Copilot, Claude Desktop or any other compatible MCP client).
Pre-requisites
- Install Node.js
- If you already have Node v22.10 or higher installed you can skip this step.
- Check by running
node -v
at the command prompt.
1️⃣ → Create an Entra app for Lokka
- Open Entra admin center > Identity > Applications > App registrations
- Tip: enappreg.cmd.ms is a shortcut to the App registrations page.
- Select New registration
- Enter a name for the application (e.g.
Lokka
) - Select Register
- Select API permissions > Add a permission
- Select Microsoft Graph > Application permissions
- Search for each of the permissions and check the box next to each permission you want to allow.
- The agent will only be able to perform the actions based on the permissions you grant it.
- Select Add permissions
- Select Grant admin consent for [your organization]
- Select Yes to confirm
Create a client secret
- Select Certificates & secrets > Client secrets > New client secret
- Enter a description for the secret (e.g.
Agent Config
) - Select Add
- Copy the value of the secret, we will use this value in the agent configuration file.
2️⃣ → Configure the agent
Now you can use the Lokka agent tool with any compatible MCP client and LLM combo.
Claude is the simplest way to get started and provides the best experience. You can use the free version of Claude Desktop to test Lokka (there are daily limits on the free version).
GitHub Copilot Agent in VS Code is a great option if you already have GitHub Copilot Pro subscription. It comes with Claude 3.7 Sonnet support.
- Claude
- VS Code
Install Claude Desktop
- Download the latest version of Claude Desktop from https://claude.ai/download
- Install the application by following the instructions on the website.
- Open the application and sign in with your account (you can register for a free account).
Add Lokka to Claude Desktop
- In Claude Desktop, open Settings by clicking on the hamburger icon in the top left corner.
- Select File > Settings (or press
Ctrl + ,
)- On Mac, you can find the settings in the top menu bar under Claude > Settings (or press
Cmd + ,
).
- On Mac, you can find the settings in the top menu bar under Claude > Settings (or press
- In the Developer tab, click Edit Config
- Note: If you don't see the Developer tab, you need to enable it first from
Help
>Enable Developer Mode
.
- Note: If you don't see the Developer tab, you need to enable it first from
- This opens explorer, edit
claude_desktop_config.json
in your favorite text editor. - Add the following configuration to the file, using the information you in the Overview blade of the Entra application you created earlier.
{
"mcpServers": {
"Lokka-Microsoft-Graph": {
"command": "npx",
"args": ["-y", "@merill/lokka"],
"env": {
"TENANT_ID": "<tenant-id>",
"CLIENT_ID": "<client-id>",
"CLIENT_SECRET": "<client-secret>"
}
}
}
}
- Exit Claude Desktop and restart it.
- Every time you make changes to the code or configuration, you need to restart Claude desktop for the changes to take effect.
- Note: In Windows, Claude doesn't exit when you close the window, it runs in the background. You can find it in the system tray. Right-click on the icon and select Quit to exit the application completely.
Testing the agent
- Open the Claude Desktop application.
- In the chat window on the bottom right you should see a hammer icon if the configuration is correct.
- Now you can start quering your Microsoft tenant using the Lokka agent tool.
- Some sample queries you can try are:
Get all users in my tenant
Show me the details for John Doe
Change John's department to IT
- Needs User.ReadWrite.All permission to be granted
Pre-requisites
- Install the latest version of VS Code - Insider
- Note: The Agent integration with MCP is currently only available in the Insiders version of VS Code.
- Install the latest version of GitHub Copilot in VS Code
Add Lokka to GitHub Copilot
- In VS Code, open the Command Palette by pressing
Ctrl + Shift +P
(orCmd + Shift + P
on Mac). - Type
MCP
and selectMCP: Add Server...
- Select
NPM Package
- Package name:
@merill/lokka
- Select
Allow
- Tenant ID:
<tenant-id>
- Client ID:
<client-id>
- Client secret :
<client-secret>
- Server ID:
Lokka-Microsoft-Graph
- Package name:
- Where to save configuration:
User Settings
- This will open the
settings.json
file in VS Code. File
>Save
to save the file.
❗ Additional configuration on Windows (click to expand)
Update the settings.json file and change the command and args parameters as shown below.
{
"mcp.servers": {
"Lokka-Microsoft-Graph": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@merill/lokka"],
"env": {
"TENANT_ID": "<tenant-id>",
"CLIENT_ID": "<client-id>",
"CLIENT_SECRET": "<client-secret>"
}
}
}
}
- Open the Command Palette again and type
MCP
and selectMCP: List Servers
- Select
Lokka-Microsoft-Graph
from the list of servers. - Selet
Start Server
- This will start the Lokka server and you should see a message in the output window saying
Connection state: Running
.
Testing the agent
-
Start a new instance of VS Code (File > New Window)
-
Open
Copilot Edits
fromView
→Copilot Edits
-
At the bottom of the Copilot Edits panel (below the chat box)
- Select
Agent
(if it is showingEdit
) - Select
Claude 3.7 Sonnet
(if it is showingGPT-40
)
- Select
-
Now you can start quering your Microsoft tenant using the Lokka agent tool.
-
Some sample queries you can try are:
Get all users in my tenant
Show me the details for John Doe
Change John's department to IT
- Needs User.ReadWrite.All permission to be granted