Lokka is an MCP server that bridges Microsoft Azure/Graph APIs with any compatible MCP client, allowing you to manage your Azure and Microsoft 365 tenants through natural language queries. It works with AI models and clients that support the Model Context Protocol, giving you a simple way to interact with Microsoft cloud resources.
Lokka can be installed and configured to run with your MCP client using one of the following authentication methods.
Lokka supports three authentication approaches to fit different scenarios:
This method uses traditional service-to-service authentication:
{
"mcpServers": {
"Lokka-Microsoft": {
"command": "npx",
"args": ["-y", "@merill/lokka"],
"env": {
"TENANT_ID": "<tenant-id>",
"CLIENT_ID": "<client-id>",
"CLIENT_SECRET": "<client-secret>"
}
}
}
}
For user-based authentication with an interactive login experience:
{
"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"
}
}
}
}
For scenarios where the MCP client provides access tokens:
{
"mcpServers": {
"Lokka-Microsoft": {
"command": "npx",
"args": ["-y", "@merill/lokka"],
"env": {
"USE_CLIENT_TOKEN": "true"
}
}
}
}
To use Lokka with client-provided tokens:
USE_CLIENT_TOKEN=true
environment variableset-access-token
tool to provide a valid Microsoft Graph access tokenget-auth-status
toolset-access-token
againAfter configuring Lokka with your MCP client, you can start making natural language queries. Here are some examples:
For more detailed information, visit the documentation at Lokka.dev:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "Lokka-Microsoft" '{"command":"npx","args":["-y","@merill/lokka"],"env":{"TENANT_ID":"<tenant-id>","CLIENT_ID":"<client-id>","CLIENT_SECRET":"<client-secret>"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"Lokka-Microsoft": {
"command": "npx",
"args": [
"-y",
"@merill/lokka"
],
"env": {
"TENANT_ID": "<tenant-id>",
"CLIENT_ID": "<client-id>",
"CLIENT_SECRET": "<client-secret>"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"Lokka-Microsoft": {
"command": "npx",
"args": [
"-y",
"@merill/lokka"
],
"env": {
"TENANT_ID": "<tenant-id>",
"CLIENT_ID": "<client-id>",
"CLIENT_SECRET": "<client-secret>"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect