by merill
Lokka is a Model Context Protocol (MCP) server for Microsoft 365, enabling AI models to interact with Microsoft Graph and Azure APIs using natural language.
Lokka is an MCP (Model Context Protocol) server designed to bridge AI models with Microsoft Graph and Azure Resource Management (ARM) APIs. It allows users to manage and query their Microsoft 365 and Azure tenants using natural language, effectively turning natural language commands into API calls.
Lokka can be used with any MCP Client, such as Claude Desktop. To set it up, you need to configure the mcpServers
section in your client's configuration file (e.g., claude_desktop_config.json
). This involves specifying the command
, args
, and env
variables, including TENANT_ID
, CLIENT_ID
, and CLIENT_SECRET
for client credentials authentication. Lokka also supports interactive authentication and client-provided token authentication, offering flexibility in deployment scenarios. Once configured, you can send natural language commands to your AI model, which Lokka translates into actions within your Microsoft environment.
set-access-token
to update access tokens and get-auth-status
to check authentication status.Lokka is ideal for IT administrators, developers, and power users who want to streamline their management tasks within Microsoft 365 and Azure using AI. Example use cases include:
Q: What is MCP? A: MCP stands for Model Context Protocol, a protocol that allows AI models to interact with external services and data.
Q: What authentication methods does Lokka support? A: Lokka supports Client Credentials, Interactive Authentication, and Client-Provided Token authentication.
Q: Can Lokka modify resources in Microsoft 365 and Azure? A: Yes, Lokka supports updates to resources if the provided credentials have the necessary permissions.
Q: Where can I find more detailed documentation? A: You can find comprehensive documentation, including installation and developer guides, on Lokka.dev.
Lokka is a model-context-protocol server for the Microsoft Graph and Azure RM APIs that allows you to query and managing your Azure and Microsoft 365 tenants with AI.
Please see Lokka.dev for how to use Lokka with your favorite AI model and chat client.
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.
e.g.:
Create a new security group called 'Sales and HR' with a dynamic rule based on the department attribute.
Find all the conditional access policies that haven't excluded the emergency access account
Show me all the Intune device configuration policies assigned to the 'Call center' group
What was the most expensive service in Azure last month?
Lokka now supports multiple authentication methods to accommodate different deployment scenarios:
Traditional app-only authentication using client credentials:
{
"mcpServers": {
"Lokka-Microsoft": {
"command": "npx",
"args": ["-y", "@merill/lokka"],
"env": {
"TENANT_ID": "<tenant-id>",
"CLIENT_ID": "<client-id>",
"CLIENT_SECRET": "<client-secret>"
}
}
}
}
User-based authentication with interactive login:
{
"mcpServers": {
"Lokka-Microsoft": {
"command": "npx",
"args": ["-y", "@merill/lokka"],
"env": {
"TENANT_ID": "<tenant-id>",
"CLIENT_ID": "<client-id>",
"USE_INTERACTIVE": "true",
"REDIRECT_URI": "http://localhost:3000"
}
}
}
}
Token-based authentication where the MCP Client provides access tokens:
{
"mcpServers": {
"Lokka-Microsoft": {
"command": "npx",
"args": ["-y", "@merill/lokka"],
"env": {
"USE_CLIENT_TOKEN": "true"
}
}
}
}
When using client-provided token mode:
USE_CLIENT_TOKEN=true
set-access-token
tool to provide a valid Microsoft Graph access tokenget-auth-status
tool to verify authentication statusset-access-token
set-access-token
: Set or update access tokens for Microsoft Graph authenticationget-auth-status
: Check current authentication status and capabilitiesLokka-Microsoft
: Now supports all three authentication modes with improved error handling and token managementSee the docs for more information on how to install and configure Lokka.
Lokka-Microsoft
apiType
(string): Type of Microsoft API to query. Options: 'graph' for Microsoft Graph (Entra) or 'azure' for Azure Resource Management.path
(string): The Azure or Graph API URL path to call (e.g. '/users', '/groups', '/subscriptions').method
(string): HTTP method to use (e.g., get, post, put, patch, delete)apiVersion
(string): Azure Resource Management API version (required for apiType Azure)subscriptionId
(string): Azure Subscription ID (for Azure Resource Management).queryParams
(string): Array of query parameters like select, etc. All parameters are strings.body
(JSON): The request body (for POST, PUT, PATCH)set-access-token
(New in v0.2.0)
accessToken
(string): The access token obtained from Microsoft Graph authenticationexpiresOn
(string, optional): Token expiration time in ISO formatget-auth-status
(New in v0.2.0)
The configuration of the server is done using environment variables. The following environment variables are supported:
Name | Description | Required |
---|---|---|
TENANT_ID |
The ID of the Microsoft Entra tenant. | Yes (except for client-provided token mode) |
CLIENT_ID |
The ID of the application registered in Microsoft Entra. | Yes (except for client-provided token mode) |
CLIENT_SECRET |
The client secret of the application registered in Microsoft Entra. | Yes (for client credentials mode only) |
USE_INTERACTIVE |
Set to "true" to enable interactive authentication mode. | No |
USE_CLIENT_TOKEN |
Set to "true" to enable client-provided token authentication mode. | No |
REDIRECT_URI |
Redirect URI for interactive authentication (default: http://localhost:3000). | No |
ACCESS_TOKEN |
Initial access token for client-provided token mode. | No |
To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your
claude_desktop_config.json
:
{
"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 for more details on how to create an Entra app and configure the agent.)
Please log in to share your review and rating for this MCP.