---
title: "Connect Microsoft Dynamics 365 Business Central to ChatGPT: Audit & GL"
slug: connect-microsoft-dynamics-365-business-central-to-chatgpt-audit-gl
date: 2026-08-24
author: Riya Sethi
categories: ["AI & Agents"]
excerpt: Learn how to connect Microsoft Dynamics 365 Business Central to ChatGPT using Truto's MCP server. A technical guide to automating GL auditing and trial balances.
tldr: Connect Microsoft Dynamics 365 Business Central to ChatGPT with Truto's MCP Server. Learn how to securely expose ERP data to LLMs for automated general ledger auditing and financial analysis.
canonical: https://truto.one/blog/connect-microsoft-dynamics-365-business-central-to-chatgpt-audit-gl/
---

# Connect Microsoft Dynamics 365 Business Central to ChatGPT: Audit & GL


If you need to connect Microsoft Dynamics 365 Business Central to ChatGPT to automate financial audits, extract general ledger entries, or track trial balances in real time, you need a [Model Context Protocol (MCP) server](https://truto.one/what-is-mcp-and-mcp-servers-and-how-do-they-work/). This server acts as the translation layer between ChatGPT's JSON-RPC tool calls and Business Central's complex OData REST APIs. 

If your team uses Claude, check out our guide on [connecting Microsoft Dynamics 365 Business Central to Claude](https://truto.one/connect-microsoft-dynamics-365-business-central-to-claude-sales-pay/) or explore our broader architectural overview on [connecting Microsoft Dynamics 365 Business Central to AI Agents](https://truto.one/connect-microsoft-dynamics-365-business-central-to-ai-agents-supply/).

Giving a Large Language Model (LLM) access to an [Enterprise Resource Planning (ERP) platform](https://truto.one/connect-ai-agents-to-netsuite-sap-concur-via-mcp-servers/) is an [architectural hurdle](https://truto.one/how-to-architect-an-ai-agent-to-erp-integration-a-code-first-tutorial/). You must handle strict multi-company tenant boundaries, complex concurrency tokens (ETags), and deeply nested financial dimensions. Every time you query a ledger, you are navigating a maze of relational data. You can either spend months [building, hosting, and maintaining a custom MCP server](https://truto.one/the-hands-on-guide-to-building-mcp-servers-for-ai-agents-2026/) to map these endpoints, or you can use Truto to dynamically generate a secure, authenticated MCP server URL in seconds.

This guide breaks down exactly how to use Truto to generate a managed MCP server for Microsoft Dynamics 365 Business Central, connect it natively to ChatGPT, and execute complex financial auditing workflows using natural language.

::cta{buttonText="Talk to us" buttonUrl="https://cal.com/truto/partner-with-truto"}
Stop writing boilerplate API integration code. Let Truto generate secure, managed MCP servers for your AI agents in seconds.
:::

## The Engineering Reality of the Business Central API

[A custom MCP server is a self-hosted integration layer](https://truto.one/the-hands-on-guide-to-building-mcp-servers-for-ai-agents-2026/). While the open MCP standard provides a predictable way for models to discover tools, implementing it against Microsoft Dynamics 365 Business Central is exceptionally painful. 

If you decide to build a Microsoft Dynamics 365 Business Central MCP server from scratch, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with this ERP:

### Mandatory Company Isolation and Routing
Business Central does not operate on a flat data model. Almost every meaningful financial record - ledger entries, invoices, trial balances - exists strictly within the context of a "Company". The API requires a `company_id` to be explicitly passed in the URL path for nearly every endpoint. When building custom MCP tools, you must ensure the LLM understands it cannot simply ask for "all ledger entries." It must first retrieve the correct `company_id` and inject it into subsequent tool calls. If your tool schemas do not enforce this dependency, ChatGPT will hallucinate IDs or drop them entirely, resulting in immediate API rejections.

### Concurrency Control via ETags
Business Central enforces strict concurrency control using OData ETags. If an LLM needs to update a vendor record, patch an invoice, or modify a customer, it cannot just send a `PATCH` request with the new data. The system requires the client to fetch the record first, extract the `@odata.etag` property, and pass it back exactly as received in an `If-Match` header. If another user modifies the record in the interim, the ETag changes, and the request fails. Writing tool schemas that force an LLM to accurately handle and pass ETag strings across multi-step execution chains is a notoriously brittle task. Truto's proxy API handlers simplify this by structurally requiring the `etag` field in update tools.

### Handling Rate Limits and HTTP 429s
Enterprise ERPs heavily throttle API traffic. When Business Central hits its threshold, it returns an HTTP 429 status code. It is critical to understand that Truto does not retry, throttle, or apply automatic backoff on rate limit errors. When the upstream API returns HTTP 429, Truto passes that error directly to the caller. Truto normalizes the upstream rate limit information into standardized headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`) per the IETF specification. Your client architecture - whether that is ChatGPT's internal retry logic or a custom agent orchestrator - is entirely responsible for reading these headers and executing the appropriate exponential backoff.

## How to Create the MCP Server

Truto automatically generates MCP tools based on the resources and documentation available for the Business Central integration. You can create the MCP server either through the Truto Dashboard or programmatically via the API.

### Method 1: Via the Truto UI

For teams who prefer a visual setup, generating the server takes only a few clicks.

1. Log into your Truto account and navigate to your **Integrated Accounts**.
2. Select the specific Microsoft Dynamics 365 Business Central account you want to connect to ChatGPT.
3. Click on the **MCP Servers** tab.
4. Click **Create MCP Server**.
5. Select your desired configuration. For an Audit & GL use case, you might choose to restrict access to `read` operations to ensure the LLM cannot accidentally modify accounting periods.
6. Click save and copy the generated MCP server URL (e.g., `https://api.truto.one/mcp/a1b2c3d4e5f6...`).

### Method 2: Via the Truto API

If you are dynamically provisioning AI workspaces for your users, you can generate MCP servers programmatically. 

Make a `POST` request to the `/integrated-account/:id/mcp` endpoint. You can enforce method filtering and tag filtering directly in the payload.

```typescript
const response = await fetch('https://api.truto.one/integrated-account/<YOUR_INTEGRATED_ACCOUNT_ID>/mcp', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <YOUR_TRUTO_API_TOKEN>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: "Business Central Audit MCP",
    config: {
      methods: ["read"], // Restricts the LLM to GET/LIST operations
      require_api_token_auth: false
    },
    expires_at: "2026-12-31T23:59:59Z"
  })
});

const mcpServer = await response.json();
console.log(mcpServer.url);
// Output: https://api.truto.one/mcp/a1b2c3d4e5f6...
```

The returned URL contains a cryptographic token that securely identifies the exact Business Central tenant. 

## How to Connect the MCP Server to ChatGPT

Once you have your Truto MCP URL, you need to expose it to ChatGPT. You can do this natively in the ChatGPT UI or by configuring a local proxy if you are running a custom desktop environment.

### Method 1: Via the ChatGPT UI

OpenAI provides native support for connecting remote MCP servers directly in the ChatGPT interface. 

1. Open ChatGPT and navigate to **Settings**.
2. Go to **Apps** and click on **Advanced settings**.
3. Ensure **Developer mode** is enabled (this unlocks MCP support).
4. Under the **MCP servers / Custom connectors** section, click **Add new server**.
5. Provide a recognizable name (e.g., "Business Central Audit").
6. Paste the Truto MCP URL into the **Server URL** field and click **Save**.

ChatGPT will immediately ping the endpoint, execute the `initialize` handshake, and register all available Business Central tools.

### Method 2: Via Manual Configuration File (CLI)

If you are using developer environments, custom agent orchestrators, or local desktop clients that require standard SSE (Server-Sent Events) transport, you can proxy the Truto URL using the official MCP CLI tool.

Create an `mcp-config.json` file:

```json
{
  "mcpServers": {
    "business_central": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "https://api.truto.one/mcp/<YOUR_TOKEN_HERE>"
      ]
    }
  }
}
```

This configuration instructs your local MCP client to wrap Truto's remote JSON-RPC HTTP endpoint into a standardized SSE stream.

## Hero Tools for Audit & GL

Business Central has a massive API surface. Truto dynamically generates highly specific tools for every endpoint, injecting schemas and descriptions so the LLM knows exactly how to use them. Here are the core tools required for financial auditing.

### List All Companies

Before ChatGPT can query any ledger, it must find the correct `company_id`. This tool returns all companies configured in the Business Central tenant.

*Usage notes:* The LLM should always execute this tool first to resolve the company name (e.g., "CRONUS USA, Inc.") to its GUID.

> "I need to audit our accounts. Please list all companies in Business Central and find the ID for CRONUS USA."

### List All General Ledger Entries

This is the core tool for extracting raw accounting data. It returns the GL entries including posting dates, document numbers, account IDs, debit amounts, credit amounts, and applied dimensions.

*Usage notes:* Requires the `company_id`. The response payload can be massive. If the LLM requests a specific date range, it should use query parameters to narrow the scope.

> "Fetch all general ledger entries for CRONUS USA posted in November. Look for any debit entries over $50,000."

### Get Trial Balance by ID

Extracts a specific trial balance record. It returns the total debits, total credits, and net balances for a specific account at a given date.

*Usage notes:* Useful for high-level reconciliation before digging into individual GL entries.

> "Check the trial balance for account 10400. What is the current balance at date credit?"

### List All Accounting Periods

Auditors need to know which financial periods are locked and which are open. This tool returns the starting dates, names, and lock status of all accounting periods.

*Usage notes:* The LLM can use this to determine if a requested transaction falls into a closed fiscal year.

> "List the accounting periods. Are there any periods from last year that have not yet been marked as closed or locked?"

### List All Purchase Invoices

Auditing the general ledger often requires cross-referencing payables. This tool fetches purchase invoices, expanding the invoice lines and dimension set lines automatically.

*Usage notes:* Essential for verifying that a GL expense entry matches a legitimate vendor invoice.

> "Get the list of all recent purchase invoices. I need to cross-reference them against the GL entries we just pulled to ensure the vendor numbers match."

To view the complete inventory of available endpoints, schemas, and return types, review the [Microsoft Dynamics 365 Business Central integration page](https://truto.one/integrations/detail/msbusinesscentral).

## Workflows in Action

When connected via MCP, ChatGPT stops acting as a basic text generator and becomes an autonomous financial auditor. Here is how the model handles real-world scenarios.

### Scenario 1: Month-End GL Anomaly Detection

A financial controller needs to quickly identify unusual expenses before locking the period.

> **User Prompt:** "Look up our company 'CRONUS USA'. Check if the current accounting period is closed. If it is open, pull the general ledger entries for the last 30 days and flag any single entry where the debit amount exceeds $25,000."

**Step-by-step Execution:**

1. **`list_all_microsoft_dynamics_365_business_central_companies`**: ChatGPT calls this tool to retrieve the environment's companies and extracts the `id` for CRONUS USA.
2. **`list_all_accounting_periods`**: Using the `company_id`, it fetches the periods. It identifies the current date, matches it to a period, and checks the `closed` and `dateLocked` boolean fields.
3. **`list_all_general_ledger_entries`**: Seeing the period is open, ChatGPT queries the GL. It processes the JSON array in memory.
4. **Analysis & Response**: ChatGPT filters the data, isolating the objects where `debitAmount` > 25000, and presents a formatted markdown table to the user detailing the `documentNumber`, `description`, and exact amounts.

```mermaid
sequenceDiagram
    participant User as User
    participant GPT as ChatGPT (MCP Client)
    participant Server as Truto MCP Server
    participant Upstream as Business Central API

    User->>GPT: "Check for GL anomalies in CRONUS USA..."
    GPT->>Server: Call list_all_microsoft_dynamics_365_business_central_companies
    Server->>Upstream: GET /v2.0/companies
    Upstream-->>Server: Return [{ id: "abc-123", name: "CRONUS USA" }]
    Server-->>GPT: Return company ID
    
    GPT->>Server: Call list_all_accounting_periods(company_id: "abc-123")
    Server->>Upstream: GET /v2.0/companies(abc-123)/accountingPeriods
    Upstream-->>Server: Return periods [ { closed: false } ]
    Server-->>GPT: Return open status

    GPT->>Server: Call list_all_general_ledger_entries(company_id: "abc-123")
    Server->>Upstream: GET /v2.0/companies(abc-123)/generalLedgerEntries
    Upstream-->>Server: Return GL array
    Server-->>GPT: Return GL array

    GPT-->>User: Present filtered anomalies table
```

### Scenario 2: Auditing Payable Discrepancies

An auditor notices a discrepancy in vendor spend and needs to trace a ledger entry back to its source invoice.

> **User Prompt:** "Find the general ledger entry with document number 'PINV-10042' in CRONUS USA. Then, retrieve the actual purchase invoice for that document and verify if the total amount including tax matches the ledger credit amount."

**Step-by-step Execution:**

1. **`list_all_microsoft_dynamics_365_business_central_companies`**: Resolves the `company_id`.
2. **`list_all_general_ledger_entries`**: ChatGPT fetches the ledger entries and searches the array for `documentNumber` == 'PINV-10042', noting the `creditAmount`.
3. **`list_all_purchase_invoices`**: ChatGPT fetches the purchase invoices for the company and locates the invoice matching that number.
4. **Analysis & Response**: ChatGPT compares the `creditAmount` from the ledger against the `totalAmountIncludingTax` from the invoice object and explains whether they balance or if there is a discrepancy.

## Security and Access Control

Giving an AI agent access to an ERP requires strict governance. Truto MCP servers are designed to operate securely with robust access controls built into the token lifecycle.

*   **Method Filtering:** By passing `config.methods: ["read"]` during server creation, you can physically block the LLM from executing `POST`, `PATCH`, or `DELETE` requests, ensuring the agent remains completely read-only.
*   **Tag Filtering:** You can restrict the server to only expose tools relevant to specific domains (e.g., exposing only ledger tools and hiding HR or payroll resources).
*   **Require API Token Auth:** Setting `require_api_token_auth: true` ensures that possessing the MCP URL is not enough. The client must also pass a valid Truto API token in the `Authorization` header, enforcing a secondary layer of authentication.
*   **Time-to-Live (TTL):** You can set an `expires_at` timestamp. Once the time is reached, Cloudflare KV automatically invalidates the token and a scheduled alarm cleans up the database record, ensuring zero lingering access for temporary AI audit tasks.

## Start Building AI Financial Automations

Integrating Microsoft Dynamics 365 Business Central with ChatGPT unlocks massive operational efficiency for finance teams. Instead of manually exporting CSVs and running pivot tables, teams can converse directly with their ERP data in real time. 

By leveraging Truto's dynamically generated MCP servers, you eliminate the need to write schema parsers, handle OAuth flows, or maintain complex server infrastructure. You define the rules, generate the URL, and let the AI go to work.

Ready to put your AI agents in touch with your enterprise data? [Talk to our engineering team](https://cal.com/truto/partner-with-truto) to get started.
