🧩 Developer guide
Follow this guide if you want to build Lokka from source to contribute to the project.
Pre-requisites
- Follow the installation guide to install Node and the advanced guide if you wish to create a custom Entra application.
- Clone the Lokka repository from GitHub https://github.com/merill/lokka
Building the project
-
Open a terminal and navigate to the Lokka project directory.
-
Change into the folder
\src\mcp\ -
Run the following command to install the dependencies:
npm install -
After the dependencies are installed, run the following command to build the project:
npm run build -
When the build is complete, you will see a main.js file find the compiled files in the
\src\mcp\build\folder.
Configuring the agent
- Claude
- VS Code
-
In Claude Desktop, open the settings by clicking on the hamburger icon in the top left corner.
-
Select File > Settings (or press
Ctrl + ,) -
In the Developer tab, click Edit Config
-
This opens explorer, edit
claude_desktop_config.jsonin 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.
-
Note: On Windows the path needs to be escaped with
\\or use/instead of\.- E.g.
C:\\Users\\<username>\\Documents\\lokka\\src\\mcp\\build\\main.jsorC:/Users/<username>/Documents/lokka/src/mcp/build/main.js
- E.g.
-
Tip: Right-click on
build\main.jsin VS Code and selectCopy pathto copy the full path.
{
"mcpServers": {
"Lokka-Microsoft": {
"command": "node",
"args": [
"<absolute-path-to-main.js>/src/mcp/build/main.js"
],
"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
Testing with Claude Desktop
- 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 the users in my tenantShow me the details for John DoeChange John's department to IT- Needs User.ReadWrite.All permission to be granted
Pre-requisites
- Install the latest version of VS Code - Insider
- Install the latest version of GitHub Copilot in VS Code
VS Code
-
In VS Code, open the Command Palette by pressing
Ctrl + Shift +P(orCmd + Shift + Pon Mac). -
Type
MCPand selectCommand (stdio) -
Select
- Command:
node - Server ID:
Lokka-Microsoft
- Command:
-
Where to save configuration:
User Settings -
This will open the
settings.jsonfile in VS Code. -
Add the following configuration to the file, using the information you in the Overview blade of the Entra application you created earlier.
-
Note: On Windows the path needs to be escaped with
\\or use/instead of\.- E.g.
C:\\Users\\<username>\\Documents\\lokka\\src\\mcp\\build\\main.jsorC:/Users/<username>/Documents/lokka/src/mcp/build/main.js
- E.g.
-
Tip: Right-click on
build\main.jsin VS Code and selectCopy pathto copy the full path.
"mcp": {
"servers": {
"Lokka-Microsoft": {
"command": "node",
"args": [
"<absolute-path-to-main.js>/src/mcp/build/main.js"
],
"env": {
"TENANT_ID": "<tenant-id>",
"CLIENT_ID": "<client-id>",
"CLIENT_SECRET": "<client-secret>"
}
}
}
}
File>Saveto save the file.
Testing the agent
- Start a new instance of VS Code (File > New Window)
- Open
Copilot EditsfromView→Copilot Edits - At the bottom of the Copilot Edits panel (below the chat box)
- Select
Agent(if it is showingEdit) - Select
Claude 3.7 Sonnet(if it is showingGPT-40)
- Select
Testing with MCP Inspector
MCP Inspector is a tool that allows you to test and debug your MCP server directly (without an LLM). It provides a user interface to send requests to the server and view the responses.
See the MCP Inspector for more information.
npx @modelcontextprotocol/inspector node path/to/server/main.js args...
Releasing a new version
Releases are fully automated with GitHub Actions — publishing a new build is a single click and you never edit version numbers by hand.
Publishing a new build (patch release)
- Go to the repo's Actions tab → Publish to npm → Run workflow.
- Click Run workflow (leave all the defaults).
That's it. The workflow:
- bumps the patch version automatically (e.g.
2.0.0→2.0.1), - builds the server and all the interactive app bundles,
- runs the full UI test suite (the publish is blocked if any test fails),
- publishes to npm with provenance attestation,
- commits the version bump back to
main(commit messageRelease vX.Y.Z).
Major or minor version upgrades
Use the same workflow — just pick a different option in the Version bump dropdown when running it:
| Bump | Example | When to use |
|---|---|---|
patch (default) | 2.0.0 → 2.0.1 | Bug fixes, small tweaks — the everyday release |
minor | 2.0.5 → 2.1.0 | New features, backwards compatible |
major | 2.1.3 → 3.0.0 | Breaking changes |
There is no need to edit package.json manually — the workflow computes the new version, publishes it and commits it back.
Where the version number lives
src/mcp/package.json is the single source of truth. Everything else derives from it automatically:
- the MCP server reports it to clients at runtime (read from
package.jsonon startup), - the MCPB bundle manifest is synced from it at pack time,
- npm publishes whatever it says.
Other workflow options
- dist-tag — publish under a different npm tag (e.g.
nextorbeta) to ship a preview without changing whatnpx @merill/lokkaresolves to. - Dry run — runs the whole pipeline (bump, build, test, pack) but publishes nothing and commits nothing. Useful for verifying a release before shipping it.
Publishing authenticates via npm trusted publishing (OIDC) — there are no npm tokens to manage or rotate. This is configured once on npmjs.com under the package's settings (Trusted Publisher → GitHub Actions → repo merill/lokka, workflow publish-npm.yml).
Learn about MCP
- Model Context Protocol Tutorial by Matt Pocock - This is a great tutorial that explains the Model Context Protocol and how to use it.
- Model Context Protocol docs - The official docs for the Model Context Protocol.
- Model Context Protocol Clients - List of all the clients that support the Model Context Protocol.