D365BCAdminMCP

demiliani/D365BCAdminMCP

3.3

If you are the rightful owner of D365BCAdminMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Dynamics 365 Business Central Admin MCP Server is a Model Context Protocol server that allows AI assistants to manage Business Central environments using natural language commands.

Tools
3
Resources
0
Prompts
0

Dynamics 365 Business Central Admin MCP Server

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.

🌟 Features

  • 🔐 Interactive Authentication - Secure Microsoft Entra ID authentication with browser-based login
  • 📦 33 Administrative Tools - Complete environment, app, session, PTE upload, and extension management
  • Smart Token Caching - Automatic token refresh to minimize authentication prompts
  • 🌍 Multi-Tenant Support - Manage multiple Business Central tenants seamlessly
  • 💬 Natural Language Interface - Control BC through conversational AI commands
  • 🔒 Secure by Design - No credentials stored, uses Azure authentication standards

📦 Installation

Via npm (Recommended)

npm install -g @demiliani/d365bc-admin-mcp

Prerequisites

  • Node.js 16+ - Download
  • Dynamics 365 Business Central - Admin access to your tenant
  • Microsoft Entra ID - Azure account with BC admin privileges

⚙️ Configuration

After installation, configure your AI assistant to use the MCP server.

Claude Desktop

Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Configuration:

{
  "mcpServers": {
    "d365bc-admin": {
      "command": "d365bc-admin-mcp"
    }
  }
}

Steps:

  1. Open the configuration file (create it if it doesn't exist)
  2. Add the above configuration
  3. Save the file
  4. Restart Claude Desktop
  5. You should see the MCP server connected in the chat window

GitHub Copilot (VS Code)

Location: .vscode/settings.json in your workspace or global settings

Configuration:

{
  "github.copilot.chat.mcp.servers": {
    "d365bc-admin": {
      "command": "d365bc-admin-mcp"
    }
  }
}

Steps:

  1. Open VS Code Settings (JSON)
  2. Add the above configuration
  3. Save the file
  4. Restart VS Code
  5. Open GitHub Copilot Chat to start using the MCP server

Cursor

Location: .cursor/config.json in your workspace

Configuration:

{
  "mcp": {
    "servers": {
      "d365bc-admin": {
        "command": "d365bc-admin-mcp"
      }
    }
  }
}

Steps:

  1. Create .cursor/config.json in your workspace root
  2. Add the above configuration
  3. Save the file
  4. Restart Cursor
  5. The MCP server will be available in Cursor's AI chat

🔐 Authentication

On first use, a browser window will open for Microsoft Entra ID authentication. Sign in with your Business Central administrator account. The token is cached for 50 minutes and automatically refreshed.

No additional setup required - the MCP server handles authentication automatically!

💡 Usage Examples

Once configured, use natural language commands in your AI assistant:

Environment Management

"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"

Application Management

"List all installed apps in Production"
"Show available updates for my apps"
"Update the Sales Module app to version 2.0"
"Uninstall the old Marketing app from Sandbox"

Session Management

"Show active user sessions in Production"
"Terminate session abc123 in my Sandbox environment"

Update Windows

"Get the update window settings for Production"
"Set update window for Production to 10 PM - 6 AM UTC"

Storage & Monitoring

"Show storage usage for all environments"
"What's the storage usage for Production?"

Extension Deployment & PTE Uploads

"Upload the app c:\\Packages\\MyPTE.app to Production (Fabrikam)"
"Bulk upload all .app files from c:\\Packages into Sandbox and wait for deployments"
"Check the extension deployment status for Fabrikam in Production"

🛠️ Available Tools (33 Total)

The MCP server exposes 33 administrative tools organized by category:

🔑 Authentication & Tenant Management (2 tools)

ToolDescription
get_microsoft_entra_id_tokenGet authentication token with intelligent caching
get_tenant_id_from_tenant_nameRetrieve tenant ID from tenant name

🌍 Environment Management (10 tools)

ToolDescription
get_environment_informationsList all BC environments in a tenant
create_new_environmentCreate a new BC environment
copy_environmentCopy an existing environment to create a new one
delete_environmentDelete a Business Central environment
get_environment_update_windowGet update window settings for an environment
set_environment_update_windowConfigure update window for an environment
set_app_insights_keySet Application Insights connection string
get_environment_storage_usageGet storage usage for a specific environment
get_all_environments_storage_usageGet storage usage for all environments
get_companiesList companies in an environment

📦 Application Management (5 tools)

ToolDescription
get_installed_appsList apps installed in an environment
get_available_app_updatesCheck for available app updates
update_appUpdate an app to a specific version
uninstall_appRemove an app from an environment
get_app_operationsGet status of app install/update/uninstall operations

🔄 Environment Updates (2 tools)

ToolDescription
get_available_environment_updatesCheck for available BC version updates
schedule_environment_updateSchedule or run an environment update

👥 Session Management (2 tools)

ToolDescription
get_active_sessionsList active user sessions in an environment
kill_active_sessionsTerminate a specific active session

🔔 Notification Management (3 tools)

ToolDescription
get_notification_recipientsList notification recipients
create_notification_recipientAdd a new notification recipient
delete_notification_recipientRemove a notification recipient

🔧 Feature Management (3 tools)

ToolDescription
get_available_featuresList available features in an environment
activate_featureActivate a feature in a Business Central environment
deactivate_featureDeactivate a feature in a Business Central environment

🧩 Extension Deployment & PTE Uploads (4 tools)

ToolDescription
get_extension_deployment_statusGet extension deployment status for an environment/company
create_pte_uploadCreate and upload a single PTE (.app) file
create_pte_uploads_from_folderBulk upload PTEs from a folder, waiting for each deployment
get_extension_uploadRetrieve the status of a specific extension upload task

🧹 Token Management (2 tools)

ToolDescription
clear_cached_tokenClear cached authentication token for a tenant
get_token_cache_statusView cached token status for all tenants

🎯 Quick Start

  1. Install the package:

    npm install -g @demiliani/d365bc-admin-mcp
    

    📖 Need detailed installation instructions? See the for platform-specific steps (Windows, macOS, Linux) and troubleshooting.

  2. Configure your AI assistant (see Configuration section above)

  3. Start using it:

    • Open your AI assistant (Claude, Copilot, or Cursor)
    • Type: "Show me all my Business Central environments"
    • Authenticate when prompted (first time only)
    • Start managing your BC environments with natural language!

📚 Documentation

For detailed installation documentation, see:

  • - Detailed installation steps

🔍 Troubleshooting

"Command not found: d365bc-admin-mcp"

npm install -g @demiliani/d365bc-admin-mcp
which d365bc-admin-mcp

Authentication Issues

  • Ensure you have Business Central admin privileges
  • Check that you're signing in with the correct Microsoft account
  • Try clearing the token cache: "Clear cached token for tenant [tenant-id]"

MCP Server Not Appearing

  • Verify the config file location for your OS
  • Check for JSON syntax errors in the config
  • Restart your AI assistant completely
  • Check the assistant's logs for error messages

🤝 Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

📄 License

This project is licensed under the MIT License - see the file for details.

📮 Support

🙏 Acknowledgments

Built with:


Made with ❤️ for the Dynamics 365 Business Central community