Thursday, 12 February 2026

Testing Your MCP Connection with Real Business Central Questions and Best Practices (BLOG 4 OF 4)

 Validating Your BC MCP Setup with Real-World Queries


Introduction

Your BcMCPProxy is built, Claude Desktop is configured, and the BC MCP Server is live. Now let’s put it all to the test.

In this final post, we go beyond simple data lookups. The real power of connecting an AI agent to Business Central is not just reading records. It is asking business questions in plain English and getting visual, actionable answers. We will walk through two scenarios that demonstrate exactly that, followed by best practices for working with AI agents.

Scenario 1: Project Budget vs. Actual Analysis

This is where things get interesting. Instead of opening BC, navigating to project ledger entries, exporting to Excel, and building a chart manually, you just ask.

Prompt

"I want to see budget vs actual for all Projects

 with a nice graphic view"

What Happens Behind the Scenes

Claude does not just make one API call. It thinks through the problem and executes multiple steps:

1.    Claude identifies that it needs project data with budget and actual figures. It calls the BC MCP Server to read the Project API page.

2.    It retrieves budget amounts and actual costs for all projects. If the data spans multiple API pages (project tasks, project planning lines, project ledger entries), Claude calls each one as needed.

3.    Claude then generates an interactive chart, typically a grouped bar chart, comparing budget vs. actual for each project side by side.

4.    The chart is rendered as a visual artifact directly inside Claude Desktop. No Excel export. No copy-paste. Just ask and see.

✅ Setup Note

For this scenario, I created a custom API page in Business Central that exposes the Job Planning Lines table with all the relevant budget and actual fields. The standard BC APIs do not include project planning data out of the box, so a custom API page was needed to give the agent access to this information. This is a common pattern: if the data you want is not available through standard APIs, build a custom API page, add it to your MCP configuration, and the agent can use it immediately.

Why This Matters

Think about how long this takes the traditional way. Open BC, navigate to the right page, apply filters, export to Excel, format the data, build a pivot chart, adjust colors and labels. That is 15 to 30 minutes of work, depending on how many projects you have.

With MCP, you type one sentence and get a visual answer in seconds. The agent handles all the API calls, data shaping, and visualization for you.

Expected result: A bar chart showing budget vs. actual cost for every project in your BC environment along with total budget, actual cost, remaining budget and budget utilization.





✅ Pro Tip

You can refine the prompt to focus on specific projects or add more detail. For example: "Show me budget vs actual for projects J00010 and J00030 with a breakdown by project task." The more specific your prompt, the more targeted the output.

 

✅ Prompt Refinement

If the initial chart does not look quite right, just tell Claude what to change. "Make it a horizontal bar chart instead" or "Add percentage variance labels" or "Only show projects that are over budget." The agent iterates on the visualization without you touching any code.


Scenario 2: Available Inventory Overview

Inventory visibility is one of those things that everyone needs but nobody wants to build reports for. Let’s skip the report.

Prompt

"Show me available inventory in a nice chart"

What Happens Behind the Scenes

1.    Claude calls the BC MCP Server to read the Item API page and retrieves all items with their inventory quantities.

2.    It filters for items that actually have inventory on hand (skipping zero-stock items to keep the chart clean).

3.    Claude generates a visual chart. Depending on the number of items, it might use a bar chart for a smaller catalog or a treemap/bubble chart for a larger one.

4.    The chart is rendered as an interactive artifact in Claude Desktop, with item numbers, descriptions, and quantities.

Why This Matters

This is a question that gets asked in every warehouse meeting, every sales call, and every planning session. Instead of logging into BC, navigating to the item list, sorting by inventory, and maybe exporting it for a visual, you just ask.

And because it is conversational, you can immediately follow up: "Which items are below their reorder point?" or "Show me just the items in the FINISHED category" or "What is the total inventory value?" The agent keeps the context and builds on the previous answer.

Expected result: A visual chart showing available inventory quantities across your items. Items with the highest stock levels are immediately visible. Zero-stock items are excluded for clarity.





✅ Taking It Further

Try chaining requests: "Show me available inventory, then highlight items that have not had any sales in the last 90 days." Claude can cross-reference inventory data with sales data across multiple API calls to surface slow-moving stock. This kind of ad-hoc analysis used to require a dedicated report. Now it is a conversation.


The Bigger Picture

These two scenarios are just the beginning. The pattern is always the same: ask a business question in plain English, and the AI agent figures out which BC API pages to call, fetches the data, and presents it visually.

