Skip to main content

Install Lokka

To get started with Lokka you need to

  1. Create an Entra app and
  2. 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
  • 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.

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 + ,).
  • 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.
  • 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