Listed from the MCP registry; nobody on Odel publishes it.
Administer Business Central environments, apps, PTEs, updates and exports via the Admin Center API.
Runs on your machine from its package; the steps are below.
At most: moves money, runs code or commands, deletes data, or sends messages for you.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y @demiliani/d365bc-admin-mcp
MCP client config
{
"mcpServers": {
"dynamics-365-business-central-admin": {
"command": "npx",
"args": [
"-y",
"@demiliani/d365bc-admin-mcp"
]
}
}
}A Model Context Protocol (MCP) server that enables AI assistants like Claude Desktop, GitHub Copilot, and Cursor to manage Dynamics 365 Business Central environments through natural language commands.
npm install -g @demiliani/d365bc-admin-mcp
To upgrade, run the same command with @latest. Close your AI assistant first (or stop the MCP server): on Windows a running server keeps its executable locked.
The server is also listed in the MCP Registry as io.github.demiliani/d365bc-admin-mcp, so clients that browse the registry (such as VS Code) can find and install it directly.
After installation, configure your AI assistant to use the MCP server.
Location:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonConfiguration:
{
"mcpServers": {
"d365bc-admin": {
"command": "d365bc-admin-mcp"
}
}
}
Steps:
The buttons add the server to your VS Code user configuration and run it through npx, so the global npm install is optional.
To configure it by hand, run MCP: Open User Configuration from the Command Palette (or create .vscode/mcp.json in a workspace) and add:
{
"servers": {
"d365bc-admin": {
"type": "stdio",
"command": "d365bc-admin-mcp"
}
}
}
Then start the server from the Start link shown above it in mcp.json (or MCP: List Servers) and use it from Copilot Chat in Agent mode.
Location: ~/.cursor/mcp.json (all projects) or .cursor/mcp.json in a project
Configuration:
{
"mcpServers": {
"d365bc-admin": {
"command": "d365bc-admin-mcp"
}
}
}
Save the file; the server appears under Cursor Settings → MCP, where it can be enabled and restarted.
The server first tries the credentials already available on the machine (Azure CLI, Visual Studio, environment variables, managed identity). Otherwise, on first use, a browser window opens for Microsoft Entra ID authentication: sign in with your Business Central administrator account.
The sign-in is kept across restarts: refresh tokens are stored in the operating system's encrypted token cache (Windows DPAPI, macOS Keychain, Linux keyring) and the account is remembered in %LOCALAPPDATA%/D365BCAdminMCP (~/Library/Application Support/D365BCAdminMCP on macOS, ~/.local/share/D365BCAdminMCP on Linux), so the browser opens again only when the refresh token expires. Where no encrypted store is available (e.g. Linux without a keyring), the login is kept in memory only. Set D365BC_MCP_PERSIST_TOKEN_CACHE=false to disable persistence; clear_cached_token signs out of a tenant.
If the browser window does not launch automatically, run the MCP tool force_interactive_auth (e.g., ask your assistant: "Force interactive login for tenant 00000000-0000-0000-0000-000000000000"). It skips Azure CLI / Visual Studio credentials and the saved sign-in, opens the Microsoft login dialog for the specified tenant and lets you choose a different account (useful when the machine is signed in with a user that has no access to that tenant).
No additional setup required - the MCP server handles authentication automatically!
Once configured, use natural language commands in your AI assistant:
"Show me all my Business Central environments"
"What's the status of my Production environment?"
"Create a new sandbox environment called 'Dev-Test' in the US"
"Copy Production environment to a new sandbox called 'Testing'"
"Delete the 'Old-Test' sandbox environment"
"Rename the 'Testing' sandbox to 'UAT'"
"Which points in time can I restore Production to? Restore it to yesterday 08:00 UTC as a sandbox called 'Prod-Restore'"
"Show the running environment operations and how many environments I can still create"
"Delete the Production environment" (you are asked to type 'Production' to confirm)
"Export the Production database to my storage account; how many exports are left this month?"
"Restrict Sandbox access to the 'BC Testers' security group"
"List all installed apps in Production"
"Show available updates for my apps"
"Install app with ID <app-id> in my Production environment"
"Update the Sales Module app to version 2.0"
"Uninstall the old Marketing app from Sandbox"
"Show active user sessions in Production"
"Terminate session abc123 in my Sandbox environment"
"Get the update window settings for Production"
"Set update window for Production to 10 PM - 6 AM UTC"
"Show storage usage for all environments"
"What's the storage usage for Production?"
"Install c:\\Packages\\MyPTE.app on Production (Fabrikam) during the update window"
"Install all .app files from c:\\Packages into Sandbox now, in dependency order, installing any missing AppSource apps"
"Show the scheduled PTE installs for Production and cancel the one for MyPTE 2.0.0.0"
"Check the extension deployment status for Fabrikam in Production"
The MCP server exposes 52 administrative tools organized by category:
| Tool | Description |
|---|---|
get_microsoft_entra_id_token | Sign in to a tenant and cache the token used by the other tools (returns status and expiry, never the token) |
force_interactive_auth | Force browser-based login and refresh the cached token for a tenant |
get_tenant_id_from_tenant_name | Retrieve tenant ID from tenant name |
| Tool | Description |
|---|---|
get_environment_informations | List all BC environments in a tenant |
create_new_environment | Create a new BC environment (optionally on a specific ring and application version) |
copy_environment | Copy an existing environment to create a new one |
delete_environment | Delete a Business Central environment |
recover_environment | Recover a recently deleted environment |
rename_environment | Rename an environment (its URL changes, so integrations must be updated) |
restore_environment | Restore an environment to a point in time as a new environment |
get_available_restore_periods | List the time ranges an environment can be restored to |
get_environment_operations | List environment operations (create, copy, rename, restore, ...) for the tenant or one environment |
get_environment_quotas | Get the environment and storage quotas of the tenant |
get_environment_update_window | Get update window settings for an environment |
set_environment_update_window | Configure update window for an environment |
set_environment_application_insights_connection_string | Set Application Insights connection string |
get_usage_storage_for_environment | Get storage usage for a specific environment |
get_usage_storage_for_all_environments | Get storage usage for all environments |
get_environment_companies | List companies in an environment |
| Tool | Description |
|---|---|
get_installed_apps | List apps installed in an environment |
get_available_app_updates | Check for available app updates |
install_app | Install a Marketplace (AppSource) app in a Business Central environment |
update_app | Update an app to a specific version |
uninstall_app | Remove an app from an environment |
get_app_operations | Get status of app install/update/uninstall operations |
| Tool | Description |
|---|---|
get_environment_updates | Check for available BC version updates |
set_environment_update | Schedule or run an environment update |
| Tool | Description |
|---|---|
get_active_sessions | List active user sessions in an environment |
kill_active_sessions | Terminate a specific active session |
| Tool | Description |
|---|---|
get_environment_notification_recipient | List notification recipients |
create_environment_notification_recipient | Add a new notification recipient |
delete_environment_notification_recipient | Remove a notification recipient |
| Tool | Description |
|---|---|
get_environment_security_group | Get the Microsoft Entra security group that restricts access to an environment |
set_environment_security_group | Restrict access to the members of a security group |
clear_environment_security_group | Remove the security group restriction |
get_access_with_m365_licenses | Check whether users can access the environment with Microsoft 365 licenses |
set_access_with_m365_licenses | Allow or disallow access with Microsoft 365 licenses |
| Tool | Description |
|---|---|
get_database_export_metrics | Exports allowed per month and remaining this month |
start_database_export | Export the environment database as a .bacpac file to an Azure Storage account |
start_database_export needs a paid subscription, the D365 BACKUP/RESTORE permission set and a Blob service SAS URI of an Azure standard storage account with Read, Write, Create and Delete permissions. The SAS URI is never logged or returned by the server, but it is part of the conversation with the AI assistant, so use a short-lived one. Track the export with get_environment_operations.
| Tool | Description |
|---|---|
get_available_features | List available features in an environment |
activate_feature | Activate a feature in a Business Central environment |
deactivate_feature | Deactivate a feature in a Business Central environment |
| Tool | Description |
|---|---|
install_pte | Upload a PTE (.app, max 50 MB) and install it immediately or on a schedule |
install_ptes_from_folder | Upload all .app files in a folder in dependency order, waiting for each immediate install |
get_scheduled_pte_operations | List scheduled PTE installs and updates |
cancel_scheduled_pte | Cancel a scheduled PTE install or update |
deploymentSchedule accepts Immediate, UpdateWindow, NextMinorUpdate and NextMajorUpdate (new PTEs only accept Immediate or UpdateWindow); syncMode accepts Add and ForceSync.
install_ptes_from_folder reads each package's manifest (app.json, or NavxManifest.xml generated by the compiler) and uploads an app only after the apps it depends on. All files are validated (size, readable manifest, duplicates, circular dependencies) before anything is uploaded; if an app fails, the apps depending on it are skipped.
Dependencies outside the folder (for example AppSource apps) are checked against the apps installed in the environment before anything is uploaded. With installMissingDependencies (default true), missing apps are installed and apps older than the declared minimum version are updated, waiting for each operation; they run immediately, also when the PTEs are scheduled, and go to the latest version available for the environment. If a dependency cannot be installed, only the PTEs depending on it are skipped. With installMissingDependencies = false the tool stops and lists what is missing. Microsoft platform apps (System Application, Base Application, ...) are never installed or updated: if the environment version is too old, an environment update is required.
These tools require an Admin Center role (Dynamics 365 Business Central Administrator, Dynamics 365 Administrator, or delegated admin).
Uploading PTEs through the Automation API is being removed in 2027 release wave 1 (version 30.0). Use the PTE Management tools above instead.
| Tool | Description |
|---|---|
get_extension_deployment_status | Get extension deployment status for an environment/company |
create_pte_upload | Create and upload a single PTE (.app) file |
create_pte_uploads_from_folder | Bulk upload PTEs from a folder, waiting for each deployment |
get_extension_upload | Retrieve the status of a specific extension upload task |
| Tool | Description |
|---|---|
clear_cached_token | Clear cached authentication token for a tenant |
get_token_cache_status | View cached token status for all tenants |
get_*) without confirmation. Tools that delete or break things (delete_environment, rename_environment, uninstall_app, kill_active_sessions, delete_environment_notification_recipient, cancel_scheduled_pte) are marked destructive, as are set_environment_security_group and clear_environment_security_group.deleteData in production, require the user to type the environment name. Clients that support MCP elicitation (confirmation prompts) show a prompt and a name supplied by the model is ignored; with other clients the assistant must ask the user and pass confirmEnvironmentName. Sandboxes are not affected.Retry-After (max 60 s). Read calls are also retried on 502, 504, network errors and timeouts; write calls are not, to avoid running an operation twice. Each HTTP request times out after 5 minutes.install_pte and install_ptes_from_folder, which also report progress. An operation already accepted by Business Central keeps running server-side; check it with get_app_operations or get_environment_operations.Install the package:
npm install -g @demiliani/d365bc-admin-mcp
📖 Need detailed installation instructions? See the Installation Guide for platform-specific steps (Windows, macOS, Linux) and troubleshooting.
Configure your AI assistant (see Configuration section above)
Start using it:
For detailed installation documentation, see:
npm install -g @demiliani/d365bc-admin-mcp
d365bc-admin-mcp --version
which d365bc-admin-mcp # macOS / Linux
where d365bc-admin-mcp # Windows
If the command still isn't found, add npm's global folder (npm prefix -g) to your PATH.
The npm package installs the server binary from an optional dependency for your platform (e.g. @demiliani/d365bc-admin-mcp-win-x64). Reinstall without --omit=optional / --no-optional.
A running server keeps its executable locked. Close VS Code, Claude Desktop or Cursor (or stop the MCP server), then run npm install -g @demiliani/d365bc-admin-mcp@latest again.
force_interactive_auth opens the browser immediately and lets you pick the account)The server writes its logs to stderr only (stdout is reserved for the MCP protocol). Set the D365BC_MCP_LOG_LEVEL environment variable to Debug, Information (default), Warning, Error or None. Access tokens and response bodies are never logged.
When an Admin Center API call fails, tools return the API error instead of a generic message, e.g. {"error": "HTTP 404 Not Found: EnvironmentNotFound: ..."}.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
Building from source requires the .NET 10 SDK (pinned in global.json). Build and run the tests (the same steps run in CI on every pull request):
dotnet build src/D365BCAdminMCP.sln
dotnet test src/D365BCAdminMCP.sln
npm run build publishes the native server for your platform into build/, and npm test starts it through the npm launcher and checks the MCP handshake and the tool list.
Releases are published by .github/workflows/release.yml with npm trusted publishing: GitHub Actions authenticates to npm with a short-lived OIDC token, so no npm token is stored anywhere, and every package gets a provenance attestation. The workflow only stages the packages; they go live when a maintainer approves them with 2FA.
Each release is seven npm packages: @demiliani/d365bc-admin-mcp (the launcher) and one package per platform with its server binary (@demiliani/d365bc-admin-mcp-win-x64, -win-arm64, -linux-x64, -linux-arm64, -osx-x64, -osx-arm64). The main package lists them as optional dependencies pinned to its own version, and npm installs only the one matching the user's OS and CPU.
To release:
npm version 1.4.0 --no-git-tag-version: it updates package.json and server.json, and the csproj reads the version from package.json. Merge it to main.git tag v1.4.0 && git push origin v1.4.0. The workflow refuses tags that don't match package.json or that point outside main. A tag such as v1.4.0-beta.1 publishes under the next dist-tag.@demiliani/d365bc-admin-mcp last. Approving the main package before the platform packages would briefly leave users without a binary.publish-mcp-registry.yml, which publishes server.json to the MCP Registry, logging in with GitHub OIDC (no secret). The registry checks that the npm version is live, so do this after step 4; if you didn't, re-run that workflow once the packages are approved. Prereleases are not sent to the registry.One-time setup:
npm-publish, and under Deployment branches and tags allow only tags matching v*. Optionally add required reviewers.v* so only maintainers can create, update or delete release tags.demiliani, repository D365BCAdminMCP, workflow filename release.yml, environment npm-publish, allowed action stage publish. npm expects the first publish through a new trusted publisher within 2 days of creating it.First release with platform packages: npm only lets you configure a trusted publisher on a package that already exists, so the six platform packages are published by hand once:
@demiliani/d365bc-admin-mcp and push the release tag. The Stage npm packages job fails on the first platform package, which doesn't exist yet.npm-packages artifact from that workflow run, then from its folder run npm login and for f in demiliani-d365bc-admin-mcp-*-<version>.tgz; do npm publish "$f"; done, or in PowerShell Get-ChildItem demiliani-d365bc-admin-mcp-*-<version>.tgz | ForEach-Object { npm publish $_.FullName }. The pattern matches the six platform packages, not the main one.This project is licensed under the MIT License - see the LICENSE file for details.
Built with:
Made with ❤️ for the Dynamics 365 Business Central community