Here are a few more ideas to try once your setup is working:

        "Show me a trend of sales order totals by month for the last 12 months."

        "Which customers have overdue balances? Show me a breakdown by aging bucket."

        "Compare actual vs. budget for GL accounts in the 6000 range this quarter."

        "What are our top 10 selling items by revenue this year? Show me a chart."

Each of these would traditionally require navigation, filtering, exporting, and charting. With MCP, they are one-line prompts.

 

 

Best Practices

Security

        Least privilege: Start with a read-only MCP configuration. Only enable write operations after thorough testing.

        No secrets in config: No passwords or secrets are stored. The proxy uses Azure’s delegated auth flow.

        Separate configurations: Create purpose-specific configurations (e.g., Finance-ReadOnly, Sales-ReadWrite).

        Audit access: Review who has the MCP - ADMIN permission set in BC.

Working with Agents

        Be precise: Agents work best with specific, clear requests. “Show me customers” is good; “Show me the top 10 customers sorted by balance” is better.

        Request complete data: When you need all records, say so explicitly and instruct the agent not to use the top parameter.

        Understand tool calls: Each MCP tool call is a separate API request. Complex queries may take a few seconds.

        Review before approving: For sensitive operations, the agent will ask for confirmation. This is by design.

Maintenance

        Stay current: The BC MCP Server is in public preview and may change. Watch the Microsoft Learn documentation for updates.

        Expand over time: As BC evolves, new API pages may become available. Add them to your MCP configuration to expand agent capabilities.

        Test after updates: If something breaks after a BC update, re-check Feature Management and MCP configuration.


Conclusion

Over these four posts, we have gone from understanding what AI agents and MCP are, through enabling the BC MCP Server and configuring it, to building a proxy executable and testing it with real business questions.

The key takeaway is this: the value is not in reading individual records. It is in asking business questions and getting visual, actionable answers in seconds. Budget vs. actual comparisons, inventory overviews, trend analysis. All of this is now a conversation, not a report-building exercise.

The BcMCPProxy is a temporary bridge. Microsoft will likely provide direct MCP client support in future releases. But it works today and demonstrates the enormous potential of agentic AI in the Business Central ecosystem.

The future is agentic. Let’s build it.


Blog Series Navigation

   Blog 1: Understanding AI Agents and MCP

   Blog 2: The Business Central MCP Server

   Blog 3: Building BcMCPProxy.exe and Connecting to Claude Desktop

▶ Blog 4: Testing Scenarios and Best Practices (You are here)


Wednesday, 11 February 2026

Building BcMCPProxy.exe and Connecting to Claude Desktop (BLOG 3 OF 4)

 

Introduction

In the previous posts, we covered the concepts (Blog 1) and the BC MCP Server setup (Blog 2). Now it’s time to get hands-on. In this post, we will create an Azure App Registration, build the BcMCPProxy as a self-contained .exe in Visual Studio, and connect it to Claude Desktop.


Prerequisites

Requirement

Details

.NET 8 SDK

Download from dotnet.microsoft.com

Visual Studio 2022

Community, Professional, or Enterprise with .NET desktop workload

Git (Optional)

To clone the BCTech repository from GitHub

Claude Desktop

Download from claude.ai/download

Azure Portal Access

Admin rights to create App Registrations

BC Environment

SaaS with MCP Server enabled (see Blog 2)


Step 1: Create the Azure App Registration

The BcMCPProxy uses delegated permissions—it authenticates as the signed-in user via Azure AD.

Register the Application

1.    Sign in to the Azure Portal (portal.azure.com).

2.    Navigate to Microsoft Entra ID → App registrations → New registration.

3.    Name: Enter a descriptive name (e.g., “BcMCPProxy-Claude”).

4.    Supported account types: Select “Accounts in this organizational directory only (Single tenant).”

5.    Redirect URI: Select “Public client/native” and enter:

ms-appx-web://Microsoft.AAD.BrokerPlugin/<Your-Client-ID>

6.    Click Register. Note down the Application (client) ID and the Directory (tenant) ID from the Overview page.

Add API Permissions

1.    In the app registration, go to API permissions → Add a permission.

2.    Select Microsoft APIs → Dynamics 365 Business Central.

3.    Select Delegated permissions.

4.    Check both Financials.ReadWrite.All and user_impersonation.

5.    Click Add permissions.

