eMondrian includes an MCP server. MCP (Model Context Protocol) is the standard way AI agents — Claude Code, Claude Desktop and other MCP clients — connect to tools and data.

Through MCP an agent can list your catalogs, read the semantic model, run MDX and DAX queries, draft, validate and save schemas, and build Power BI reports.

Other systems get the same data as JSON over the REST API.

Why the semantic model and not the database? The agent works with business definitions — Revenue, On-Time Rate, Region — that are already defined once, instead of guessing joins and formulas from raw tables. Excel, Power BI and the agent get the same numbers.

Requirements

  • eMondrian Community running — see Install with Docker. The MCP module is included and free: it needs no license key.
  • An MCP client that supports Streamable HTTP (or, for older clients, HTTP+SSE).

Endpoint

http://localhost/emondrian/mcp

http://localhost/emondrian/mcp (Streamable HTTP, with or without trailing slash). Older clients: http://localhost/emondrian/mcp/sse.

  • Another machine: http://<server-address>/emondrian/mcp (older clients: http://<server-address>/emondrian/mcp/sse)
  • Port changed in .env: http://localhost:8081/emondrian/mcp (older clients: http://localhost:8081/emondrian/mcp/sse)
  • Keep the /emondrian prefix — without it, calls fail with HTTP 404.

Connect a client

Claude Code

claude mcp add --transport http emondrian http://localhost/emondrian/mcp

For older clients:

claude mcp add --transport sse emondrian http://localhost/emondrian/mcp/sse

Claude Desktop — Claude Desktop starts local (stdio) servers, so use the mcp-remote bridge. Add to claude_desktop_config.json and restart Claude Desktop:

{
  "mcpServers": {
    "emondrian": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost/emondrian/mcp"]
    }
  }
}

Other clients — point any MCP client to the endpoint above; use /emondrian/mcp/sse only if the client supports SSE only.

Log in

After setup, authentication is off and no login is needed: every agent is the user guest with all rights. Once authentication is on, the agent must log in, and it then acts as that user.

WayHow
OAuthAdd the server without a header. The client opens the login page in your browser. From another machine this needs the server’s https:// address: MCP clients refuse an OAuth login over plain HTTP, except on localhost.
User name and passwordSend them as HTTP Basic in the Authorization header. This works over HTTP too, but the password then travels unencrypted.
Personal tokenIssue one at PUBLIC_URL/account/tokens and send it as Authorization: Bearer <token>. A user has one token: a new one revokes the old.

Claude Code with OAuth:

claude mcp add --transport http emondrian https://bi.example.com/emondrian/mcp

Then run /mcp in Claude Code and choose Authenticate.

Claude Code with a user name and password:

claude mcp add --transport http emondrian https://bi.example.com/emondrian/mcp \
    --header "Authorization: Basic $(printf '%s' 'jdoe:password' | base64)"

We tested the OAuth login with Claude Code over HTTPS, on both transports.

Try it on the public demo

The public demo server runs the MCP server with read-only schemas — no installation and no key needed:

claude mcp add --transport http emondrian-demo https://demo.emondrian.com/emondrian/mcp

On the demo an agent can read the models, query them and build on them:

  • Read and query: list_catalogs, describe_cube, get_schema, get_csdl, execute_query (MDX and DAX), list_roles, get_role.
  • Look at the databases: describe_source, validate_source_sql, list_source_credentials, list_drivers, list_shared_files, synthetic_catalog_status.
  • Check models: validate_schema, get_cube_authoring_guide, get_ossie_guide, validate_ossie.
  • Build dashboards: get_dashboard_authoring_guide, create_dashboard, update_dashboard, get_dashboard, list_dashboards, delete_dashboard, get_dashboard_access, set_dashboard_access.
  • Build Power BI reports: make_project, make_page, make_visual, arrange_page, validate_report.

