Skip to content
Back to search

lokka

MCP (Model Context Protocol) for Microsoft 365. Includes support for Microsoft Graph and other services

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/merill--lokka/badge.svg)](/listings/merill--lokka)

HTML

<a href="/listings/merill--lokka"><img src="/api/listings/merill--lokka/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your `claude_desktop_config.json`:

Interactive Authentication

{
  "mcpServers": {
    "Lokka-Microsoft": {
      "command": "npx",
      "args": ["-y", "@merill/lokka"]
    }
  }
}

Client Credentials Authentication

{
  "mcpServers": {
    "Lokka-Microsoft": {
      "command": "npx",
      "args": ["-y", "@merill/lokka"],
      "env": {
        "TENANT_ID": "<tenant-id>",
        "CLIENT_ID": "<client-id>",
        "CLIENT_SECRET": "<client-secret>"
      }
    }
  }
}

Make sure to replace `<tenant-id>`, `<client-id>`, and `<client-secret>` with the actual values from your Microsoft Entra application. (See [Install Guide](https://lokka.dev/docs/install) for more details on how to create an Entra app and configure the agent.)

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 270 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Lokka
  2. [![npm version](https://img.shields.io/npm/v/@merill/lokka?logo=npm&color=cb3837)](https://www.npmjs.com/package/@merill/lokka)
  3. [![downloads](https://img.shields.io/npm/d18m/@merill/lokka?label=downloads&color=blue)](https://www.npmjs.com/package/@merill/lokka)
  4. [![downloads per month](https://img.shields.io/npm/dm/@merill/lokka?label=downloads%2Fmonth&color=blue)](https://www.npmjs.com/package/@merill/lokka)
  5. [![GitHub stars](https://img.shields.io/github/stars/merill/lokka?style=flat&logo=github)](https://github.com/merill/lokka/stargazers)
  6. [![license](https://img.shields.io/github/license/merill/lokka?color=green)](https://github.com/merill/lokka/blob/main/LICENSE)
  7. Lokka is a model-context-protocol server for the Microsoft Graph and Azure RM APIs that allows you to query and manage your Azure and Microsoft 365 tenants with AI.
  8. <img src="https://github.com/merill/lokka/blob/main/assets/lokka-demo-1.gif?raw=true" alt="Lokka Demo - user create demo" width="500"/>
  9. Please see [Lokka.dev](https://lokka.dev) for how to use Lokka with your favorite AI model and chat client.
  10. Lokka lets you use Claude Desktop, or any MCP Client, to use natural language to accomplish things in your Azure and Microsoft 365 tenant through the Microsoft APIs.
  11. e.g.:
  12. - `Create a new security group called 'Sales and HR' with a dynamic rule based on the department attribute.`
  13. - `Find all the conditional access policies that haven't excluded the emergency access account`
  14. - `Show me all the Intune device configuration policies assigned to the 'Call center' group`
  15. - `What was the most expensive service in Azure last month?`
  16. ![How does Lokka work?](https://github.com/merill/lokka/blob/main/website/docs/assets/how-does-lokka-mcp-server-work.png?raw=true)
  17. ## Authentication Methods
  18. Lokka now supports multiple authentication methods to accommodate different deployment scenarios:
  19. ### Interactive Auth
  20. For user-based authentication with interactive login, you can use the following configuration:
  21. This is the simplest config and uses the default Lokka app.
  22. ```json
  23. {
  24. "mcpServers": {
  25. "Lokka-Microsoft": {
  26. "command": "npx",
  27. "args": ["-y", "@merill/lokka"]
  28. }
  29. }
  30. }
  31. ```
  32. #### Interactive auth with custom app
  33. If you wish to use a custom Microsoft Entra app, you can create a new app registration in Microsoft Entra and configure it with the following environment variables:
  34. ```json
  35. {
  36. "mcpServers": {
  37. "Lokka-Microsoft": {
  38. "command": "npx",
  39. "args": ["-y", "@merill/lokka"],
  40. "env": {
  41. "TENANT_ID": "<tenant-id>",
  42. "CLIENT_ID": "<client-id>",
  43. "USE_INTERACTIVE": "true"
  44. }
  45. }
  46. }
  47. }
  48. ```
  49. ### App-Only Auth
  50. Traditional app-only authentication. You can use either certificate (recommended) or client secret authentication with the following configuration.
  51. See [Install Guide](https://lokka.dev/docs/install) for more details on how to create an Entra app.
  52. #### App-Only Auth with Certificate
  53. App only authentication using a PEM-encoded client certificate:
  54. ```json
  55. {
  56. "mcpServers": {
  57. "Lokka-Microsoft": {
  58. "command": "npx",
  59. "args": ["-y", "@merill/lokka"],
  60. "env": {
  61. "TENANT_ID": "<tenant-id>",
  62. "CLIENT_ID": "<client-id>",
  63. "CERTIFICATE_PATH": "/path/to/certificate.pem",
  64. "CERTIFICATE_PASSWORD": "<optional-certificate-password>",
  65. "USE_CERTIFICATE": "true"
  66. }
  67. }
  68. }
  69. }
  70. ```
  71. For comfort, in order to convert a PFX client certificate to a PEM-encoded certificate:
  72. ```bash
  73. openssl pkcs12 -in /path/to/cert.pfx -out /path/to/cert.pem -nodes -clcerts
  74. ```
  75. #### App-Only Auth with Client Secret
  76. ```json
  77. {
  78. "mcpServers": {
  79. "Lokka-Microsoft": {
  80. "command": "npx",
  81. "args": ["-y", "@merill/lokka"],
  82. "env": {
  83. "TENANT_ID": "<tenant-id>",
  84. "CLIENT_ID": "<client-id>",
  85. "CLIENT_SECRET": "<client-secret>"
  86. }
  87. }
  88. }
  89. }
  90. ```
  91. ### Client-Provided Token
  92. Token-based authentication where the MCP Client provides access tokens:
  93. ```json
  94. {
  95. "mcpServers": {
  96. "Lokka-Microsoft": {
  97. "command": "npx",
  98. "args": ["-y", "@merill/lokka"],
  99. "env": {
  100. "USE_CLIENT_TOKEN": "true"
  101. }
  102. }
  103. }
  104. }
  105. ```
  106. When using client-provided token mode:
  107. 1. Start the MCP server with `USE_CLIENT_TOKEN=true`
  108. 2. Use the `set-access-token` tool to provide a valid Microsoft Graph access token
  109. 3. Use the `get-auth-status` tool to verify authentication status
  110. 4. Refresh tokens as needed using `set-access-token`
  111. ## New Tools
  112. ### Token Management Tools
  113. - **`set-access-token`**: Set or update access tokens for Microsoft Graph authentication
  114. - **`get-auth-status`**: Check current authentication status and capabilities
  115. - **`add-graph-permission`**: Request additional Microsoft Graph permission scopes interactively
  116. ### Graph API Version Control
  117. Lokka now supports controlling the default Microsoft Graph API version used for all requests:
  118. - **Default behavior**: Uses `beta` version for access to latest features
  119. - **Production mode**: Set `USE_GRAPH_BETA=false` to force all requests to use `v1.0` version
  120. - **Per-request override**: You can still specify `graphApiVersion` parameter in individual requests (unless `USE_GRAPH_BETA=false`)
  121. When `USE_GRAPH_BETA=false`, all Graph API calls will use the stable `v1.0` version, even if `beta` is explicitly requested in the `graphApiVersion` parameter.
  122. ## Getting started
  123. See the docs for more information on how to install and configure Lokka.
  124. - [Introduction](https://lokka.dev/)
  125. - [Install guide](https://lokka.dev/docs/install)
  126. - [Developer guide](https://lokka.dev/docs/developer-guide)
  127. ### One-click install for VS Code
  128. | Platform | VS Code | VS Code Insiders |
  129. | - | - | - |
  130. | Windows | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Lokka_for_Windows-0098FF?style=flat-square&logo=visualstudiocode&logoColor=ffffff)](vscode:mcp/install?%7B%22name%22%3A%22Lokka-Microsoft%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22cmd%22%2C%22args%22%3A%5B%22%2Fc%22%2C%22npx%22%2C%22-y%22%2C%22%40merill%2Flokka%22%5D%7D) | [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Lokka_for_Windows-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=ffffff)](vscode-insiders:mcp/install?%7B%22name%22%3A%22Lokka-Microsoft%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22cmd%22%2C%22args%22%3A%5B%22%2Fc%22%2C%22npx%22%2C%22-y%22%2C%22%40merill%2Flokka%22%5D%7D) |
  131. | macOS/Linux | [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Lokka_for_macOS_%26_Linux-0098FF?style=flat-square&logo=visualstudiocode&logoColor=ffffff)](vscode:mcp/install?%7B%22name%22%3A%22Lokka-Microsoft%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40merill%2Flokka%22%5D%7D) | [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Lokka_for_macOS_%26_Linux-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=ffffff)](vscode-insiders:mcp/install?%7B%22name%22%3A%22Lokka-Microsoft%22%2C%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40merill%2Flokka%22%5D%7D) |
  132. ## Components
  133. ### Tools
  134. 1. `Lokka-Microsoft`
  135. - Call Microsoft Graph & Azure APIs. Supports querying Azure and Microsoft 365 tenants. Updates are also supported if permissions are provided.
  136. - Input:
  137. - `apiType` (string): Type of Microsoft API to query. Options: 'graph' for Microsoft Graph (Entra) or 'azure' for Azure Resource Management.
  138. - `path` (string): The Azure or Graph API URL path to call (e.g. '/users', '/groups', '/subscriptions').
  139. - `method` (string): HTTP method to use (e.g., get, post, put, patch, delete)
  140. - `apiVersion` (string): Azure Resource Management API version (required for apiType Azure)
  141. - `subscriptionId` (string): Azure Subscription ID (for Azure Resource Management).
  142. - `queryParams` (string): Array of query parameters like $filter, $select, etc. All parameters are strings.
  143. - `body` (JSON): The request body (for POST, PUT, PATCH)
  144. - Returns: Results from the Azure or Graph API call.
  145. 2. `set-access-token` *(New in v0.2.0)*
  146. - Set or update an access token for Microsoft Graph authentication when using client-provided token mode.
  147. - Input:
  148. - `accessToken` (string): The access token obtained from Microsoft Graph authentication
  149. - `expiresOn` (string, optional): Token expiration time in ISO format
  150. - Returns: Confirmation of token update
  151. 3. `get-auth-status` *(New in v0.2.0)*
  152. - Check the current authentication status and mode of the MCP Server
  153. - Returns: Authentication mode, readiness status, and capabilities
  154. ### Environment Variables
  155. The configuration of the server is done using environment variables. The following environment variables are supported:
  156. | Name | Description | Required |
  157. |------|-------------|----------|
  158. | `TENANT_ID` | The ID of the Microsoft Entra tenant. | Yes (except for client-provided token mode) |
  159. | `CLIENT_ID` | The ID of the application registered in Microsoft Entra. | Yes (except for client-provided token mode) |
  160. | `CLIENT_SECRET` | The client secret of the application registered in Microsoft Entra. | Yes (for client credentials mode only) |
  161. | `USE_INTERACTIVE` | Set to "true" to enable interactive authentication mode. | No |
  162. | `USE_CLIENT_TOKEN` | Set to "true" to enable client-provided token authentication mode. | No |
  163. | `USE_CERTIFICATE` | Set to "true" to enable certificate authentication mode. | No |
  164. | `CERTIFICATE_PATH` | Path to the PEM-encoded certificate file for certificate authentication. | Yes (for certificate mode only) |
  165. | `CERTIFICATE_PASSWORD` | Password for the certificate file (if encrypted). | No |
  166. | `REDIRECT_URI` | Redirect URI for interactive authentication (default: `http://localhost:3000`). | No |
  167. | `ACCESS_TOKEN` | Initial access token for client-provided token mode. | No |
  168. | `USE_GRAPH_BETA` | Set to "false" to force all Graph API calls to use v1.0 instead of beta (default: true, allows beta). | No |
  169. ## Contributors
  170. - Interactive and Token-based Authentication (v0.2.0) - [@darrenjrobinson](https://github.com/darrenjrobinson)
  171. - Certificate Authentication (v0.2.1) - [@nitzpo](https://github.com/nitzpo)
  172. ## Sponsors
  173. Lokka is free and ad-free, with no investors behind it. If it saves you time, please consider [sponsoring me on GitHub](https://github.com/sponsors/merill). 💙
  174. <a href="https://github.com/sponsors/merill"><img src="https://raw.githubusercontent.com/merill/sponsors/main/sponsors.svg" alt="Sponsors"></a>
  175. ## Installation
  176. To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your
  177. `claude_desktop_config.json`:
  178. ### Interactive Authentication
  179. ```json
  180. {
  181. "mcpServers": {
  182. "Lokka-Microsoft": {
  183. "command": "npx",
  184. "args": ["-y", "@merill/lokka"]
  185. }
  186. }
  187. }
  188. ```
  189. ### Client Credentials Authentication
  190. ```json
  191. {
  192. "mcpServers": {
  193. "Lokka-Microsoft": {
  194. "command": "npx",
  195. "args": ["-y", "@merill/lokka"],
  196. "env": {
  197. "TENANT_ID": "<tenant-id>",
  198. "CLIENT_ID": "<client-id>",
  199. "CLIENT_SECRET": "<client-secret>"
  200. }
  201. }
  202. }
  203. }
  204. ```
  205. Make sure to replace `<tenant-id>`, `<client-id>`, and `<client-secret>` with the actual values from your Microsoft Entra application. (See [Install Guide](https://lokka.dev/docs/install) for more details on how to create an Entra app and configure the agent.)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.