Configuration
Advanced configuration reference for MCP Engine environment variables and runtime behavior.
If you only need installation and first prompts, start with Getting Started.
04 — CONFIGURATION
Environment Variables
Configure MCP Engine behavior through environment variables. Click to expand each section.
| Variable | Description | Default |
|---|---|---|
| MCP_ENGINE_LICENSE | Reserved for offline formats (disabled in this release) | - |
| MCP_ENGINE_LICENSE_FILE | Path to activated lease file (JSON) | ~/.mcp-engine/license.key |
| MCP_ENGINE_MAX_QUERY_ROWS | Max rows returned by DAX queries | 1,000 |
| MCP_ENGINE_MODE | Set to enable read-only mode | - |
| MCP_ENGINE_NO_AUTOSELECT | Disable auto-selection of single instance | false |
| MCP_ENGINE_MAX_PREVIEW_ROWS | Max rows for preview operations | 1,000 |
| MCP_ENGINE_PII_MASKING | Enable PII redaction in outputs (Pro) | false |
| MCP_ENGINE_NUMERIC_MASKING | Enable numeric masking in outputs (Pro) | false |
MCP_ENGINE_LICENSEReserved for offline formats (disabled in this release)
Default: -
MCP_ENGINE_LICENSE_FILEPath to activated lease file (JSON)
Default: ~/.mcp-engine/license.key
MCP_ENGINE_MAX_QUERY_ROWSMax rows returned by DAX queries
Default: 1,000
MCP_ENGINE_MODESet to enable read-only mode
Default: -
MCP_ENGINE_NO_AUTOSELECTDisable auto-selection of single instance
Default: false
MCP_ENGINE_MAX_PREVIEW_ROWSMax rows for preview operations
Default: 1,000
MCP_ENGINE_PII_MASKINGEnable PII redaction in outputs (Pro)
Default: false
MCP_ENGINE_NUMERIC_MASKINGEnable numeric masking in outputs (Pro)
Default: false
Activate MCP Engine directly from chat using the built-in license manager tool.
Pro & Enterprise Activation
Free tier works out of the box. Pro license activation is performed interactively via chat.
Activate from Chat
Ask your MCP client to run manage_license → activate, then follow the prompt to provide your key.
Centralized pagination configuration with per-tool overrides. All paginated tools pull their defaults from a single configuration source.
| Variable | Description | Default |
|---|---|---|
| MCP_ENGINE_PAGINATION_DEFAULT_LIMIT | Default items per page for all tools | 50 |
| MCP_ENGINE_PAGINATION_MAX_LIMIT | Maximum allowed items per page | 1,000 |
| MCP_ENGINE_SEARCH_GROUPED_LIMIT_PER_TYPE | Default items per bucket in grouped search | 25 |
| MCP_ENGINE_PAGINATION_TOOLS_JSON | JSON object for per-tool overrides | - |
MCP_ENGINE_PAGINATION_DEFAULT_LIMITDefault items per page for all tools
Default: 50
MCP_ENGINE_PAGINATION_MAX_LIMITMaximum allowed items per page
Default: 1,000
MCP_ENGINE_SEARCH_GROUPED_LIMIT_PER_TYPEDefault items per bucket in grouped search
Default: 25
MCP_ENGINE_PAGINATION_TOOLS_JSONJSON object for per-tool overrides
Default: -
Configuration File (appsettings.json)
{
"Pagination": {
"DefaultLimit": 50,
"MaxLimit": 1000,
"SearchGroupedDefaultLimitPerType": 25,
"Tools": {
"list_model": { "DefaultLimit": 100 },
"manage_audit": { "DefaultLimit": 100, "MaxLimit": 10000 }
}
}
}Precedence: Environment variables override appsettings.json, which overrides hardcoded defaults.
Default Tool Overrides
| Tool | Default Limit | Max Limit | Notes |
|---|---|---|---|
| All tools | 50 | 1,000 | Global default |
| list_model | 100 | 1,000 | More exploratory by default |
| manage_audit | 100 | 10,000 | Audit entries are small; large exports common |
All toolsGlobal default
list_modelMore exploratory by default
manage_auditAudit entries are small; large exports common
Per-Tool Override via Environment
export MCP_ENGINE_PAGINATION_TOOLS_JSON='{"list_model":{"DefaultLimit":200},"manage_audit":{"MaxLimit":50000}}'Detects when the Power BI model is modified outside of MCP (e.g., in Power BI Desktop UI or Tabular Editor) and can prompt to reload metadata or block operations until refreshed.
How It Works
- •Before each tool call, MCP checks when the model was last modified
- •Compares against a baseline (set on connect and after each change you make)
- •If the model was modified more recently than the baseline, an external change is detected
- •Works with both Power BI Desktop and Power BI Service (XMLA)
Behavior Modes
| Mode | Description |
|---|---|
| Prompt (default) | Shows elicitation prompt asking user to reload |
| Auto-reload | Automatically refreshes metadata without prompting |
| Fail-closed (default) | Blocks operation if user declines reload |
| Fail-open | Proceeds with stale metadata after one-time acknowledgment |
Prompt (default)Shows elicitation prompt asking user to reload
Auto-reloadAutomatically refreshes metadata without prompting
Fail-closed (default)Blocks operation if user declines reload
Fail-openProceeds with stale metadata after one-time acknowledgment
Environment Variables
| Variable | Description | Default |
|---|---|---|
| MCP_ENGINE_EXTERNAL_CHANGE_DETECTION | Enable/disable feature | true |
| MCP_ENGINE_EXTERNAL_CHANGE_POLL_MIN_INTERVAL_MS | Throttle between polls (ms) | 500 |
| MCP_ENGINE_EXTERNAL_CHANGE_PROMPT | Show elicitation prompts | true |
| MCP_ENGINE_EXTERNAL_CHANGE_AUTO_RELOAD | Auto-reload without prompt | false |
| MCP_ENGINE_EXTERNAL_CHANGE_FAIL_CLOSED | Block on stale model | true |
MCP_ENGINE_EXTERNAL_CHANGE_DETECTIONEnable/disable feature
Default: true
MCP_ENGINE_EXTERNAL_CHANGE_POLL_MIN_INTERVAL_MSThrottle between polls (ms)
Default: 500
MCP_ENGINE_EXTERNAL_CHANGE_PROMPTShow elicitation prompts
Default: true
MCP_ENGINE_EXTERNAL_CHANGE_AUTO_RELOADAuto-reload without prompt
Default: false
MCP_ENGINE_EXTERNAL_CHANGE_FAIL_CLOSEDBlock on stale model
Default: true
Manual Reload
Manually refresh metadata anytime via manage_model_connection:
{ "operation": "reload" }Design Points
- •No false positives: Baseline resets after each change you make through MCP
- •Graceful degradation: If timestamp data is unavailable, feature auto-disables
- •Transient-failure resilient: Temporary network issues don't disable detection
- •Thread-safe: Concurrent tool calls handled correctly
Text searches in list_model (mode="text" and mode="any") use an in-memory cache for faster performance. The cache is automatically invalidated when you connect to a different model, refresh metadata, or make changes.
| Variable | Description | Default |
|---|---|---|
| MCP_ENGINE_TEXT_SEARCH_CACHE_ENABLED | Enable in-memory caching of search snapshots | true |
| MCP_ENGINE_TEXT_SEARCH_CACHE_TTL_SECONDS | How long cached data remains valid | 30 |
| MCP_ENGINE_TEXT_SEARCH_CACHE_MAX_ENTRIES | Maximum number of cached snapshots | 16 |
MCP_ENGINE_TEXT_SEARCH_CACHE_ENABLEDEnable in-memory caching of search snapshots
Default: true
MCP_ENGINE_TEXT_SEARCH_CACHE_TTL_SECONDSHow long cached data remains valid
Default: 30
MCP_ENGINE_TEXT_SEARCH_CACHE_MAX_ENTRIESMaximum number of cached snapshots
Default: 16
Runtime Preferences
These settings can also be adjusted at runtime via manage_memory:
{
"operation": "set",
"scope": "global",
"preferences": {
"text_search_cache_enabled": true,
"text_search_cache_ttl_seconds": 30
}
}When to Disable
Consider disabling the cache if:
- •Debugging issues with external model changes not being detected
- •Running in memory-constrained environments with very large models
The Impact Analyzer caches a per-model dependency corpus (expression index) to keep repeated lookups fast, especially during depth traversal. The cache is automatically invalidated when you connect to a different model or refresh metadata.
| Variable | Description | Default |
|---|---|---|
| MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_ENABLED | Enable caching of dependency corpus | true |
| MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_TTL_SECONDS | How long cached data remains valid | 30 |
| MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_MAX_ENTRIES | Maximum number of cached corpora | 8 |
MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_ENABLEDEnable caching of dependency corpus
Default: true
MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_TTL_SECONDSHow long cached data remains valid
Default: 30
MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_MAX_ENTRIESMaximum number of cached corpora
Default: 8
DAX and M expressions can be automatically formatted before saving to the model. Formatting uses external services and requires explicit consent since your code is sent to these services.
DAX Formatting
| Variable | Description | Default |
|---|---|---|
| MCP_ENGINE_DAX_FORMATTING_ENABLED | Enable online DAX formatting | true |
| MCP_ENGINE_DAX_FORMATTING_ADMIN_DISABLE | Admin override to disable (Enterprise) | false |
| MCP_ENGINE_DAX_FORMATTING_TIMEOUT_MS | Request timeout in milliseconds | 30,000 |
| MCP_ENGINE_DAX_FORMATTING_LINE_STYLE | Line wrapping style (short, long) | long |
| MCP_ENGINE_DAX_FORMATTING_SPACING_STYLE | Space after function names | best_practice |
| MCP_ENGINE_DAX_FORMATTING_LIST_SEPARATOR | Locale list separator | , |
| MCP_ENGINE_DAX_FORMATTING_DECIMAL_SEPARATOR | Locale decimal separator | . |
MCP_ENGINE_DAX_FORMATTING_ENABLEDEnable online DAX formatting
Default: true
MCP_ENGINE_DAX_FORMATTING_ADMIN_DISABLEAdmin override to disable (Enterprise)
Default: false
MCP_ENGINE_DAX_FORMATTING_TIMEOUT_MSRequest timeout in milliseconds
Default: 30,000
MCP_ENGINE_DAX_FORMATTING_LINE_STYLELine wrapping style (short, long)
Default: long
MCP_ENGINE_DAX_FORMATTING_SPACING_STYLESpace after function names
Default: best_practice
MCP_ENGINE_DAX_FORMATTING_LIST_SEPARATORLocale list separator
Default: ,
MCP_ENGINE_DAX_FORMATTING_DECIMAL_SEPARATORLocale decimal separator
Default: .
M (Power Query) Formatting
| Variable | Description | Default |
|---|---|---|
| MCP_ENGINE_M_FORMATTING_ENABLED | Enable online M formatting | true |
| MCP_ENGINE_M_FORMATTING_ADMIN_DISABLE | Admin override to disable (Enterprise) | false |
| MCP_ENGINE_M_FORMATTING_TIMEOUT_MS | Request timeout in milliseconds | 30,000 |
| MCP_ENGINE_M_FORMATTING_LINE_WIDTH | Line width for formatted output | - |
| MCP_ENGINE_M_FORMATTING_INDENT_LENGTH | Indentation length | - |
| MCP_ENGINE_M_FORMATTING_INDENT_STYLE | Indentation character (spaces, tabs) | - |
MCP_ENGINE_M_FORMATTING_ENABLEDEnable online M formatting
Default: true
MCP_ENGINE_M_FORMATTING_ADMIN_DISABLEAdmin override to disable (Enterprise)
Default: false
MCP_ENGINE_M_FORMATTING_TIMEOUT_MSRequest timeout in milliseconds
Default: 30,000
MCP_ENGINE_M_FORMATTING_LINE_WIDTHLine width for formatted output
Default: -
MCP_ENGINE_M_FORMATTING_INDENT_LENGTHIndentation length
Default: -
MCP_ENGINE_M_FORMATTING_INDENT_STYLEIndentation character (spaces, tabs)
Default: -
Usage in Tools
Add formatting options to write operations. The consent flag is required when formatting is enabled:
// DAX formatting (measures, calc items)
"format_dax": {
"enabled": true,
"consent": true
}
// M formatting (partitions, named expressions)
"format_m": {
"enabled": true,
"consent": true
}Supported Operations
- •DAX: Measures, calculation items, calculated partitions
- •M: M partitions, named expressions
Runtime Preferences
Formatting settings can also be adjusted at runtime via manage_memory without restarting. Environment variables take precedence over runtime preferences.
// Set DAX line style to short
{
"operation": "put",
"id": "dax_formatting_line_style",
"value": "short"
}
// European locale (semicolon separator)
{
"operation": "put",
"id": "dax_formatting_list_separator",
"value": ";"
}Available preferences: dax_formatting_enabled, dax_formatting_line_style, dax_formatting_spacing_style, dax_formatting_list_separator, dax_formatting_decimal_separator, m_formatting_enabled, m_formatting_line_width, m_formatting_indent_length, m_formatting_indent_style