{"title":"Connect to Business Central MCP server from Visual Studio Code","url":"https://jonas-paprotka.de/docs/dev-itpro/ai/use-mcp-server-in-vscode/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/ai/use-mcp-server-in-vscode, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/ai/use-mcp-server-in-vscode","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn how to set up and use the Business Central MCP server in Visual Studio Code to interact with your Business Central data through natural language.","date":"2026-10-02","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Connect to Business Central MCP server from Visual Studio Code","slug":"connect-to-business-central-mcp-server-from-visual-studio-code","at":0,"chars":3528},{"level":2,"title":"Prerequisites","slug":"prerequisites","at":764,"chars":2513},{"level":2,"title":"Set up the MCP server in Visual Studio Code","slug":"set-up-the-mcp-server-in-visual-studio-code","at":3277,"chars":251},{"level":1,"title":"User level (most common)<#tab/userlevel>","slug":"user-level-most-commontabuserlevel","at":3528,"chars":259},{"level":1,"title":"Workspace-level<#tab/workspacelevel>","slug":"workspace-leveltabworkspacelevel","at":3787,"chars":3276},{"level":2,"title":"Use the Business Central MCP server with an agent","slug":"use-the-business-central-mcp-server-with-an-agent","at":5543,"chars":1227},{"level":2,"title":"Related information","slug":"related-information","at":6770,"chars":293}],"text":"# Connect to Business Central MCP server from Visual Studio Code\n> APPLIES TO: Business Central online\nThe Business Central Model Context Protocol (MCP) server lets developers and business users interact with Business Central data directly from Visual Studio Code by using natural language through GitHub Copilot. With this integration, you can perform common business operations&mdash;such as viewing customers, creating items, and processing sales orders&mdash;through conversational AI assistance. This article explains how to configure the Business Central MCP server in Visual Studio Code and how to use it with GitHub Copilot to manage Business Central data.\nLearn more about the MCP server in Model Context Protocol (MCP) in Business Central<mcp-overview>.\n## Prerequisites\n Visual Studio Code installed with the GitHub Copilot extension\n Access to a Business Central online environment configured with the MCP server. See Configure Business Central MCP Server<configure-mcp-server>.\n The MCP server connection string details, including the following values (required for setup only):\n  HTTP header|Description|Example\n  TenantId|The Microsoft Entra tenant to use. Required unless the MCP host supports omitting it.|`aaaabbbb-0000-cccc-1111-dddd2222eeee`\n  EnvironmentName|The Business Central environment to use. Required unless the MCP host supports omitting it.|Production\n  Company|The company to use. Required unless the MCP host supports omitting it.|`CRONUS USA, Inc.` (ASCII)<br><br>`=?base64?Q3JvbnVzIMOFcmh1cyBBL1M=?=` (Base64-encoding of `CRONUS Århus A/S`)\n  ConfigurationName|Optional. The MCP server configuration in the environment to use. If omitted or empty, the server uses the current default configuration.|SalesTeamConfig<br><br>`=?base64?w4VyaHVzU2FsZXNUZWFtQ29uZmln?=` (Base64-encoding of `ÅrhusSalesTeamConfig`)\n> NOTE\n> MCP hosts that support headerless Business Central connections can omit TenantId, EnvironmentName, Company, and ConfigurationName. For example, Visual Studio Code with GitHub Copilot supports omitting all four headers.\n> If the Company or ConfigurationName values contain non-ASCII characters (for example, `ø`, `æ`, or `å`), encode the values by using Base64 (UTF-8).\n> The encoded value must use the format `=?base64?<encodedvalue>?=`. See Base64 decoding in the MCP HTTP standard<https://modelcontextprotocol.io/seps/2243-http-standardization#base64-decoding>.\n> In Copilot Studio, you don't need to manually encode these values because the platform handles the encoding.\nVisual Studio Code supports omitting all four headers. When TenantId is omitted, the server determines the tenant from your signed-in identity. Include EnvironmentName or Company to pin its value for the connection, or omit it to let the agent select an accessible value at runtime. When Company is omitted, API tools use dynamic tool mode so the agent can discover the needed action at runtime. When EnvironmentName or Company is omitted, the agent can use list_environments or list_companies, as applicable. Omit ConfigurationName to use the current default configuration. You can get a connection string that includes these headers from the Business Central web client. See configure-mcp-server#get-the-mcp-server-configuration-connection-string.\n## Set up the MCP server in Visual Studio Code\n1. Open Visual Studio Code.\n1. Configure the MCP server at either the user level or the workspace level, depending on whether you want the configuration to apply globally or only to a specific workspace:\n# User level (most common)<#tab/userlevel>\nFollow these steps if you want the MCP server configuration available in every file, folder, or workspace:\n1. Select Ctrl+Shift+P to open Command Palette.\n1. In search, enter and select MCP: Open User Configuration.\n# Workspace-level<#tab/workspacelevel>\nFollow these steps if you want the MCP server configuration to apply only to a specific folder or workspace.\n1. Open the root folder of the workspace or project\n1. In this folder, create a folder named `.vscode` if it doesn't already exist.\n1. In the `.vscode` folder, create a file called mcp.json.\n1. Add the Business Central MCP server within the `\"servers\": { }` element of the mcp.json file as illustrated in the following JSON code.\n ```json\n {\n     \"servers\": {\n          \"businesscentral\": {\n              \"url\": \"https://mcp.businesscentral.dynamics.com\",\n             \"type\": \"http\"\n          }\n      }\n  }\n ```\n This headerless configuration lets the agent select values available to your signed-in identity at runtime. To pin a tenant, environment, company, or configuration, add a `\"headers\"` object and the applicable values from the connection string details in #prerequisites. When you omit `\"ConfigurationName\"`, the server uses the current default configuration. The built-in default configuration gives read-only access to eligible API pages and API queries. If an admin designates another active configuration as the default, the available tools and permissions depend on that configuration.\n> TIP\n> If you copied the MCP server configuration connection string directly from the Business Central web client, paste the copy within `\"servers\": { }`. See configure-mcp-server#get-the-mcp-server-configuration-connection-string.\n1. In the toolbar above the `\"businesscentral\"` server you added, select Start to start the server.\n ![Shows the MCP server toolbar in the mcp.json file in Visual Studio Code]\n When started, the text changes to Running.\n1. Go to the next section to verify the connection.\n## Use the Business Central MCP server with an agent\nOnce the MCP server is configured, you can interact with Business Central through GitHub Copilot Chat.\n1. In Visual Studio Code, open the GitHub Copilot Chat in the Agent mode (Ctrl+Shift+I).\n1. In the Chat box, type a question or instructions like: \"Can you list all items\" or \"list my customers\".\n ![Shows the GitHub Chat box in Visual Studio Code, highlighting the Configure tools button]\n1. The agent starts working on a response, like fetching customer data.\n If you don't get a response, select Configure tools in the Chat box to verify the Business Central MCP server is enabled. If it's enabled, there's an entry for businesscentral.\n> NOTE\n> The agent can only access data and perform operations permitted by the MCP server configuration. Your available operations depend on the API permissions defined in your Business Central environment. For example, you can only create a customer if you have Create permission on the Customer API. If an operation fails due to insufficient permissions, contact your Business Central administrator to enable the required API access. Learn more about configurations in Configure Business Central MCP Server<configure-mcp-server>\n## Related information\nBusiness Central MCP Server overview<mcp-overview>\nConfigure Business Central MCP Server<configure-mcp-server>\nModel Context Protocol Documentation<https://modelcontextprotocol.io>\nGitHub Copilot in Visual Studio Code<https://code.visualstudio.com/docs/copilot/overview>"}