This summary is produced by the author, and not by AI.
This series teaches you about the different approaches to use AI to facilitate changes to a semantic model using agents. A semantic model agent has tools that let it read, query, and write changes to a semantic model. Using agents this way is called agentic development, and it can be a useful way to augment traditional development tools and workflows in certain scenarios.
There are several different ways that AI can make changes to a semantic model, including modifying metadata files, using MCP servers, or writing code. Each approach has pros and cons, and if you’ll use AI to make changes to semantic models, then it’s likely that you’ll use all three.
In this article, we discuss MCP servers in detail to facilitate agentic development of Power BI semantic models.
In a previous article we introduced the model context protocol (MCP) and discussed how MCP servers might change BI tools. In summary, MCP servers are a way to extend the capabilities of large language models (LLMs) by providing them with re-usable context (resources), prompts, and tools. Tools give specific functions and code that allow AI to interact with their environment, either to retrieve context or take actions.
In the context of a Power BI semantic model, an MCP server can use the Tabular Object Model (TOM) library to make programmatic changes to the model via the XMLA protocol:
This is the similar to existing approaches with tools like SQL Server Management Studio (SSMS) and external tools like Tabular Editor. What’s different here is that the TOM operations are encoded in tools used by the LLM and not directly used by the user. The tools determine what the AI can do. MCP servers may allow all operations that you could do via a C# script in Tabular Editor or by editing TMDL files by hand. But it may be very constrained. This depends on the individual MCP server and how its tools work.
In this article, we focus on the Power BI modelling MCP server from Microsoft, which contains a variety of tools to perform bulk operations on a semantic model, as well as resources to help with less common operations. The MCP server works on local models in Power BI Desktop, published models in a workspace, or local model metadata.
There are already dozens of other impressive MCP servers created by the community that you can find on GitHub, as well, like PowerBI-Desktop-MCP by Maxim Anatsko.
To illustrate, here’s an example of Claude Code using the Power BI modelling MCP server from Microsoft to make changes to a semantic model.
This demonstration shows Claude Code using the MCP server to implement DAX functions that were missing from a model after rebinding a report. The agent uses the MCP server to connect to the local model open in Power BI Desktop, explore it, and add the functions, replacing the DAX. Notice that it's harder to view and follow the changes; we no longer have in-line diffs showing what the agent changed like when the agent works with local metadata files, directly. The agent also gets confused at one point and starts working with the wrong model.
However, using the MCP server is faster and more convenient; any breaking changes are caught and return errors, allowing the agent to fix them and only make valid changes at once. In a few minutes, the agent can make the changes, which the user can then verify in Power BI Desktop or in Tabular Editor.
The following diagram depicts a simple overview of how you can use MCP servers to facilitate agentic development of a semantic model:
Note that this diagram depicts a somewhat simplified scenario. In a real implementation, you’re likely to use more components and tools, both in a traditional and AI-sense. You can understand this process as follows:
AGENTS.md or CLAUDE.md) and context (other instruction files; typically, markdown) about the TMDL format and the semantic model that they want to change. They optionally also configure other agentic tools and components, depending on the coding agent that they use, like the Microsoft Docs remote MCP server or a Claude Code skill. Setting up these instructions and context isn't a one-off activity and requires active curation and maintenance; it’s more of a communication and writing skill than a technical skill.With MCP servers or with code, it’s more difficult to have visibility on and undo changes to your semantic model.
As such, you need to make sure that you have a way to save, view, and commit changes to a remote repository. We recommend that you save models as PBIP files for this and use the TMDL model metadata format.
Here are a few examples of agents working with MCP servers on a semantic model.
GitHub Copilot in agent mode comes with extensive support for MCP servers and customization. The Power BI MCP comes prepackaged with a VS Code extension that helps you to manage it.
The following example shows GitHub Copilot adding descriptions, format strings, and display folders to multiple measures in a model. Note that here we are working with Power BI Desktop:
Many VS Code extensions have silently and automatically added MCP servers and extension tools. You should regularly check which of these are enabled when you use an agent like GitHub Copilot in VS Code. These tools and MCP servers can consume your available context, resulting in shorter sessions and reduced agent performance.
Always disable the tools that you don’t need for a session or project. For more information, see this documentation article.
Another popular tool that supports MCP servers is Claude Desktop. Claude Desktop has a leaner, simpler user interface compared to VS Code and excels at providing ad hoc visuals or diagrams of various concepts.
To configure the MCP server in Claude Desktop, you need to download the VS Code extension .vsix file and extract the executable (.exe). Then, you have to provide more detailed configuration either in the settings JSON, or by creating a custom .mcpb or .dxt file.
The following is an example of Claude Desktop using the MCP server to depict relationships between fields in a rather sloppy diagram:
Note that Claude Desktop can create artifacts which render code into images in the application. Claude Desktop is good for exploratory tasks or model consumption and analysis, but not as much for development. Usually it also performs better with these types of diagrams if you give it better context and examples of what you expect in terms of the aesthetics and design. For development, we recommend that you use GitHub Copilot in VS Code or Claude Code in a terminal.
Claude Code has a user interface, but you can also use it from within the terminal.
Adding this MCP server to Claude Code is a bit more complex, as it requires some specific configuration. You can copy the command below to do this, which you need to run in PowerShell or Bash, replacing the path with the correct path to powerbi-modeling-mcp.
claude mcp add --transport stdio powerbi-modeling-mcp --env PBI_MODELING_MCP_CLIENT_ID=ea0616ba-638b-4df5-95b9-636659ae5121 -- "C:\pathto\powerbi-modeling-mcp.exe" --start
The following is an example of Claude Code using the semantic model MCP server. Here, the user asks Claude Code to add and make some changes to DAX measures:
In this example, you can see that moving measures between tables can be destructive; it results in an error in a visual. You can also see that the agent makes certain DAX assumptions based on existing patterns in the model; you can't rely on it to write "good" DAX or Power Query unless you provide sufficient instructions or examples in your prompt or context. This is also an example of a bad use-case for agentic development; it would've been faster, cheaper, and probably easier to make and adjust the measures in Power BI Desktop or Tabular Editor.
As you saw in the demonstration, Claude Code is especially useful since it gives you a visual breakdown of what's happening with your context window. In the following diagram, you can see that 60% of the context is already consumed in a brand new session without any prompts. 29% of the context is taken up by the Power BI modelling MCP server, alone:
This is one of the biggest challenges with MCP servers, so we highlight it already, here. Later in the article, we'll explain in a bit more detail why this is challenging.
To use this approach, you need to have an MCP server that supports semantic modelling operations like the Power BI MCP server. You also need an AI application that supports the model context protocol (an MCP client, like those shown above). Here’s a full list:
Agents that use MCP servers differ from direct metadata modifications or use of CLIs and scripts in several ways, which we discuss below.
Here’s a few of the unique benefits of this approach:
In summary, MCP servers are a useful way to give agents tools with straightforward setup. They’re hard to design well, but when they are, they can be very powerful and convenient. However, they’re not without their challenges, too.
Here are a few caveats and considerations for using MCP servers both with semantic models in Power BI and in general:
As you can see, the tax you pay for convenient use of MCP servers comes with other inconveniences and considerations, too.
In our experience, the Power BI modelling MCP server from Microsoft performs very well. Despite using a lot of your available context, this is a very well-made tool to facilitate agentic development.
MCP servers are suitable over alternative approaches for agentic development in the following scenarios:
powerbi-modelling-mcp is currently the best tool to use for agentic development of semantic models in typical scenarios. If you have more specific needs or requirements, you can complement it with other tools.There are a few cases when you might consider alternatives over MCP servers.
In summary, when to use or not use an MCP server really depends on your specific scenario. You need to understand the available tools, how they work, and what their limitations are.
MCP servers can be really powerful when you use them correctly. Here are a few tips from our own experience, but a lot of our tips from the previous article still apply (like curating context, combining with other approaches, and so forth):
In summary, MCP servers are a convenient tool for agentic development, but you should use them carefully and only in the right scenarios. Only use MCP servers from trusted authors and ensure that you know what the tools do before you use them.
MCP servers provide a valuable and interesting way for AI to modify semantic models. The biggest strength of an MCP server is in its portability and how it can make the model aware of the tools and instruct the model when to use them. However, MCP servers also have some big weaknesses in how much context they use and tool limitations. Nonetheless, when you understand the tools and apply them in the right scenarios, MCP servers can be a really powerful way to accelerate development in certain scenarios, especially the Power BI modelling MCP from Microsoft.
The next article in this series discusses the third and final approach, where agents interface with models programmatically. This approach is similar to MCP servers, except that the model doesn’t use predefined tools. Rather, it writes and executes code, arbitrarily. This approach is maximally flexible but can come with additional risks and need for context.
Take your semantic models further with Tabular Editor.
Give Tabular Editor a spin