> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dema.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Dynamics 365 Business Central

> Connect the Dema Agent to Business Central records and business processes through Microsoft's hosted MCP server.

## Overview

Once Microsoft Dynamics 365 Business Central is connected, the Dema Agent can work with ERP records from one company in your Business Central online environment. It can answer questions about customers, items, sales orders, invoices, and other records exposed through Business Central APIs.

Business Central exposes read-only tools by default. A Business Central administrator can create an MCP configuration to allow selected create, modify, delete, or business-process actions.

The agent signs in as the person who connects the integration. It cannot access records or perform actions that person is not allowed to use in Business Central.

***

## Prerequisites

* A **Business Central online** environment.
* A Business Central user with access to the company and records the agent should use.
* Your Business Central environment name and company name. You can [find your Microsoft Entra tenant ID](#find-your-microsoft-entra-tenant-id) using the steps below.
* A Microsoft Entra administrator to approve Dema's Business Central permission the first time your tenant connects.
* For a custom MCP configuration, a Business Central administrator with the **MCP - ADMIN** permission set or equivalent permissions.

***

## Choose the agent's access

### Read-only access

You do not need to create an MCP configuration for read-only access. Leave **MCP configuration** empty when you connect. The agent can read the standard Business Central API pages that the signed-in user can access.

### Selected read and write access

To choose which API pages and actions the agent can use:

1. In Business Central, search for and open **Model Context Protocol (MCP) Server Configurations**.
2. Select **New**, give the configuration a recognizable name, and turn on **Active**.
3. Add the API page objects the agent needs under **Available Tools**.
4. Grant **Allow Read** where needed.
5. To allow changes, turn on **Unblock Edit Tools**, then grant only the required **Allow Create**, **Allow Modify**, **Allow Delete**, and **Allow Bound Actions** permissions.

Use the smallest set of tools and actions the agent needs. The signed-in user's Business Central permissions still apply in addition to the MCP configuration.

***

## Collect the connection values

Enter these values in Dema:

| Dema field                       | Business Central connection string | Description                                                         |
| -------------------------------- | ---------------------------------- | ------------------------------------------------------------------- |
| **Microsoft Entra tenant ID**    | `TenantId`                         | The tenant GUID for your Business Central environment               |
| **Business Central environment** | `EnvironmentName`                  | The environment name, such as `Production` or the name of a sandbox |
| **Business Central company**     | `Company`                          | The exact company name in the selected environment                  |
| **MCP configuration**            | `ConfigurationName`                | Optional; the active MCP configuration to use                       |

### Find your Microsoft Entra tenant ID

The tenant ID is a GUID in a format such as `aaaabbbb-0000-cccc-1111-dddd2222eeee`. It is not your company name, Microsoft login email, or a domain such as `example.onmicrosoft.com`.

The quickest way to find it is in Business Central:

1. Open the **Help** menu in the upper-right corner of Business Central.
2. Select **Help & Support**.
3. Copy the tenant ID shown on the page and paste it into the **Microsoft Entra tenant ID** field in Dema.

You can also find it in the [Microsoft Entra admin center](https://entra.microsoft.com/):

1. Sign in with a work account from the same organization as your Business Central environment.
2. Go to **Entra ID → Overview → Properties**.
3. Scroll to **Tenant ID** and copy the GUID.

If you belong to more than one Microsoft organization, check that you selected the directory used by Business Central. If you cannot open the Entra properties, ask your Microsoft 365 or Business Central administrator to copy the tenant ID from the Business Central **Help & Support** page.

If you created an MCP configuration, open it in Business Central and select **Advanced → Connection String** to copy all the connection values at once. The value after `TenantId=` is the tenant ID. Company and configuration names may include spaces and non-English characters; paste their original names into Dema.

***

## Connect Business Central

<Steps>
  <Step title="Open the integration">
    In Dema, go to **Agents → Settings → Integrations**, find **Microsoft Dynamics 365 Business Central**, and click **Connect**.
  </Step>

  <Step title="Enter the connection values">
    Enter the Microsoft Entra tenant ID, environment, and company you collected above. Enter the MCP configuration name if you created one; otherwise leave it empty for the default read-only tools. Click **Add**.
  </Step>

  <Step title="Sign in and approve">
    Sign in with a Microsoft work account from the same Entra tenant. The account must have access to the selected Business Central environment and company.

    The first connection from your tenant may require a Microsoft Entra administrator to approve Dema's Business Central permission.

    <Check>
      You are returned to Dema with the integration marked as Active.
    </Check>
  </Step>

  <Step title="Check the connection">
    Ask the agent a read-only question, for example: *"Which sales orders are still open?"* If you enabled a write tool, test it with a low-risk record and confirm the proposed action before it runs.
  </Step>
</Steps>

To use the connection with an agent you created, open that agent and add it under **Configuration → Integrations**. See [Your agents](/guides/agent/your-agents#integrations).

***

## Access Dema requests

| Microsoft permission       | What it allows                                                                                  |
| -------------------------- | ----------------------------------------------------------------------------------------------- |
| `Financials.ReadWrite.All` | Authorize Dema to call the official Business Central MCP server on behalf of the signed-in user |

This permission does not make every operation available automatically. The effective access is the intersection of:

* The tools and actions exposed by the selected Business Central MCP configuration.
* The signed-in user's Business Central permissions.
* The tool permissions configured for the Dema agent.

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Microsoft says administrator approval is required" icon="user-lock">
    A Microsoft Entra administrator must approve Dema's Business Central permission for your tenant. After approval, return to Dema and reconnect.
  </Accordion>

  <Accordion title="The connection is Active, but the agent cannot find records" icon="magnifying-glass">
    Check that the tenant ID, environment, and company exactly match the intended Business Central environment. Also confirm that the account used to connect can open the records in Business Central.
  </Accordion>

  <Accordion title="The agent only has read tools" icon="pen-to-square">
    Write tools require an active MCP configuration. In Business Central, confirm **Unblock Edit Tools** is on and the required create, modify, delete, or bound-action permissions are selected. Then confirm the exact configuration name is entered in Dema and that the signed-in user has the matching Business Central permissions.
  </Accordion>

  <Accordion title="The MCP configuration is not found" icon="gear">
    Configuration names are specific to an environment and company. Check the spelling and capitalization against **Advanced → Connection String** in Business Central, and make sure the configuration is Active.
  </Accordion>

  <Accordion title="The agent connects to the wrong company" icon="building">
    Click **Reconnect** on the integration card and replace the environment or company with the exact values from the intended Business Central connection string.
  </Accordion>
</AccordionGroup>

If you are still stuck, contact [support](mailto:info@dema.ai) with the integration name and the error message you see.

***

## Additional resources

* [Business Central MCP Server overview](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/mcp-overview)
* [Configure the Business Central MCP Server](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/configure-mcp-server)
* [Find your Microsoft Entra tenant ID](https://learn.microsoft.com/entra/fundamentals/how-to-find-tenant)