The demo’s schemas are read-only: tools that save schemas, catalogs and roles, install drivers or read the server’s logs and settings are not offered there. For the full tool set, run Community locally.

claude.ai: Customize → Connectors → add a custom connector with the URL https://demo.emondrian.com/emondrian/mcp (No sign-in). Claude Dashboards (beta): Artifacts → Dashboard (Beta), then ask for a dashboard on the eMondrian demo; Claude queries it with MDX.

For example: “Build a dashboard for the OnTime cube: on-time rate by year, by month for 2025, and the largest carriers, with year and carrier filters.”

Where your data goes

Claude sees the model, not the rows. While it builds a dashboard, it reads the cubes, measures and formulas with list_catalogs and get_schema, then writes MDX queries into the page. The dashboard stores those queries, not the numbers.

%%{init: {"flowchart": {"curve": "linear"}}}%%
flowchart LR
  claude["Claude"] -->|"list_catalogs · get_schema"| em["<b>eMondrian</b><br/>MCP"]
  em -->|"cubes, measures, formulas"| claude
  claude -->|"writes MDX"| dash["Dashboard<br/>(stores queries)"]

Each time someone opens the dashboard, its queries go from the browser through Anthropic’s cloud to the eMondrian server. eMondrian turns MDX into SQL, the database aggregates, and only the aggregated result travels back: a monthly chart for one year is 12 rows, not the millions of flights behind it. Raw rows stay in your database.

%%{init: {"flowchart": {"curve": "linear"}}}%%
flowchart LR
  browser["Browser"] -->|"stored MDX"| cloud["Anthropic cloud<br/>(connector)"]
  cloud -->|MCP| em["<b>eMondrian</b>"]
  em -->|SQL| db[("ClickHouse")]
  db -.->|"aggregates"| em
  em -.->|"12 rows × 3 measures"| cloud
  cloud -.-> browser

What this means for your own server:

  • It must be reachable from Anthropic’s cloud to be used as a claude.ai connector — claude.ai does not connect from your machine.
  • Switch authentication on before the server is reachable from the internet. Community’s MCP includes tools that change schemas (save_schema, save_catalog). With authentication on, the agent signs in and acts with its user’s rights — see Security.
  • The public demo is safe to connect: its schemas are read-only and it holds public sample data.

Build Power BI reports with an agent

An agent can build a Power BI report on your model: a Power BI project (PBIP) — a .pbip file and a folder of JSON files, one per page and visual — with a live connection to eMondrian. You open it in Power BI Desktop; nothing is imported.

Requires Power BI Desktop on Windows and a key with DAX (the 30-day evaluation key is enough). Try it on the public demo first: https://demo.emondrian.com/emondrian/mcp.

1. Connect the agent

In an empty folder, for Claude Code:

claude mcp add --scope project --transport http emondrian http://localhost/emondrian/mcp

2. Ask for a report

For example:

Using the eMondrian MCP server, build a Power BI report on the OnTime catalog: a page “On-time performance” with year and carrier slicers, KPI cards for flights and on-time rate, on-time rate by year (line), by month for the selected year, and the largest carriers (bar). Validate the report before you finish. Power BI should connect live to http://localhost/xmla.

Name the XMLA address Power BI Desktop will use. The project stores it, and Community has no default for it (an administrator can set one with -Demondrian.mcp.publicXmlaUrl=<url>).

The agent reads the model (get_csdl gives the field names Power BI uses), generates the project with make_project, checks it with validate_report, and writes the files. The tools return file contents; the agent writes them to disk.

3. Open it in Power BI Desktop

Double-click the .pbip file. Power BI connects live, and every visual queries the model when it renders.

4. Change it while Desktop is open

Ask for a change in the same session, e.g. “Add a chart with cancellation rate by day of week for the selected year and carrier.” The agent uses make_page, make_visual or arrange_page, and validates again.

  1. Save the report in Desktop first. Desktop’s next save overwrites files changed outside it, so unsaved edits there can be lost.
  2. After the agent writes the files, Desktop shows This project’s files were changed externally. Click Apply external changes; the page reloads without reopening the report.

