@microsoft/powerbi-modeling-mcp-linux-arm64 0.5.0-beta.13 → 0.5.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -1
- package/LICENSE +21 -99
- package/NOTICE.txt +15014 -0
- package/README.md +33 -8
- package/dist/Resources/calendar_instructions_and_examples.md +249 -0
- package/dist/Resources/dax_query_instructions_and_examples.md +714 -0
- package/dist/Resources/dax_udf_instructions_and_examples.md +270 -0
- package/dist/Resources/powerbi_project_instructions.md +84 -0
- package/dist/Resources/tools/tool-metadata.override.yaml +7 -0
- package/dist/Resources/tools/tool-metadata.yaml +495 -0
- package/dist/powerbi-modeling-mcp +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# ✨ Power BI
|
|
1
|
+
# ✨ Power BI Authoring MCP Server NPM Package
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is a JavaScript wrapper that downloads the **Power BI Authoring MCP server**, which lets an AI agent create and change Power BI semantic models through a **local MCP server**. This allows developers and AI applications to interact with Power BI models in entirely new ways, from using natural language to execute modeling changes to autonomous AI agentic development workflows.
|
|
4
4
|
|
|
5
5
|
## 💡 What can you do?
|
|
6
6
|
|
|
@@ -38,14 +38,14 @@ Configure the `mcp.json` file with the following:
|
|
|
38
38
|
```json
|
|
39
39
|
{
|
|
40
40
|
"mcpServers": {
|
|
41
|
-
"powerbi-
|
|
41
|
+
"powerbi-authoring-local": {
|
|
42
42
|
"type": "local",
|
|
43
43
|
"command": "npx",
|
|
44
44
|
"args": [
|
|
45
45
|
"-y",
|
|
46
46
|
"@microsoft/powerbi-modeling-mcp",
|
|
47
|
-
"--start"
|
|
48
|
-
|
|
47
|
+
"--start"
|
|
48
|
+
]
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -53,6 +53,17 @@ Configure the `mcp.json` file with the following:
|
|
|
53
53
|
|
|
54
54
|
**Note:** When manually configuring Visual Studio and Visual Studio Code, use `servers` instead of `mcpServers` as the root object.
|
|
55
55
|
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
Before use, you must accept the Power BI Authoring MCP End User License Agreement at **<https://github.com/microsoft/powerbi-modeling-mcp>**. To accept:
|
|
59
|
+
|
|
60
|
+
1. **Command line**: pass `--accept-eula` (or the alias `--accepteula`, case-insensitive) when
|
|
61
|
+
starting the server. This also persists acceptance.
|
|
62
|
+
2. **Environment variable**: set `PBI_MODELING_MCP_ACCEPT_EULA=true`. This grants acceptance for
|
|
63
|
+
the current process only and does **not** persist anything to disk.
|
|
64
|
+
3. **The `accept_eula` MCP tool**: an MCP client can call `accept_eula` with the required
|
|
65
|
+
`eulaUrl` argument set. This also persists acceptance.
|
|
66
|
+
|
|
56
67
|
## 🚀 Get started
|
|
57
68
|
|
|
58
69
|
**First, you must connect to a Power BI semantic model**, which can reside in Power BI Desktop, Fabric workspace or in Power BI Project (PBIP) files.
|
|
@@ -75,19 +86,33 @@ Configure the `mcp.json` file with the following:
|
|
|
75
86
|
Open semantic model from PBIP folder '[Path to the definition/ TMDL folder in the PBIP]'
|
|
76
87
|
```
|
|
77
88
|
|
|
78
|
-
Once the connection is established, you can use natural language to ask the AI agent to make any
|
|
89
|
+
Once the connection is established, you can use natural language to ask the AI agent to make any authoring changes. To get started, try one of the following scenarios.
|
|
90
|
+
|
|
91
|
+
## Local Audit Logs
|
|
92
|
+
|
|
93
|
+
The local MCP writes audit events to daily newline-delimited JSON
|
|
94
|
+
files. On Windows, the default directory is
|
|
95
|
+
`%LOCALAPPDATA%\Microsoft\PowerBI Authoring\Logs`. These files contain audit
|
|
96
|
+
metadata and do not include general console or diagnostic logs. Tenant, user,
|
|
97
|
+
and network request fields are omitted.
|
|
98
|
+
|
|
99
|
+
Use `PBI_MODELING_MCP_AUDIT_LOG_PATH` or
|
|
100
|
+
`--audit-log-path=<directory>` to override the directory. Command-line
|
|
101
|
+
configuration takes precedence. Audit logs are retained for seven days. After
|
|
102
|
+
seven days, files matching the audit filename format are removed during
|
|
103
|
+
startup. Apply appropriate file protection to the directory.
|
|
79
104
|
|
|
80
105
|
## 💬 Feedback and Support
|
|
81
106
|
|
|
82
107
|
- Check the [Troubleshooting guide](https://github.com/microsoft/powerbi-modeling-mcp/blob/main/TROUBLESHOOTING.md) to diagnose and resolve common issues.
|
|
83
|
-
- We're building this in the open. Your feedback is much appreciated, and will help us shape the future of the Power BI
|
|
108
|
+
- We're building this in the open. Your feedback is much appreciated, and will help us shape the future of the Power BI Authoring MCP server.
|
|
84
109
|
- 👉 [Open an issue](https://github.com/microsoft/powerbi-modeling-mcp/issues) in the public GitHub repository - we’d love to hear from you!
|
|
85
110
|
|
|
86
111
|
## Security
|
|
87
112
|
|
|
88
113
|
Your credentials are always handled securely through the official [Azure Identity SDK](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md) - **we never store or manage tokens directly**.
|
|
89
114
|
|
|
90
|
-
MCP as a phenomenon is very novel and cutting-edge. As with all new technology standards, consider doing a security review to ensure any systems that integrate with MCP servers follow all regulations and standards your system is expected to adhere to. This includes not only the Power BI
|
|
115
|
+
MCP as a phenomenon is very novel and cutting-edge. As with all new technology standards, consider doing a security review to ensure any systems that integrate with MCP servers follow all regulations and standards your system is expected to adhere to. This includes not only the Power BI Authoring MCP Server, but any MCP client/agent that you choose to implement down to the model provider.
|
|
91
116
|
|
|
92
117
|
You should follow Microsoft security guidance for MCP servers, including enabling Entra ID authentication, secure token management, and network isolation. Refer to [Microsoft Security Documentation](https://learn.microsoft.com/en-us/azure/api-management/secure-mcp-servers) for details.
|
|
93
118
|
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Calendar Instructions and Examples'
|
|
3
|
+
description: 'Guidelines for creating Power BI calendar objects'
|
|
4
|
+
uriTemplate: 'resource://calendar_instructions_and_examples'
|
|
5
|
+
---
|
|
6
|
+
# Calendar Column Groups Guide
|
|
7
|
+
|
|
8
|
+
This guide explains how to define calendar column groups in a Power BI date table so time intelligence works as expected and consistently across models.
|
|
9
|
+
|
|
10
|
+
## Concepts
|
|
11
|
+
|
|
12
|
+
- Calendar Column Groups. Use these when a primary column represents a standard time unit such as Year, Quarter, Month, Week, or Date. Time units (including "of year" variants) are defined by a fixed enumeration; use the exact casing from the **Allowed time units** list.
|
|
13
|
+
- Time-related groups. Use these for relative columns that are time-aware but are not a standard time unit (for example, RelativeMonth with values like "Current"/"Previous"). They can be used to slice/label time-aware analyses but do not themselves define a standard unit.
|
|
14
|
+
- Primary vs. associated columns. When a column maps to a specific unit, make it the primaryColumn for that unit. If column A is sorted by column B (Power BI SortByColumn), then B should be the primaryColumn and A should be an associatedColumn. Optionally add other 1-to-1 associatedColumns for alternate labels (e.g., a long and a short month name).
|
|
15
|
+
|
|
16
|
+
## Mapping guidance
|
|
17
|
+
|
|
18
|
+
- Calendar names must be unique across the entire model, not just within a single table. Even though a calendar belongs to a specific table, no two calendars in the model can share the same name.
|
|
19
|
+
- Each calendar definition must use columns from only its host table.
|
|
20
|
+
- Build hierarchies where each level subdivides exactly into the level above: Year → Quarter → Month → Date.
|
|
21
|
+
- For week-based (4-4-5, 4-5-4, 5-4-4, or ISO) calendars, the hierarchy is typically Year → Quarter → Period → Week → Date. Map the Period level to the `Month` time unit, because Period occupies the same hierarchical position between Week/Quarter and Year that Month does in a Gregorian calendar.
|
|
22
|
+
- When using ISO week numbers, always pair them with the corresponding ISO Year — not the Gregorian year. A date in early January may belong to the previous ISO year, and a date in late December may belong to the next ISO year. Mixing ISO weeks with Gregorian years produces incorrect results.
|
|
23
|
+
- Do not repeat a time unit within the same calendar.
|
|
24
|
+
- **Only one time-related group per calendar.** All time-related columns (relative offsets, flags like IsWeekend, FutureDate, etc.) must be combined into a **single** TimeRelated column group. The engine keys column groups by time unit; since all time-related columns share the implicit `Unknown` key, creating multiple separate TimeRelated groups will fail with: *"The CalendarColumnGroup with the key of 'TimeRelated' already exists."* Pass all such columns in one group's column list.
|
|
25
|
+
- A column must map to the same time unit (or as time-related) in every calendar that includes it.
|
|
26
|
+
- Do not use the same physical column more than once in the same calendar.
|
|
27
|
+
- Complete vs. Partial units:
|
|
28
|
+
- Complete units uniquely identify a single period and must include the calendar context (e.g., include the year): Year, Quarter, Month, Week, Date.
|
|
29
|
+
- Examples: 2024 (Year), Q3 2024 (Quarter), 2024-01 or "January 2024" (Month), 2024-W49 (Week), 2024-01-15 (Date).
|
|
30
|
+
- Partial units are positions within a larger period and are not unique by themselves: QuarterOfYear (1–4), MonthOfYear (1–12 or names), WeekOfYear (1–52/53), DayOfYear (1–365/366). Variants exist for Quarter/Month (e.g., MonthOfQuarter).
|
|
31
|
+
- Use these primarily for labels, slicers, or seasonality—not as keys or for hierarchical rollups.
|
|
32
|
+
- Mapping examples:
|
|
33
|
+
- "December 2024" → Month (complete, includes year). "December" → MonthOfYear (not unique across years).
|
|
34
|
+
- "Q3 2023" → Quarter. "Q3" → QuarterOfYear.
|
|
35
|
+
- "2024-W49" or "Week 49 of 2024" → Week. "Week 49" → WeekOfYear.
|
|
36
|
+
- "15th day of month" → DayOfMonth. "15th day of the year" → DayOfYear.
|
|
37
|
+
- Rules of thumb:
|
|
38
|
+
- For standard hierarchies (Year → Quarter → Month → Date), use complete units at every level.
|
|
39
|
+
- You may associate a partial label with a complete primary (e.g., Month primary: Year Month; associated label: MonthOfYear name) if it is 1-to-1 with the primary.
|
|
40
|
+
- Do not map MonthOfYear to Month, WeekOfYear to Week, or QuarterOfYear to Quarter—these are different concepts.
|
|
41
|
+
- For weeks, prefer ISO Year-Week for complete Week labels. If your organization uses a non-ISO week system, still include the year context and use your defined week-numbering convention.
|
|
42
|
+
|
|
43
|
+
## Allowed time units
|
|
44
|
+
|
|
45
|
+
Time unit values are **case-sensitive enum names**, not natural-language words. Common mistakes:
|
|
46
|
+
- Do **not** pluralize: use `Year`, not `Years`; `Quarter`, not `Quarters`; `Month`, not `Months`.
|
|
47
|
+
- The daily unit is `Date`, not `Day` or `Days`.
|
|
48
|
+
- Compound units use exact PascalCase: `MonthOfYear`, not `MonthOfYear` variants like `monthofyear` or `Month_Of_Year`.
|
|
49
|
+
|
|
50
|
+
The API validates the first column group and rejects the entire request on the first invalid value.
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
timeUnits:
|
|
54
|
+
- id: Unknown
|
|
55
|
+
example: "IsWeekend"
|
|
56
|
+
note: "Used for all time-related columns (season-type, period-type, flags, etc.)."
|
|
57
|
+
- id: Year
|
|
58
|
+
example: 2022
|
|
59
|
+
- id: Quarter
|
|
60
|
+
example: "Q3 2022"
|
|
61
|
+
- id: QuarterOfYear
|
|
62
|
+
example: 4 # 4th quarter of the year
|
|
63
|
+
- id: Month
|
|
64
|
+
example: "January 2022"
|
|
65
|
+
- id: MonthOfYear
|
|
66
|
+
example: "January"
|
|
67
|
+
- id: MonthOfQuarter
|
|
68
|
+
example: 2 # 2nd month of the quarter
|
|
69
|
+
- id: Week
|
|
70
|
+
example: "2022-W49" # ISO Year-Week or unique year+week label
|
|
71
|
+
- id: WeekOfYear
|
|
72
|
+
example: 49
|
|
73
|
+
- id: WeekOfQuarter
|
|
74
|
+
example: 11
|
|
75
|
+
- id: WeekOfMonth
|
|
76
|
+
example: 3
|
|
77
|
+
- id: Date
|
|
78
|
+
example: "2022-01-01"
|
|
79
|
+
- id: DayOfYear
|
|
80
|
+
example: 241
|
|
81
|
+
- id: DayOfQuarter
|
|
82
|
+
example: 71
|
|
83
|
+
- id: DayOfMonth
|
|
84
|
+
example: 23
|
|
85
|
+
- id: DayOfWeek
|
|
86
|
+
example: 4 # e.g., Thursday if 1=Monday
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Example
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
Tables:
|
|
93
|
+
- Name: DimDate
|
|
94
|
+
Columns:
|
|
95
|
+
- Name: Date
|
|
96
|
+
Type: Date
|
|
97
|
+
- Name: Year
|
|
98
|
+
Type: Integer
|
|
99
|
+
- Name: Quarter
|
|
100
|
+
Type: Text
|
|
101
|
+
SortByColumnName: Year Quarter Number
|
|
102
|
+
- Name: Year Quarter
|
|
103
|
+
Type: Text
|
|
104
|
+
SortByColumnName: Year Quarter Number
|
|
105
|
+
- Name: Year Quarter Number
|
|
106
|
+
Type: Integer
|
|
107
|
+
- Name: Month
|
|
108
|
+
Type: Text
|
|
109
|
+
SortByColumnName: Month Number
|
|
110
|
+
- Name: Month Short
|
|
111
|
+
Type: Text
|
|
112
|
+
SortByColumnName: Month Number
|
|
113
|
+
- Name: Month Number
|
|
114
|
+
Type: Integer
|
|
115
|
+
- Name: Year Month
|
|
116
|
+
Type: Text
|
|
117
|
+
SortByColumnName: Year Month Number
|
|
118
|
+
- Name: Year Month Short
|
|
119
|
+
Type: Text
|
|
120
|
+
SortByColumnName: Year Month Number
|
|
121
|
+
- Name: Year Month Number
|
|
122
|
+
Type: Integer
|
|
123
|
+
- Name: Week of Year
|
|
124
|
+
Type: Integer
|
|
125
|
+
- Name: ISO Year-Week
|
|
126
|
+
Type: Text
|
|
127
|
+
SortByColumnName: ISO Year-Week Number
|
|
128
|
+
- Name: ISO Year-Week Number
|
|
129
|
+
Type: Integer
|
|
130
|
+
- Name: Fiscal Year Number
|
|
131
|
+
Type: Integer
|
|
132
|
+
- Name: Fiscal Year Name
|
|
133
|
+
Type: Text
|
|
134
|
+
SortByColumnName: Fiscal Year Number
|
|
135
|
+
- Name: Fiscal Year Month
|
|
136
|
+
Type: Text
|
|
137
|
+
SortByColumnName: Fiscal Year Month Number
|
|
138
|
+
- Name: Fiscal Year Month Number
|
|
139
|
+
Type: Integer
|
|
140
|
+
- Name: Fiscal Month Number of Year
|
|
141
|
+
Type: Integer
|
|
142
|
+
- Name: Fiscal Month Name
|
|
143
|
+
Type: Text
|
|
144
|
+
SortByColumnName: Fiscal Month Number of Year
|
|
145
|
+
- Name: RelativeMonth # Period-type: represents relative states
|
|
146
|
+
Type: Text
|
|
147
|
+
- Name: Season # Season-type: represents cyclical concepts
|
|
148
|
+
Type: Text
|
|
149
|
+
Calendars:
|
|
150
|
+
- name: Gregorian Calendar
|
|
151
|
+
calendarColumnGroups:
|
|
152
|
+
- timeUnit: Year
|
|
153
|
+
primaryColumn: Year
|
|
154
|
+
- timeUnit: Quarter
|
|
155
|
+
primaryColumn: Year Quarter Number
|
|
156
|
+
associatedColumns:
|
|
157
|
+
- Year Quarter
|
|
158
|
+
- timeUnit: Month
|
|
159
|
+
primaryColumn: Year Month Number
|
|
160
|
+
associatedColumns:
|
|
161
|
+
- Year Month
|
|
162
|
+
- Year Month Short
|
|
163
|
+
- timeUnit: Week
|
|
164
|
+
primaryColumn: ISO Year-Week Number
|
|
165
|
+
associatedColumns:
|
|
166
|
+
- ISO Year-Week
|
|
167
|
+
- timeUnit: WeekOfYear
|
|
168
|
+
primaryColumn: Week of Year
|
|
169
|
+
- timeUnit: Date
|
|
170
|
+
primaryColumn: Date
|
|
171
|
+
- name: Fiscal Calendar
|
|
172
|
+
calendarColumnGroups:
|
|
173
|
+
- timeUnit: Year
|
|
174
|
+
primaryColumn: Fiscal Year Number
|
|
175
|
+
associatedColumns:
|
|
176
|
+
- Fiscal Year Name
|
|
177
|
+
- timeUnit: Month
|
|
178
|
+
primaryColumn: Fiscal Year Month Number
|
|
179
|
+
associatedColumns:
|
|
180
|
+
- Fiscal Year Month
|
|
181
|
+
- timeUnit: MonthOfYear
|
|
182
|
+
primaryColumn: Fiscal Month Number of Year
|
|
183
|
+
associatedColumns:
|
|
184
|
+
- Fiscal Month Name
|
|
185
|
+
timeRelatedGroups:
|
|
186
|
+
- column: RelativeMonth
|
|
187
|
+
- column: Season
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**API note:** The `timeRelatedGroups` entries above represent individual columns within **one** group, not separate groups. When calling the calendar API, combine them into a single TimeRelated column group: `{"groupType": "TimeRelated", "timeRelatedGroup": {"columns": ["RelativeMonth", "Season"]}}`.
|
|
191
|
+
|
|
192
|
+
## Week-based (4-4-5 / ISO) calendar example
|
|
193
|
+
|
|
194
|
+
In a week-based calendar, weeks are a proper hierarchical level. Periods replace months and contain a whole number of weeks (e.g., 4, 4, and 5 weeks per quarter in a 4-4-5 pattern). As noted in Mapping guidance, map Period to the `Month` time unit and use the ISO year — not the Gregorian year — as the year column.
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
Tables:
|
|
198
|
+
- Name: ISO Date
|
|
199
|
+
Columns:
|
|
200
|
+
- Name: Date
|
|
201
|
+
Type: Date
|
|
202
|
+
- Name: ISO Year
|
|
203
|
+
Type: Integer
|
|
204
|
+
- Name: Year-Period
|
|
205
|
+
Type: Integer
|
|
206
|
+
# e.g., 202403 = period 3 of ISO year 2024
|
|
207
|
+
- Name: Year-Week
|
|
208
|
+
Type: Integer
|
|
209
|
+
# e.g., 202449 = week 49 of ISO year 2024
|
|
210
|
+
- Name: Period
|
|
211
|
+
Type: Integer
|
|
212
|
+
# Period number within the year (1-12)
|
|
213
|
+
- Name: ISO Week
|
|
214
|
+
Type: Integer
|
|
215
|
+
# ISO week number (1-53)
|
|
216
|
+
- Name: Week in Period
|
|
217
|
+
Type: Integer
|
|
218
|
+
# Week position within its period (1-4 or 1-5)
|
|
219
|
+
- Name: Day of Week
|
|
220
|
+
Type: Integer
|
|
221
|
+
# 1=Monday through 7=Sunday
|
|
222
|
+
Calendars:
|
|
223
|
+
- name: ISOCalendar445
|
|
224
|
+
calendarColumnGroups:
|
|
225
|
+
- timeUnit: Year
|
|
226
|
+
primaryColumn: ISO Year
|
|
227
|
+
- timeUnit: Month
|
|
228
|
+
# Period maps to Month because it occupies the same
|
|
229
|
+
# hierarchical position between Week and Year
|
|
230
|
+
primaryColumn: Year-Period
|
|
231
|
+
- timeUnit: MonthOfYear
|
|
232
|
+
primaryColumn: Period
|
|
233
|
+
- timeUnit: Week
|
|
234
|
+
primaryColumn: Year-Week
|
|
235
|
+
- timeUnit: WeekOfYear
|
|
236
|
+
primaryColumn: ISO Week
|
|
237
|
+
- timeUnit: Date
|
|
238
|
+
primaryColumn: Date
|
|
239
|
+
timeRelatedGroups:
|
|
240
|
+
- column: Week in Period
|
|
241
|
+
- column: Day of Week
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**Notes on week-based calendars and time intelligence:**
|
|
245
|
+
- With a custom calendar defined this way, standard DAX time intelligence functions (DATESYTD, DATESMTD, DATESWTD, SAMEPERIODLASTYEAR, DATEADD) automatically adapt to the week-based hierarchy.
|
|
246
|
+
- DATESMTD returns period-to-date results (since Period is mapped to Month).
|
|
247
|
+
- DATESWTD returns week-to-date results.
|
|
248
|
+
- SAMEPERIODLASTYEAR shifts to the same week number and day-of-week in the previous ISO year, which ensures that comparisons always cover the same number of days.
|
|
249
|
+
- DATEADD supports Extension (Precise or Extending) and Truncation (Anchored or Blanks) parameters to handle shifts between periods of different lengths (e.g., 4-week vs. 5-week periods).
|