6.    Click Grant admin consent for your tenant (requires an admin role).



Step 2: Build BcMCPProxy.exe in Visual Studio

Clone the Repository or download the code manually

git clone https://github.com/microsoft/BCTech.git

cd BCTech\samples\BcMCPProxy

Open in Visual Studio

1.    Launch Visual Studio 2022.

2.    Go to File → Open → Project/Solution.

3.    Navigate to the BcMCPProxy folder and open the .csproj or .sln file.

4.    Wait for NuGet package restore to complete (check the status bar).

Publish as Self-Contained .exe

Option A: Visual Studio UI

1.    Right-click the project in Solution Explorer → Publish.

2.    Choose Folder as the target → Next → Finish.

3.    Click Show all settings in the publish profile.

4.    Set Deployment Mode to Self-contained.

5.    Set Target Runtime to win-x64 (or win-arm64 for ARM machines).

6.    Under File publish options, check Produce single file (recommended).

7.    Click Save, then click Publish.

  



Option B: Command Line (Recommended)

The command line approach is more reliable and avoids the Visual Studio UI quirks. Open PowerShell or Command Prompt in the project folder and run:

dotnet publish -c Release -r win-x64 --self-contained true ^

    -p:PublishSingleFile=true

 

# For ARM-based Windows:

dotnet publish -c Release -r win-arm64 --self-contained true ^

    -p:PublishSingleFile=true




Locate Your .exe

After publishing, you should find BcMCPProxy.exe in:

bin\Release\net8.0\win-x64\publish\BcMCPProxy.exe

 


If you are not sure where it ended up (especially after using the Visual Studio UI), run this in PowerShell from your project folder to find every copy:

Get-ChildItem -Recurse -Filter "BcMCPProxy.exe" |

    Select-Object FullName, Length

The self-contained .exe will be around 60-80 MB. Any file that is only ~150 KB is a regular build output, not the published version.

Locate and Copy the .exe

Find BcMCPProxy.exe in the publish output:

bin\Release\net8.0\win-x64\publish\BcMCPProxy.exe

Copy it to a permanent location:

C:\Tools\BcMCPProxy\BcMCPProxy.exe


✅ Already have .NET 8 installed?

If you are only running the proxy on your own machine and .NET 8 is already installed, the small ~150 KB .exe from a regular Build also works fine. The self-contained version is mainly needed for deploying to machines that may not have .NET installed.


Step 3: Configure Claude Desktop

Install Claude Desktop

1.    Download from claude.ai/download (Windows or macOS).

2.    Install and sign in to your Claude account.

Edit the Configuration

1.    Open Claude Desktop → Settings → Developer.

2.    Click Edit Config to open claude_desktop_config.json.

3.    Add the following configuration:

{

  "mcpServers": {

    "BC_MCP": {

      "command": "C:\\Tools\\BcMCPProxy\\BcMCPProxy.exe",

      "args": [

        "--TenantId",          "<Your-Tenant-ID>",

        "--ClientId",          "<Your-Client-ID>",

        "--Environment",       "<BC-Environment-Name>",

        "--Company",           "<Company-Name>",

        "--ConfigurationName", "<MCP-Config-Name>"

      ]

    }

  }

}

Parameter Reference

Parameter

Description

--TenantId

Azure AD tenant ID (GUID from App Registration overview)

--ClientId

Application (client) ID from your Azure App Registration

--Environment

BC environment name (e.g., Production, Sandbox)

--Company

BC company name (e.g., CRONUS USA, Inc.)

--ConfigurationName

MCP config name created in BC. If omitted, uses default read-only config.

 

4.    Save the file and restart Claude Desktop completely.

5.    On first launch, an Azure sign-in prompt will appear. Authenticate with a user from the same tenant.

6.    After authentication, BC MCP tools should appear in Claude Desktop’s tool list.




⚠️ Troubleshooting

If tools don’t appear: verify the .exe path uses double backslashes in JSON, confirm all required args are present, check MCP Server is enabled in BC Feature Management, and restart Claude Desktop after any config change.


What’s Next?

Your setup is complete! In Blog 4, we run through real-world testing scenarios to validate everything works end to end.

 

Blog Series Navigation

   Blog 1: UnderstandingAI Agents and MCP

   Blog 2: The BusinessCentral MCP Server

▶ Blog 3: Building BcMCPProxy.exe and Connecting to Claude Desktop (You are here)

   Blog 4: Testing Scenarios and Best Practices