To share the report, publish it from Desktop — see Publish to the Power BI Service.

Try it

  • “Which catalogs and cubes are on this server?” → FoodMart, OnTime
  • “In the OnTime catalog, which airline had the highest cancellation rate in January 2022?”
  • “Compare average arrival delay by day of week and explain the pattern.”
  • “Run this MDX on catalog FoodMart: SELECT {[Measures].[Org Salary]} ON 0 FROM [HR]”

The agent reads the schema, writes the query, runs it and explains the result.

Keep answers current

A measure is defined once, in the schema, and Excel, Power BI and the agent all read that one definition. When a measure changes and the schema is saved, the agent’s next query already uses the new definition; an open Power BI report or Excel workbook picks it up on Refresh.

What can go stale is the agent’s own memory. Tell it, in its instructions or prompt:

  • Query every time. Ask eMondrian for a value with an MDX or DAX query each time it’s needed; don’t reuse numbers from earlier in the conversation.
  • Don’t recompute measures. Use the measure from the model; don’t rebuild its formula from the schema and calculate it yourself.

Tools

ToolWhat it does
list_catalogsLists the catalogs declared in datasources.xml
get_schemaReturns the schema XML of a catalog. With part: only outline (its elements with lines and sizes), roles, cube:<name> or dimension:<name>, for a schema too large to read whole
get_csdlReturns a cube’s model as Power BI sees it (CSDL). Needs a key with DAX.
describe_cubeDescribes one cube: its dimensions, hierarchies and measures. Formulas of calculated measures are shown only to users who may read the schema. With as_user (administrators): the cube as that user sees it
execute_queryRuns MDX or DAX on a catalog. DAX is detected by a leading EVALUATE or DEFINE. Optional cube argument — required for DAX when the catalog has more than one cube. With as_user (administrators): runs with that user’s roles. DAX needs a key with DAX
validate_schemaChecks schema XML for problems the engine doesn’t report (misspelled attributes, key mismatches, …). With checkSource, also checks tables and columns against the database, by their exact names. Names classic dimensions in a warning: the classic form is obsolete
save_schemaOverwrites the schema of a catalog (validated first)
list_roles, get_role, save_role, delete_role, set_default_roleRead and change a schema’s roles one at a time: who sees which rows and measures. save_role creates or replaces one role and keeps the rest of the file; it writes nothing unless the schema with the role loads, and names an unknown member. The same rights as save_schema; not offered on a read-only server, except list_roles and get_role
save_catalogRegisters a catalog in datasources.xml and writes its schema file in one call. Without xml, for a new catalog, writes an empty schema, so describe_source and validate_source_sql work before the cube is written
delete_catalogPermanently deletes a catalog: its entry in datasources.xml, its schema file (unless another catalog uses it), and its synthetic copy with its data. Refuses while dashboards use the catalog, unless ignoreDashboards: true. Refuses a catalog with agentAccess="synthetic-only"
delete_schemaPermanently deletes a schema file in schema/ that no catalog uses
get_cube_authoring_guideGuide for writing and editing schemas
get_propertiesShows the server’s mondrian.properties settings
read_logsLists log files or shows the end of one (200 lines by default)
make_project, make_page, make_visual, arrange_page, validate_reportBuild a Power BI project (PBIP) with a live connection to eMondrian — see Build Power BI reports with an agent. Need a key with DAX
describe_sourceLists a database’s schemas, tables, columns, types and keys. No rows
validate_source_sqlChecks a SQL query or expression against the database without fetching a row
list_source_credentialsLists the credential variables in .env and whether each is set, never their values
install_driver, list_driversInstall a JDBC driver from Maven Central, an allowed https host or the share, and list installed drivers. Not offered on a read-only server
list_shared_filesLists files in the read-only share (share/)
get_ossie_guide, validate_ossieWrite a cube as an Apache Ossie model or build a cube from one, and check the model against the catalog: spec, names, database and metric totals — see Apache Ossie models
get_dashboard_authoring_guide, create_dashboard, update_dashboard, get_dashboard, list_dashboards, delete_dashboard, get_dashboard_access, set_dashboard_accessBuild and change dashboards at /dashboard/ — see Build a dashboard with an agent. Need a key with DASHBOARD; off with ENABLE_SERVICE_DASHBOARD=false
list_users, get_user, create_user, update_user, set_user_groups, list_groups, get_group_members, create_group, send_password_emailManage users and groups in Keycloak. create_user sets no password: the user sets their own from an e-mail (send_password_email; see E-mail and first passwords), or gets a personal token. For administrators
create_token, list_tokens, revoke_tokenA user’s personal token, which also makes links to dashboards — see Dashboard access. create_token issues only when personal_tokens.issue_via_agents allows; otherwise it answers with the page where an administrator issues it. Never shows a value otherwise
get_open_access, set_open_accessShow and switch authentication. Anybody may switch it on; only an administrator may switch it off

