How to build Power Apps with Claude Code and an MCP server

Connect Claude Code to a canvas apps authoring MCP server that exposes Power Apps operations as tools, then index Power Platform docs and your org's conventions as retrievable chunks. The agent retrieves correct Power Fx and control schemas before generating, so it edits real .msapp source instead of guessing syntax.

Why Claude Code plus an MCP server beats the maker portal for canvas apps

Power Apps canvas apps are usually built by dragging controls in a browser. That workflow does not version well, does not diff, and does not let an AI agent operate it. The Power Platform CLI can unpack a .msapp file into human readable YAML source, and that source is where an agent becomes useful.

An MCP (Model Context Protocol) server sits between Claude Code and that source. It exposes authoring operations as tools: list screens, read a control tree, set a control property, add a Power Fx formula, unpack and repack the .msapp. Claude Code calls those tools the same way it calls Read or Edit. The result is an agent that edits a real app definition, then repacks it for import, with every change reviewable as a text diff.

The gap this closes is intent to implementation. You describe the screen you want. The agent plans the control layout, writes the bindings, and applies them through the MCP tools. You review the diff instead of hunting through property panes.

Where the agent fails: Power Fx it has never seen

Power Fx is a compact functional language with its own function set, delegation rules, and property semantics. A general model guesses. It invents function names that do not exist, binds properties that are read only, and writes delegable queries that silently fall back to non delegable, capping results at 500 rows without warning.

Every wrong guess costs a full round trip: the agent writes a formula, the repack or a lint step rejects it, the error comes back, the model regenerates. That is tokens spent to relearn the same fact the platform already documented.

The correction loop is the expense

The token cost is not in the first draft. It is in the second, third, and fourth attempts at the same formula. An agent that does not know LookUp from Search, or that Gallery.Selected is a record not a control, will loop. You pay for every loop.

Index Power Platform knowledge as retrievable chunks with RDK

RDK, the Retrieval Development Kit, fixes the guessing at the source. You index reference material as encrypted private chunks on the RDK network: the Power Fx formula reference, delegation guidance, connector schemas, and, most valuable, your own organization's app conventions. Naming rules, your standard error handling pattern, the theme variables your apps share, the data sources your tenant actually exposes.

Before Claude Code writes a formula, the agent searches those chunks. It retrieves the exact Patch signature, the delegable operators for your data source, and your house pattern for form submission. It emits correct Power Fx on the first pass because the syntax was retrieved, not reconstructed from a probability distribution.

Stacked retrieval keeps the LLM as a last resort

Your private vault answers 40 to 65 percent of authoring queries outright. The public RDK network, where other builders publish validated Power Fx patterns, adds another 15 to 20 percent. The LLM handles only the remaining 5 to 10 percent as fallback. Most formulas are now a lookup, not an inference.

The token math

Retrieving an answer instead of regenerating it drops token spend 80 to 90 percent on repeat tasks. Canvas app authoring is heavily repeat work: the same submit pattern, the same navigation formula, the same collection load runs across dozens of screens. Retrieval turns each into a cache hit.

Wiring it up end to end

The setup has three moving parts. First, the canvas apps authoring MCP server, registered in Claude Code so its tools appear alongside your file tools. Second, the Power Platform CLI on the path so the server can unpack and repack .msapp files. Third, an RDK index over your Power Platform docs and conventions, queried by the agent before generation.

A typical task: you ask for a screen that lists open tickets with a filter. Claude Code retrieves your data source schema and delegation rules from RDK, retrieves your standard gallery layout convention, then calls the MCP tools to add the screen, the gallery, and the delegable Filter formula. It repacks the app. You import and test. No portal, no syntax roulette.

Publish your patterns and earn on retrieval

Once your Power Fx patterns are validated and running in production, publish them as public chunks. Every naming convention, reusable component formula, and delegation workaround becomes a chunk other agents retrieve. You earn USDC per retrieval through the CryptoCadet rail on Base.

This is the environmental angle too. One well written delegation pattern, indexed once, serves a million agents that would otherwise each generate their own slightly wrong version. Billing is cost per connection, not commission. You author once and the network reuses it.

Frequently asked questions

What does the canvas apps authoring MCP server actually do?
It exposes Power Apps authoring as callable tools for Claude Code. The agent can list screens, read the control tree, set properties, write Power Fx formulas, and unpack or repack the .msapp source file. Instead of clicking through the maker portal, the agent edits the app definition as text and every change is a reviewable diff.
Why does Claude Code get Power Fx wrong without retrieval?
Power Fx has a specific function set, delegation rules, and property semantics that a general model reconstructs from probability rather than fact. It invents functions, binds read only properties, and writes non delegable queries. Each wrong guess triggers a correction round trip, spending tokens to relearn documented facts. Retrieval supplies the exact syntax first.
How much does RDK retrieval reduce token spend on app authoring?
Repeat authoring tasks drop 80 to 90 percent because the answer is retrieved instead of regenerated. Canvas apps are heavy repeat work: the same submit, navigation, and collection patterns recur across screens. With stacked retrieval, your private vault answers 40 to 65 percent, the public network 15 to 20 percent, and the LLM only 5 to 10 percent.
Do I need the Power Platform CLI for this?
Yes. The CLI unpacks a .msapp file into human readable YAML source and repacks it for import. The MCP server drives the CLI under the hood so Claude Code can read and write that source. Without it the app stays a binary blob the agent cannot edit or diff.
Can I share Power Fx patterns across my team?
Index them as RDK chunks. Private chunks stay encrypted and available to your own agents and teammates. Publish validated patterns as public chunks and other builders' agents retrieve them, earning you USDC per retrieval on the Base network. One correct pattern serves every agent instead of each one regenerating it.