Lokka (Microsoft Graph) logo

Lokka (Microsoft Graph)

Community
merill

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

Publishermerill
Repositorylokka
LanguageJavaScript
Forks
65
Stars
247
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Lokka (Microsoft Graph) exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    247 stars and 65 forks from the linked repository.

Lokka

npm version

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.

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?

How does Lokka work?

Authentication Methods

Lokka now supports multiple authentication methods to accommodate different deployment scenarios:

Interactive Auth

For user-based authentication with interactive login, you can use the following configuration:

This is the simplest config and uses the default Lokka app.

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

Interactive auth with custom app

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:

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

App-Only Auth

Traditional app-only authentication. You can use either certificate (recommended) or client secret authentication with the following configuration.

See Install Guide for more details on how to create an Entra app.

App-Only Auth with Certificate

App only authentication using a PEM-encoded client certificate:

json
{
  "mcpServers": {
    "Lokka-Microsoft": {
      "command": "npx",
      "args": ["-y", "@merill/lokka"],
      "env": {
        "TENANT_ID": "<tenant-id>",
        "CLIENT_ID": "<client-id>",
        "CERTIFICATE_PATH": "/path/to/certificate.pem",
        "CERTIFICATE_PASSWORD": "<optional-certificate-password>",
        "USE_CERTIFICATE": "true"
      }
    }
  }
}

For comfort, in order to convert a PFX client certificate to a PEM-encoded certificate:

bash
openssl pkcs12 -in /path/to/cert.pfx -out /path/to/cert.pem -nodes -clcerts

App-Only Auth with Client Secret

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

Client-Provided Token

Token-based authentication where the MCP Client provides access tokens:

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

When using client-provided token mode:

  1. Start the MCP server with USE_CLIENT_TOKEN=true
  2. Use the set-access-token tool to provide a valid Microsoft Graph access token
  3. Use the get-auth-status tool to verify authentication status
  4. Refresh tokens as needed using set-access-token

New Tools

Token Management Tools

  • set-access-token: Set or update access tokens for Microsoft Graph authentication
  • get-auth-status: Check current authentication status and capabilities
  • add-graph-permission: Request additional Microsoft Graph permission scopes interactively

Graph API Version Control

Lokka now supports controlling the default Microsoft Graph API version used for all requests:

  • Default behavior: Uses beta version for access to latest features
  • Production mode: Set USE_GRAPH_BETA=false to force all requests to use v1.0 version
  • Per-request override: You can still specify graphApiVersion parameter in individual requests (unless USE_GRAPH_BETA=false)

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.

Getting started

See the docs for more information on how to install and configure Lokka.

One-click install for VS Code

PlatformVS CodeVS Code Insiders
WindowsInstall in VS CodeInstall in VS Code Insiders
macOS/LinuxInstall in VS CodeInstall in VS Code Insiders

Components

Tools

  1. Lokka-Microsoft

    • Call Microsoft Graph & Azure APIs. Supports querying Azure and Microsoft 365 tenants. Updates are also supported if permissions are provided.
    • Input:
      • 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 $filter, $select, etc. All parameters are strings.
      • body (JSON): The request body (for POST, PUT, PATCH)
    • Returns: Results from the Azure or Graph API call.
  2. set-access-token (New in v0.2.0)

    • Set or update an access token for Microsoft Graph authentication when using client-provided token mode.
    • Input:
      • accessToken (string): The access token obtained from Microsoft Graph authentication
      • expiresOn (string, optional): Token expiration time in ISO format
    • Returns: Confirmation of token update
  3. get-auth-status (New in v0.2.0)

    • Check the current authentication status and mode of the MCP Server
    • Returns: Authentication mode, readiness status, and capabilities

Environment Variables

The configuration of the server is done using environment variables. The following environment variables are supported:

NameDescriptionRequired
TENANT_IDThe ID of the Microsoft Entra tenant.Yes (except for client-provided token mode)
CLIENT_IDThe ID of the application registered in Microsoft Entra.Yes (except for client-provided token mode)
CLIENT_SECRETThe client secret of the application registered in Microsoft Entra.Yes (for client credentials mode only)
USE_INTERACTIVESet to "true" to enable interactive authentication mode.No
USE_CLIENT_TOKENSet to "true" to enable client-provided token authentication mode.No
USE_CERTIFICATESet to "true" to enable certificate authentication mode.No
CERTIFICATE_PATHPath to the PEM-encoded certificate file for certificate authentication.Yes (for certificate mode only)
CERTIFICATE_PASSWORDPassword for the certificate file (if encrypted).No
REDIRECT_URIRedirect URI for interactive authentication (default: http://localhost:3000).No
ACCESS_TOKENInitial access token for client-provided token mode.No
USE_GRAPH_BETASet to "false" to force all Graph API calls to use v1.0 instead of beta (default: true, allows beta).No

Contributors

  • Interactive and Token-based Authentication (v0.2.0) - @darrenjrobinson
  • Certificate Authentication (v0.2.1) - @nitzpo

Installation

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

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

Client Credentials Authentication

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.)

Installation

TypingMind
Prerequisites:

Node.js 18+

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

Use Lokka (Microsoft Graph) MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Lokka (Microsoft Graph) is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Lokka (Microsoft Graph) as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Lokka (Microsoft Graph) MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "lokka-microsoft-graph": {
      "command": "npx",
      "args": [
        "-y",
        "@merill/lokka"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Lokka (Microsoft Graph) MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Lokka (Microsoft Graph) MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Lokka (Microsoft Graph) to help me with this task?
Lokka (Microsoft Graph)
Sure. I read it.
Here is what I found using Lokka (Microsoft Graph).

Frequently asked questions

What is the Lokka (Microsoft Graph) MCP server used for?

Lokka (Microsoft Graph) is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Lokka (Microsoft Graph) MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Lokka (Microsoft Graph) with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Lokka (Microsoft Graph) MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Lokka (Microsoft Graph) connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Lokka (Microsoft Graph) MCP to TypingMind?

Lokka (Microsoft Graph) runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Lokka (Microsoft Graph) MCP provide in TypingMind?

Lokka (Microsoft Graph) exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Lokka (Microsoft Graph) MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Lokka (Microsoft Graph) requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