DAX through execute_query: qualify measures with their table ('HR'[Org Salary]) and pass cube for multi-cube catalogs — see DAX support.

Build a schema with an agent

An agent can draft a cube for you using get_cube_authoring_guide, validate_schema and save_schema. New schemas use the attribute model (<DimensionAttribute>); the classic form is obsolete, and DAX and Power BI need the attribute model — see Schema reference.

  1. If the database needs a user and password, add them to .env as EMONDRIAN_SRC_<NAME>_USER and EMONDRIAN_SRC_<NAME>_PASSWORD and run docker compose up -d. The connect string names them as ${env:…}; save_catalog refuses a literal password. This is the only step that needs a restart.

  2. Ask the agent to register the catalog with save_catalog. It writes the catalog into datasources.xml (reference) and creates an empty starting schema; the catalog is available from the next request.

  3. Ask, for example:

    “In catalog MySales, create a cube Sales on the ClickHouse table sales (columns: sale_date, region, product, quantity, amount). Add a Time dimension (Year → Month) from sale_date, Region and Product dimensions, measures Amount and Quantity, and a calculated measure Avg Price = Amount / Quantity. Follow the cube authoring guide, validate the schema, then save it.”

  4. No restart is needed after save_schema. The agent’s session sees the new cube from its next call, and so does every new connection. A client that already had a session open, such as an open Excel workbook or Power BI report, keeps the previous version until it reconnects.

  5. Check: “Show total Amount by Region for the last year.”

On a server started read-only, save_catalog and save_schema are not available; an administrator edits datasources.xml and the schema file instead.

Review what the agent wrote — especially that dimension keys are unique (Modeling on ClickHouse). The schema is a plain XML file in schema/; keep it in Git.

Build a dashboard with an agent

Community serves dashboards at http://localhost/dashboard/: filters shared by their widgets, KPIs, pivots you can expand, and bar, line and pie charts over your cubes. An agent builds and changes them through MCP. They need a key including DASHBOARD (evaluation keys issued from 9 November 2026 include it); without one, the page and the tools say where to get it.

For example, with a cube Flights in a catalog OnTime Example that an agent built over the bundled OnTime data (measures Flights, Cancelled, Avg Arr Delay; dimensions Date, Airline, Origin):

“Read the dashboard authoring guide, then build a dashboard “US flights” on OnTime Example / Flights: a Year filter, KPIs for Flights, Cancelled and Avg arrival delay, a bar chart by year, a bar chart of the top 12 airlines, and a pivot of flights by origin state with totals. Test every dataset’s MDX first, then create it and give me the link.”

