Back to Getting Started

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.

MCP_ENGINE_LICENSE

Reserved for offline formats (disabled in this release)

Default: -

MCP_ENGINE_LICENSE_FILE

Path to activated lease file (JSON)

Default: ~/.mcp-engine/license.key

MCP_ENGINE_MAX_QUERY_ROWS

Max rows returned by DAX queries

Default: 1,000

MCP_ENGINE_MODE

Set to enable read-only mode

Default: -

MCP_ENGINE_NO_AUTOSELECT

Disable auto-selection of single instance

Default: false

MCP_ENGINE_MAX_PREVIEW_ROWS

Max rows for preview operations

Default: 1,000

MCP_ENGINE_PII_MASKING

Enable PII redaction in outputs (Pro)

Default: false

MCP_ENGINE_NUMERIC_MASKING

Enable 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.

Connect to MCP Engine and activate my license (use manage_license → activate)
Check my license tier (manage_license → status)
See License Manager documentation →

Centralized pagination configuration with per-tool overrides. All paginated tools pull their defaults from a single configuration source.

MCP_ENGINE_PAGINATION_DEFAULT_LIMIT

Default items per page for all tools

Default: 50

MCP_ENGINE_PAGINATION_MAX_LIMIT

Maximum allowed items per page

Default: 1,000

MCP_ENGINE_SEARCH_GROUPED_LIMIT_PER_TYPE

Default items per bucket in grouped search

Default: 25

MCP_ENGINE_PAGINATION_TOOLS_JSON

JSON 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

All tools
Default: 50Max: 1,000

Global default

list_model
Default: 100Max: 1,000

More exploratory by default

manage_audit
Default: 100Max: 10,000

Audit 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

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

Environment Variables

MCP_ENGINE_EXTERNAL_CHANGE_DETECTION

Enable/disable feature

Default: true

MCP_ENGINE_EXTERNAL_CHANGE_POLL_MIN_INTERVAL_MS

Throttle between polls (ms)

Default: 500

MCP_ENGINE_EXTERNAL_CHANGE_PROMPT

Show elicitation prompts

Default: true

MCP_ENGINE_EXTERNAL_CHANGE_AUTO_RELOAD

Auto-reload without prompt

Default: false

MCP_ENGINE_EXTERNAL_CHANGE_FAIL_CLOSED

Block 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.

MCP_ENGINE_TEXT_SEARCH_CACHE_ENABLED

Enable in-memory caching of search snapshots

Default: true

MCP_ENGINE_TEXT_SEARCH_CACHE_TTL_SECONDS

How long cached data remains valid

Default: 30

MCP_ENGINE_TEXT_SEARCH_CACHE_MAX_ENTRIES

Maximum 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.

MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_ENABLED

Enable caching of dependency corpus

Default: true

MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_TTL_SECONDS

How long cached data remains valid

Default: 30

MCP_ENGINE_DEPENDENCY_CORPUS_CACHE_MAX_ENTRIES

Maximum 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

MCP_ENGINE_DAX_FORMATTING_ENABLED

Enable online DAX formatting

Default: true

MCP_ENGINE_DAX_FORMATTING_ADMIN_DISABLE

Admin override to disable (Enterprise)

Default: false

MCP_ENGINE_DAX_FORMATTING_TIMEOUT_MS

Request timeout in milliseconds

Default: 30,000

MCP_ENGINE_DAX_FORMATTING_LINE_STYLE

Line wrapping style (short, long)

Default: long

MCP_ENGINE_DAX_FORMATTING_SPACING_STYLE

Space after function names

Default: best_practice

MCP_ENGINE_DAX_FORMATTING_LIST_SEPARATOR

Locale list separator

Default: ,

MCP_ENGINE_DAX_FORMATTING_DECIMAL_SEPARATOR

Locale decimal separator

Default: .

M (Power Query) Formatting

MCP_ENGINE_M_FORMATTING_ENABLED

Enable online M formatting

Default: true

MCP_ENGINE_M_FORMATTING_ADMIN_DISABLE

Admin override to disable (Enterprise)

Default: false

MCP_ENGINE_M_FORMATTING_TIMEOUT_MS

Request timeout in milliseconds

Default: 30,000

MCP_ENGINE_M_FORMATTING_LINE_WIDTH

Line width for formatted output

Default: -

MCP_ENGINE_M_FORMATTING_INDENT_LENGTH

Indentation length

Default: -

MCP_ENGINE_M_FORMATTING_INDENT_STYLE

Indentation 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