The agent reads get_dashboard_authoring_guide, checks its MDX and calls create_dashboard, which runs every query once before saving and returns the link. To change a dashboard, ask in the same way — “In US flights, show the top 5 airlines instead of 12”; update_dashboard saves a new revision, and earlier ones stay under History. If someone else changed the dashboard in the meantime, the update is refused and nothing is saved.

  • The bundled OnTime sample holds January 2022 only, so a Year filter on it has one year.
  • Dashboards are kept in the dashboard_data volume.
  • With authentication on, each dashboard has its own rights, and the agent acts with its user’s rights: see Dashboard access.
  • To turn them off, set ENABLE_SERVICE_DASHBOARD=false in .env and run docker compose up -d: the page goes off, and from modules 0.0.0.102 so do the MCP dashboard tools.

Delete a catalog

delete_catalog removes a catalog for good — there is no backup and no undo. It takes effect on the next request, with no restart:

  • its entry in datasources.xml;
  • its schema file, unless another catalog uses it (the answer names that catalog);
  • its synthetic copy, <Catalog> (synthetic), with the synthetic data.

Called on <Catalog> (synthetic), it deletes only the synthetic copy. A catalog with agentAccess="synthetic-only" is not deleted (modules 0.0.0.103 and later): a person removes it from datasources.xml — see Can an agent change the setting?. Excel or Power BI sessions still open on the catalog get an error on their next query. If dashboards use the catalog, it refuses and names them; ignoreDashboards: true deletes anyway and leaves the dashboards unchanged. If it can’t check — the key with DASHBOARD has expired, or the Dashboard doesn’t answer — it also refuses and says why (modules 0.0.0.102 and later). A server without the Dashboard deletes without the check. delete_schema deletes a schema file that no catalog uses.

Both tools need the same rights as save_catalog and aren’t offered on a read-only server, so the public demo doesn’t have them. Keep your schemas in Git: that is your history and your way back.

What an agent sees of your data

Whether an agent sees a catalog’s real data, or only its structure and synthetic data, is an option. It is off by default (agentAccess="real"): an agent reads a catalog’s data like any other client.

The option has three values:

ValueWhat an agent can do
real (default)Read structure and data, like any client
synthetic-onlyRead and change structure; data only from the catalog’s synthetic copy
noneNothing: the catalog is hidden from agents

Turn it on

For one catalog, add the attribute to its <Catalog> element in datasources.xml:

<Catalog name="Sales" agentAccess="synthetic-only">

It takes effect on the next MCP call. If it doesn’t, restart the eMondrian service: Community mounts datasources.xml as a single file, and an editor that saves by writing a new file can leave the container on the old one. Editing in place or in the web Catalog Editor avoids this.

For every catalog on the server, add the system property to .env:

JAVA_TOOL_OPTIONS=-Demondrian.mcp.agentAccess=synthetic-only

If .env already has a JAVA_TOOL_OPTIONS line, append the option to it on the same line. Then recreate the container:

docker compose up -d --force-recreate eMondrian

Use the server-wide option where the whole server holds real data.

Turn it off

Set agentAccess="real" on the catalog, or remove the attribute. To undo the server-wide option, remove it from JAVA_TOOL_OPTIONS and recreate the container. The stricter of the catalog’s value and the server’s value wins, so real on a catalog does not override a server-wide synthetic-only. A value the server doesn’t recognise counts as none: a typo closes the catalog to agents rather than opening it.

With synthetic-only on

  • The structure tools work on the real catalog: get_schema, validate_schema, save_schema, save_catalog, add_time_measures, describe_source, validate_source_sql. An agent can build and check a cube on a new database without seeing a row.
  • The tools that return values or member names refuse: execute_query, describe_cube, get_csdl, the Power BI report tools and dashboards. They point to the catalog’s synthetic copy, <Catalog> (synthetic).
  • list_catalogs marks the catalog as synthetic-only for agents.
  • validate_source_sql refuses nested queries (subqueries, derived tables, WITH), because a database can evaluate a subquery before the check and return its values in an error message. On ClickHouse it refuses them on every catalog.

Synthetic copies are built by the synthetic module, which is part of Community and needs a license key that includes SYNTHETIC; evaluation keys issued from 8 November 2026 include it. The module is off until you use it: nothing is generated on its own. Without synthetic copies on the server the option still works: structure tools work, and data tools refuse.

agentAccess="none" hides a catalog completely: list_catalogs leaves it out, and every tool that names it, structure tools included, answers as if it didn’t exist.

describe_source and validate_source_sql return structure only whatever the setting: tables, columns, types and keys, never rows, counts, defaults or statistics.

The option applies only to MCP agents. Excel, Power BI and the web client see every catalog as before. It is independent of the server’s read-only mode.

Can an agent change the setting?

An agent cannot loosen a catalog’s agentAccess or the server-wide setting:

  • no tool sets or removes the attribute, and no tool changes .env or the server’s JVM options;
  • save_catalog keeps the attribute when it replaces the catalog, and refuses to register the same database or schema file under another name;
  • since modules 0.0.0.103 (Community 2026.11.10), delete_catalog refuses a synthetic-only catalog, so it can’t be deleted and registered again without the rule. A person removes such a catalog from datasources.xml; its <Catalog> (synthetic) can still be deleted on its own.

An agent can only tighten the setting: generate_synthetic_catalog with restrictSource=true sets synthetic-only.

The check on another name compares the database address as written, so the same database under another hostname isn’t caught. For a hard boundary, use the server-wide setting, the read-only mode (-Demondrian.mcp.readOnly=true in JAVA_TOOL_OPTIONS: no tool that saves, deletes or installs is offered) or the database user’s own grants.

Security

Not read-only, and open until you switch authentication on

MCP includes tools that overwrite schemas (save_schema, save_catalog), delete catalogs and read server logs (read_logs). After setup, authentication is off, and anyone who can reach the server can use them. Keep eMondrian on localhost or a trusted network, or switch authentication on — see Security.

With authentication on, every tool call runs as the user who logged in:

  • Data. The roles in the schema decide which cubes and members the agent sees, the same as in Excel for that user.
  • Changes. The server rights of the user’s groups decide what the agent may change. An agent of a user who may not write schemas can’t save one, and an agent of a user who may not read logs can’t read them.
  • Formulas. describe_cube shows the formulas of calculated measures only to users who may read the schema.
  • Traffic log. Every call is written to logs/mcp-audit.log with the user’s name.

The agent gets the same access as its user, not less. Query results go to the agent and to its model provider. To keep real data and secrets out of the agent’s chat, see AI agent data security: keep company data and passwords out of the agent’s chat.

Other limits to know:

  • No row limit. Large results are returned in full — ask the agent for aggregated answers rather than raw detail.
  • No request timeout. A misbehaving MCP client can hold a server thread.

Troubleshooting

ProblemWhat to check
Client can’t connectIs the server up (http://localhost)? URL is /emondrian/mcp (Streamable HTTP) or /emondrian/mcp/sse (SSE)? Right port? Transport matches the URL?
HTTP 401Authentication is on and the agent isn’t logged in — see Log in
OAuth login fails with “non-https token endpoint”Use the server’s https:// address, or send a user name and password in the Authorization header
A tool answers that the user has no rightThe agent acts as its user. The tool needs a server right that this user’s groups don’t have — see Security
Error POSTing to endpoint (HTTP 404)/emondrian prefix missing, or an old module — update Community, see Install with Docker
Your eMondrian licence does not include the MCP module.The server runs modules from before MCP became free. Update Community — see Install with Docker
No eMondrian licence found / Your eMondrian licence expiredSee Evaluation key
DAX query failsPass cube; qualify measures with their table
Agent’s answer looks wrongAsk the agent to show the query it ran and run it in the OLAP Client. Check the measure definitions in the schema