MCP server¶
XLTable has a built-in MCP server: an AI assistant such as Claude can list your cubes, inspect their dimensions and measures, and run aggregated pivot queries — through the same live XLTable instance, cubes and cache that serve your Excel Pivot Tables. Ask a question in plain language, get numbers from the same semantic layer Excel uses.
The assistant works through cubes: it sends cube, dimension and measure
names, and XLTable builds and executes the SQL. Raw SQL access to the
warehouse is not exposed to an assistant that answers questions — the only
exception is the read-only run_sql tool for cube authors, which an
administrator enables explicitly (see Building cubes with an assistant).
MCP connectivity is available in both editions: the free desktop edition connects anonymously on the local machine, the server edition requires the user’s XLTable credentials — see Server edition below.
Tools¶
Tool |
What it does |
|---|---|
|
Lists the cubes available on the server (the free edition reads them from the local cube folder), each with a short description when the cube author wrote one. |
|
Returns the cube schema in an assistant-friendly form: dimensions with their levels, and measures — plus the semantics the cube author described (see Describing cubes for AI). |
|
Runs an aggregated pivot query: group by dimension levels, aggregate
measures, filter rows before aggregation, limit the result size.
Returns the rows, a |
|
Returns the layout of the last Pivot Table the user queried from Excel — see Working alongside Excel. |
|
Analytical operators: the engine computes the comparison, ranking, time series, deviation or the drivers of a change, the assistant only interprets — see Analytical operators. |
|
Folder cube source only: lists the tables and views of the connected warehouse — names only, optionally filtered by a substring. The chat counterpart of the autogen wizard’s table-filter step. |
|
Folder cube source only: generates a cube from a single warehouse
table with the same engine as |
|
Cube authors only: validates a cube definition text with the same syntax checker and parser that serve Excel, without saving it — findings with line numbers. See Building cubes with an assistant. |
|
Cube authors only, off by default: one read-only SQL statement against the warehouse for exploring tables while building a cube — row limit, timeout, optional schema allow-list, every call logged. See Building cubes with an assistant. |
|
Server edition with |
Security roles from the cube definition apply on the MCP path the same way they apply in Excel.
When the server reads cube definitions from the olap_definition table
(CUBE_SOURCE=database), the tools also accept an optional database
argument — the assistant takes the name from list_databases. If the
warehouse has a single database, it is selected automatically and the
argument can be omitted. In the free edition there is always exactly one
catalog (the cube folder), so neither the tool nor the argument appears.
Describing cubes for AI¶
An assistant answers far better when it sees described fields instead of a bare schema. Four optional tags in the cube definition carry that description; they are metadata only — Excel and the XMLA path ignore them completely, and a cube file with them keeps working unchanged on any XLTable server.
Tag |
What it adds |
|---|---|
Cube level: what the data is, its grain, which questions it answers.
|
|
Cube level: free-form instructions for the assistant, returned by
|
|
Field level: business meaning, units, caveats. |
|
Field level: alternative names the user may use in a question,
separated by |
Cube-level blocks run to the next --olap_* tag or to the end of the file,
so write them at the very end of the definition. Lines starting with
-- inside a block are comments and are not part of the text.
--olap_source Sales
SELECT
--olap_measures
sum(sales.sum) as sales_sum_sum --translation=`Sales Amount`
--description=`Revenue including VAT, in KZT`
--synonyms=`revenue;turnover;sales`
FROM db.Sales sales
--olap_description
Sales fact cube, one row per sale line.
Answers questions about revenue and quantity by store, model and period.
--olap_ai_instructions
Compare years only over completed months.
Start with olap_description — it is what an assistant reads first, and
autogen already leaves an empty one at the bottom of
every generated cube for you to fill in. Add field descriptions and synonyms
later, for the fields whose names are ambiguous on their own.
Sample values come from the engine, not from the file. For every
low-cardinality dimension level, describe_cube also returns the actual
list of its values, fetched live with the same query that fills a filter
drop-down in Excel — so the assistant knows to filter by North rather than
guessing North Region. Values are never stored in the cube file: they
cannot go stale, and they honor row-level security — a user sees only the
values their access filters allow. Levels with more distinct values than the
threshold (30 by default, MCP sample_values_max) return the
first values in a stable order and are listed in sample_values_truncated,
so the assistant knows the list is a sample, not the full set.
Analytical operators¶
An analyst asks thousands of different questions, but they come down to a
handful of types of analysis. A language model that is handed raw rows and
asked “why did margin fall?” answers by guesswork — and differently each
time. XLTable takes the opposite approach: the model understands the
question, the engine does the arithmetic. Each type of question has its own
tool; the assistant picks the tool and the fields, XLTable runs the pivot
queries through the same cube, security roles and cache as query_cube
and returns the computed figures.
Question |
Tool |
What comes back |
|---|---|---|
How much? |
|
An aggregated slice: measures by dimension levels, with filters. |
How did it change? |
|
Measures in two periods side by side, broken down by dimensions:
the value in each period, the absolute change and the change in
percent, sorted by the size of the change, plus the same comparison
for the grand total. The change is always later period minus
earlier period, whichever argument holds the later one — a positive
delta is growth, a negative one is decline. A period is one value
( |
Who matters most? |
|
The values of a dimension level ranked by a measure: share of the
total, cumulative share and ABC class (A — up to 80% of the total,
B — up to 95%, C — the rest), the grand total, the number of groups
and how many of them make up class A (“which stores give 80% of
profit”). |
What is the dynamic? |
|
A time series of a measure: points in chronological order, growth from the first point to the last, the average period-over-period change, a moving average and outliers (points farther from the mean than 1.5 mean absolute deviations by default). With a dimension — one series per value. |
Where is the deviation? |
|
Each value of a dimension level compared with its norm: another measure of the cube (a plan, a target) or, without one, the average across the groups. Every row carries the absolute and percentage deviation; rows beyond the threshold (15% by default) are listed separately as anomalies, largest first. |
Why did it change? |
|
A drill-down decomposition of a change between two periods. The assistant names the candidate dimensions (category, region, store, product — up to six); at each step the engine finds the dimension in which a single value explains the largest share of the change, fixes that value and drills into the remaining dimensions, two levels deep by default. The answer is the total change and the chain of drivers — “sales fell by 9 203; 92% of the drop is the Clothing category, and inside it the Men Shirt model went from 6 020 to zero” — with the top contributors in both directions at every step. When no single value explains at least 25% of the change, the tool says so explicitly and the assistant reports the change as broad-based instead of inventing a cause. |
Every operator accepts the same filters as query_cube (a region, a
category) and the same limit; all names come from describe_cube.
Nothing is computed by the model: every figure in the answer comes from
pivot queries the engine ran — the same SQL, the same cache and the same
security roles as a Pivot Table in Excel.
Working alongside Excel¶
Excel and the assistant talk to the same live engine, which makes them teammates rather than parallel worlds:
The assistant sees what you are looking at. Every Pivot Table query Excel sends is parsed by the server anyway; XLTable keeps the last parsed layout per user, and
get_pivot_contextreturns it: the cube, the dimension levels on rows and columns, the measures and the filters — in the same namesdescribe_cubeuses, plus a ready-made specification that reproduces the same slice throughquery_cube. Typical prompts: “Explain this number”, “Continue my analysis”, “Do your figures match my Pivot Table?”. If no pivot has been queried yet, the tool says so explicitly instead of failing. With several workbooks open, the most recent pivot wins; closing a workbook does not lose the context.The context belongs to the user: in the server edition each user gets only their own last pivot, and if the cube (or some of its fields) has since become unavailable to them — the cube was edited, or security roles changed — the tool returns an explicit note instead of the stale layout.
Refresh is honored across both paths. Pressing Refresh in Excel marks the user’s cached SQL results as stale — and the assistant respects the same mark: after a Refresh,
query_cubere-reads the warehouse instead of answering from a cache entry fetched before it. The assistant and the Pivot Table cannot drift apart after a refresh.The cache warms up in both directions. A slice computed for the assistant opens instantly in Excel, and vice versa (see Logging and cache).
The reverse direction is deliberately manual: XMLA is a pull protocol, so the assistant cannot push a layout into Excel — it can only tell the user which fields to drag where.
Creating cubes from the chat¶
“I have a table sales — make a cube and show me sales by month” works in a
single chat, no console needed. Two tools cover it when cubes are read from
the cube folder (CUBE_SOURCE=folder — the free edition and folder-based
servers):
list_warehouse_tableslists the tables and views of the connected warehouse, optionally narrowed by a case-insensitive substring — the same step as the table filter of the console wizard, for the “I don’t remember what the table is called” moment. Only names are exposed: no data, no raw SQL.autogen_cubetakes an exact table name from that list and runs the same autogen engine that powersXLTable.exe autogen: profile the table, classify the columns into dimensions, date hierarchies and measures, write a.sqlcube file into the cube folder. The server picks the file up immediately, so the new cube can be queried withquery_cube— and refined by hand later, like any generated cube.
Two safety rules hold on this path:
An existing cube file is never overwritten silently. It may have been edited by hand; without
overwrite=truethe call fails with an explicit message and changes nothing — the decision to replace a cube is always yours, made in the chat.autogen_cubeis also marked as a writing tool, so MCP clients such as Claude Desktop ask for confirmation before running it.The table name must match the warehouse listing exactly. The assistant can only pick tables that
list_warehouse_tablesreturned — the same boundary as everywhere else in the MCP surface: names in, SQL stays on the server.
An Excel Pivot Table that is already open keeps the previous cube metadata
until it is refreshed: after creating or overwriting a cube, press Refresh
in the Pivot Table (the assistant will remind you). New Excel connections and
query_cube see the cube immediately.
When cube definitions live in the olap_definition table
(CUBE_SOURCE=database), the creation tools are not offered — the autogen
engine writes files, and there is no cube folder to write to. The one
exception is list_warehouse_tables for cube authors with run_sql
enabled (see below): it only reads table names.
Building cubes with an assistant¶
An assistant can build a cube from a specification: study the warehouse, write the definition, check it — and hand it over. The division of labour is deliberate:
the assistant writes the definition — that is what language models do well, and the cube format is plain text;
XLTable checks it — the same parser that serves Excel reports every problem with a line number before anyone loads the cube;
a person saves and publishes it — the assistant never writes into the cubes folder or the
olap_definitiontable through MCP. Save the text as<name>.sqlyourself (or let an agent with file access to the server, such as Claude Code, do it) and the cube goes live like any other.
Two tools cover it, offered only to cube authors — users in
ANALYST_GROUPS or ADMIN_GROUPS (the same role that sees
the Cubes page; in the free edition the local user). Other
users do not see them. Both work with either cube source. The connection
instructions the assistant receives point it to the cube format page and to
the cube definition skill (workflow, tag reference and a
checked example), so it knows the format before writing a line.
check_cubeTakes the full definition text and returns
status(ok/error), the findings — severity, check id, line, section, message — and a hint for parse errors; nothing is saved. A definition whose role blocks do not include the calling user is checked as a member of its--olap_user_groupsand comes back with anotesaying so, instead of an access error. It checks parsing only: the SQL of the sources is not executed, so verify the figures withquery_cubeonce the cube is saved.run_sqlOne read-only SQL statement against the warehouse: table structure, keys, cardinality, how facts join to dimensions, control figures to verify the cube against. It is off by default and enabled in
settings.json:"MCP": { "run_sql": { "enabled": true, "schemas": ["dwh", "stage"], "max_rows": 200, "timeout": 30 } }
schemas— optional allow-list: onlySELECT/WITHstatements are accepted with it, and every table inFROM/JOINmust be qualified asschema.tablewith a listed schema (for BigQuery the dataset); omitted — any statement of the kinds below, any schema the warehouse account can read.max_rows— the cap on returned rows (default 200); the assistant may ask for fewer withlimit, never for more.truncatedtells it the result was cut.timeout— seconds per query (default 30), enforced by the warehouse connection exactly likeCREDENTIAL_DB.query_timeout.
The statement must start with
SELECT,WITH,SHOW,DESCRIBEorEXPLAIN; a second statement,SELECT … INTO, a data-modifying keyword inside the query, a backslash or an unbalanced quote is rejected before reaching the warehouse (escape a quote in a literal as''), and so are the warehouse functions that read files, the network or other databases (DuckDBread_csv/read_parquet/glob, ClickHouseurl/remote/s3/file, PostgreSQLpg_read_file/dblinkand the like). With theschemasallow-list, table functions are not accepted at all and subqueries are checked through. This guard protects against an assistant’s mistake, not against a determined user: the warehouse account inCREDENTIAL_DBmust be read-only — it is the same account the server uses for every cube query, andrun_sqlhas no separate one. Security roles of cubes do not apply here (there is no cube), which is why the tool is limited to cube authors.Every call is written to the server log (user and query); with
WRITE_LOGthe full statement is also dumped intolog/.
A typical session: “Here is the specification: sales by store, product and
month, with margin. The tables are in dwh.” The assistant lists the
warehouse tables, profiles the candidates with run_sql (row counts,
distinct keys, whether the join multiplies rows), writes the definition,
runs check_cube until no ERROR remains and returns the text with the
control figures it used. You save the file, refresh the cube in Excel or
open it on the Cubes page, and ask the assistant to compare query_cube
with its control figures.
Warning
With run_sql enabled, rows the assistant reads from the warehouse are
sent to the AI provider — the same way query results are. Use the
schemas allow-list to keep tables with personal or sensitive data out
of reach, and keep the tool disabled on servers where that is not
acceptable.
AI clients¶
MCP is an open protocol, and the XLTable server has no client-specific dependencies — pick whichever assistant you can use. In the free desktop edition every client below talks to the same local endpoint:
http://127.0.0.1:<port>/mcp
(Streamable HTTP; the port is SERVER_PORT from settings.json, 5000
by default). No authorization is required or expected: the free edition
serves one local user and ignores Authorization headers — leave credential
fields empty, and if a client insists on a value, enter anything.
Note
The walkthroughs below are written for the free desktop edition: local URL, no credentials. On the server edition the client steps are the same, but the URL is your server’s HTTPS address and every request must be authorized — take the connection details from Server edition below.
Step 4 of the Quick start page in the admin console (see Quick start page and first launch (XLTable Desktop)) offers the same choice of clients with the real port already substituted and every config ready to copy.
Note
MCP support in AI clients changes monthly. The instructions below were verified against each client’s official documentation in August 2026 — if a client’s menus have moved since, its own MCP page is the authority.
Claude Desktop: one-click extension¶
What you need: Claude Desktop for Windows, signed in with any Claude account — the free plan is enough.
Claude Desktop connects through a Desktop Extension package,
xltable.mcpb, shipped alongside the XLTable distribution
(xltable-<version>.mcpb in releases before 2.1.0).
No Node.js or manual JSON editing is required. In the free desktop edition
the file can also be downloaded right from the Connect Excel & AI page
of the admin console (Help section; step 4 of the Quick start checklist
leads there, see Quick start page and first launch (XLTable Desktop)).
Start XLTable (
XLTable.exe) and keep the window open — the extension talks to the running server.Open the
.mcpbfile with Claude Desktop: double-click it, or — if double-clicking does not offer Claude Desktop (the Microsoft Store build does not register the file type, and drag & drop does not work there either) — use Settings → Extensions → Advanced settings → Install extension… and pick the file. Then click Install.When asked for XLTable executable (XLTable.exe), pick the
XLTable.exeyou run —%LOCALAPPDATA%\Programs\XLTable\XLTable.exewhen installed with the setup wizard, or the folder you extracted the zip to. The exact path with a Copy button is shown on the Connect Excel & AI page of the admin console — paste it into the file dialog’s path bar. (The executable was namedmain.exein releases before 2.1.0; after upgrading, point the extension to the new name in Settings → Extensions → XLTable → Configure.)Ask Claude a question about your data — the XLTable tools appear automatically. A good first prompt: “What cubes do I have?”
Note
Claude Desktop installed from the Microsoft Store may fail to install
any extension with a “Private dir leaf redirects (junction/substitute-name
plant)” error — a quirk of its sandboxed file system, not of the XLTable
package. Workaround: create two folders manually and retry —
%APPDATA%\Claude\Claude Extensions and
%APPDATA%\Claude\Claude Extensions Settings. The regular Claude Desktop
installer from claude.ai/download is not
affected.
Claude Desktop launches XLTable.exe --mcp-bridge in the background: a thin
stdio bridge that forwards the MCP session to the running server at
http://127.0.0.1:<port>/mcp (the port comes from SERVER_PORT in
settings.json next to the executable). The bridge never starts the server
itself: if XLTable is not running, the assistant gets the error
“XLTable is not running — start XLTable.exe” — open XLTable.exe and ask again.
Note
Do not try Settings → Connectors → Add custom connector for the local
server: custom connectors are contacted from Anthropic’s cloud, not from
your machine, and require a public HTTPS URL — 127.0.0.1 is
unreachable that way. The .mcpb extension is the supported path.
On the server edition the same extension connects remotely: fill in the Server URL, Server user and Server password fields — see Server edition.
Claude Code¶
What you need: Claude Code installed; it works with a Claude Pro/Max subscription or Claude Console API credits.
Add the server with one command in any terminal:
claude mcp add --transport http xltable http://127.0.0.1:5000/mcp
(replace 5000 with your SERVER_PORT if you changed it). By default the
server is registered for the current project; add --scope user to have it
in every project. Verify with claude mcp list — the server should show as
connected while XLTable is running. A Claude Code session opened before
the change does not pick the server up: exit Claude Code completely and
start it again, then ask about your cubes.
On the server edition, use the server URL and add a Basic authorization header — the exact command is in Server edition.
Copilot in VS Code¶
What you need: VS Code 1.102 or newer, signed in to GitHub Copilot — the free Copilot plan works. This is the Copilot Chat pane built into VS Code: there is no separate “GitHub Copilot” application to install. On Copilot Business/Enterprise an organization administrator must enable the “MCP servers in Copilot” policy first: it is off by default, and until then MCP servers do not work for those users.
For Microsoft-centric organizations this is often the one approved AI channel.
Save this as .vscode/mcp.json in your workspace (or run the MCP: Add
Server command and pick HTTP):
{
"servers": {
"xltable": {
"type": "http",
"url": "http://127.0.0.1:5000/mcp"
}
}
}
Note the root key: VS Code uses servers, not the mcpServers most other
clients read. Then open Copilot Chat, switch it to Agent mode and trust
the server when asked — the XLTable tools appear under the tools button of
the chat.
On the server edition, point url at the server and add a headers
block with a Basic authorization header — the exact config is in
Server edition.
Local models: LM Studio and compatible hosts¶
What you need: LM Studio (free, no account needed) and a model marked for tool use in its catalog (the hammer icon) — for example Qwen3 8B or Llama 3.1 8B.
A local model is the zero-egress option: the warehouse, the cube layer and the assistant all run on your machine, and nothing — not even tool results — is sent to any cloud.
In the chat’s right sidebar open the Program tab, click Install → Edit mcp.json and add:
{ "mcpServers": { "xltable": { "url": "http://127.0.0.1:5000/mcp" } } }
Save the file — LM Studio picks it up immediately. Enable the server in the same tab and ask the model about your cubes; LM Studio asks for confirmation on each tool call.
Be honest with your expectations: small local models handle tool calling noticeably worse than cloud models — LM Studio’s own documentation warns that models not trained for tool use may emit malformed calls. XLTable’s surface is deliberately friendly to them (few tools, short schemas, clear error messages), but if answers go astray, try a larger model. Other local MCP hosts work with the same URL — for example Jan (Settings → MCP Servers, HTTP transport). Ollama has no official built-in MCP client support as of this writing.
A local model can also talk to a remote server edition: use the server URL
and add an Authorization header in the same config — see
Server edition.
Any other MCP client¶
Any client that supports the streamable HTTP transport (Cursor, Windsurf, Cherry Studio, …) connects with a config equivalent to:
{
"mcpServers": {
"xltable": {
"type": "http",
"url": "http://127.0.0.1:5000/mcp"
}
}
}
There is no official config-file standard — this mcpServers shape is a
convention most clients follow. Known deviations: VS Code uses servers
as the root key (see above), Windsurf expects serverUrl instead of
url, and some clients accept "type": "streamable-http" as an alias
of "type": "http". Keep the URL, adjust the keys. Do not add
headers in the free edition — it needs none; the server edition does
require one (see Server edition).
Clients that only speak stdio can use the built-in bridge instead:
configure the command XLTable.exe --mcp-bridge. Options: --url
overrides the endpoint address, --timeout the HTTP timeout in seconds;
--user / --password add server-edition credentials (see below).
ChatGPT, Gemini and other cloud platforms¶
ChatGPT, Gemini and the cloud AI platforms cannot connect to a local MCP
server at all: their connectors run in the vendor’s cloud and require a
public HTTPS endpoint, so http://127.0.0.1 is out of reach by design
(ChatGPT rejects plain-HTTP URLs even for localhost). This is not an XLTable
limitation to work around — it is what the server edition is for: a
centrally hosted XLTable with per-user authentication that remote clients
can reach. See the Get the server edition page in the Help section of
the admin console, or Installation for the server edition setup.
Server edition¶
In the server edition the /mcp endpoint requires authentication: either
OAuth 2.1 (the client signs the user in through the built-in
authorization server and sends a Bearer token — see OAuth 2.1 for MCP
clients below) or HTTP Basic with a user from USERS or a domain
login and password — the same accounts, session cache and
AUTH_CACHE_TIMEOUT as the Excel (XMLA) endpoint. A request without valid
credentials is answered with 401 Unauthorized and both challenges in
WWW-Authenticate (Bearer with the resource metadata URL first,
Basic second).
Everything else is enforced by the engine, exactly as on the Excel path:
Row-level security. Cube security roles are applied by user name and groups: the assistant sees the same cubes, fields and rows the user sees in Excel — nothing more.
Licensing. MCP availability is a license feature flag; named seats are counted per user, whatever interface the user comes through — the MCP connection occupies the same seat as the user’s Excel connection (one name = one seat). See MCP licensing below.
Cube catalogs. Both cube sources work: the watched folder (
CUBE_SOURCE=folder) and theolap_definitiontable (CUBE_SOURCE=database). With the database source the tools gain the optionaldatabaseargument and thelist_databasestool (see Tools).
Warning
Basic authentication sends the password with every request. Never expose
/mcp over the network by plain HTTP — publish it through an HTTPS
reverse proxy (IIS or nginx), the same pattern used for the XMLA
endpoint (see Installation). Plain HTTP is acceptable only on
127.0.0.1.
Connecting to a server:
Claude Desktop — install the same
.mcpbextension and fill in the optional fields: Server URL (https://your-server/mcp), Server user and Server password. Claude Desktop stores the password in the OS keychain and hands it to the bridge through an environment variable — it is kept out of both the config file and the process command line.stdio clients —
XLTable.exe --mcp-bridge --url https://your-server/mcp --user <name> --password <password>; the password can also be supplied via theXLTABLE_MCP_PASSWORDenvironment variable instead of the command line.Claude Code — the same one-line registration as in AI clients, with the server URL and a Basic header:
claude mcp add --transport http xltable https://your-server/mcp --header "Authorization: Basic <base64 of user:password>"
Copilot in VS Code and other JSON-config clients — the same config as in AI clients, with the server URL and a
headersblock (the root key isserversin VS Code,mcpServerselsewhere):{ "servers": { "xltable": { "type": "http", "url": "https://your-server/mcp", "headers": { "Authorization": "Basic <base64 of user:password>" } } } }
HTTP clients (server platforms, MCP Inspector, …) — send a standard
Authorization: Basicheader with each request tohttps://your-server/mcp. The<base64 of user:password>value above is the standard Basic scheme:echo -n 'user:password' | base64on Linux/macOS, or in PowerShell[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('user:password')).Platforms whose authorization field only accepts Bearer tokens (e.g. Yandex AI Studio) — pass the same credentials packed as a token:
Authorization: Bearer <base64 of user:password>. This is the same account checked by the same code — only the header format differs.
The same cubes are also available over plain HTTP without an MCP client — see REST API.
One service account, many users: X-Effective-User¶
Server-side agent platforms (LibreChat, Numira and similar) usually keep
one MCP configuration per workspace: every user of the chat reaches
XLTable with the same credentials, so cube roles and row-level security
would apply to that one account, not to the person asking. Since 2.1.3
XLTable supports the pattern Analysis Services calls EffectiveUserName:
the platform connects with a service account and names the actual user
in the X-Effective-User header of every request. XLTable then applies
the roles, access filters and pivot context of that user, and the user —
not the service account — occupies the named seat.
Setup:
Create the service account: a user in
USERS(no groups needed) or a domain account.Allow it to impersonate: list its name in
IMPERSONATION_USERS:"IMPERSONATION_USERS": ["svc_chat"]
In the platform, authenticate the MCP server with the service account’s login and password (Basic or the packed Bearer form) and add the header with the platform’s user placeholder. LibreChat:
headers: X-Effective-User: "{{LIBRECHAT_USER_USERNAME}}"
Numira supports the same header. Yandex AI Studio has no per-user placeholders (one static Bearer per workspace), so per-user access is not available there.
The effective user is a regular XLTable user: a name from USERS
(groups from USER_GROUPS) or a domain user, whose groups are
read from Active Directory with the server’s service credentials
(CREDENTIAL_ACTIVE_DIRECTORY) and checked against
access_groups — no password is involved, the trust comes from the
service account. DOMAIN\user and user@domain are accepted.
The header is strict by design. A request that carries it from an account
not listed in IMPERSONATION_USERS is rejected with 403
rather than silently served as the service account — otherwise a
misconfigured platform would quietly show every user the service
account’s data. An empty header (an unresolved placeholder), an unknown
user or a user without access are 403 as well. Without the header the
service account works as itself. An OAuth access token never grants the
right, even when it belongs to a listed service account: a token is held by
a third-party application that was approved to access cubes as that
account, not as everyone — so platforms that sign each user in through
OAuth (OAuth 2.1 for MCP clients) do not need the header at all, the token already
carries the person.
The header applies to /mcp and to the REST API data
endpoints; it is not read on the Excel (XMLA) path. The free desktop
edition has a single anonymous user and no accounts, so the header is
ignored there.
OAuth 2.1 for MCP clients¶
Since 2.1.1 the server edition is its own OAuth 2.1 authorization server, so an AI application that speaks standard MCP authorization (FastMCP-based clients, Claude, Cursor and other hosts that support “connect with sign-in”) needs no stored password at all: the user signs in once in the browser, the application receives a token and refreshes it silently.
What the application sees is plain OAuth 2.1 as required by the MCP
specification: protected-resource metadata at
/.well-known/oauth-protected-resource/mcp, authorization-server metadata
at /.well-known/oauth-authorization-server, dynamic client registration
(/oauth/register), the authorization-code grant with PKCE (S256 only) at
/oauth/authorize and /oauth/token, refresh tokens with rotation, and
/oauth/revoke. Access tokens live one hour, refresh tokens 30 days
(OAUTH); every request to /mcp carries
Authorization: Bearer <access token>. Tokens are bound to this server
(RFC 8707 resource) and stored only as hashes. The resource an
application sends may be the advertised https://<server>/mcp or just the
server’s base URL https://<server> (its OAuth issuer — some clients send
that); both are bound to the /mcp endpoint, any other host or path is
rejected.
What the user sees. The application opens /oauth/authorize in the
browser — the XLTable sign-in page:
behind an authenticating front — IIS with Windows Authentication, or the Apache front in the
--auth admode (Single sign-on on Linux: an authenticating front) — the page signs the user in silently by Kerberos: a domain user on a domain-joined machine lands straight on the consent screen (Chrome/Edge need theAuthServerAllowlistpolicy, as for the admin console). There is no password form in this mode: all domain passwords are checked by the front, never by XLTable, so signing in to MCP requires a domain-joined computer — on any other machine the page says so. No browser sign-in dialogs and no NTLM are involved. Excel is not affected by this rule: it can still connect from outside the domain with a domain login and password;without such a front (
--auth app, no domain) the page asks for a login and password: a user fromUSERSor, withCREDENTIAL_ACTIVE_DIRECTORY, a domain account checked by LDAP.
Then a one-click consent screen names the application; the answer is
remembered for 90 days per user and application. Access rights and cube
roles are the user’s own (groups from AD or USER_GROUPS), re-checked at
least every AUTH_CACHE_TIMEOUT — removing a user from the access
group cuts the token off within that time; an administrator can revoke
tokens immediately on the Sign-ins page of the admin console (it lists
the tokens of AI applications and of the web application alike).
Fronts. The OAuth paths must reach the application without the front’s
own authentication — MCP clients even probe /oauth/authorize without
credentials before opening the browser, so a 401 from the front breaks
them. The Ubuntu installer configures this itself (re-run
install_xltable.sh --front-only on an existing Apache front), and the
web.config shipped with the Windows distribution opens /mcp,
/oauth/authorize, /oauth/continue, /oauth/token,
/oauth/register, /oauth/revoke, /.well-known and — for the
styles and logo of the sign-in pages — /static and /favicon.ico for
anonymous access. The one OAuth path that stays under Kerberos / Windows
Authentication is /oauth/sso, which the sign-in page probes silently
(Kerberos only, no Basic — so a browser without a ticket gets a plain
401 and no dialog). See Windows Server (IIS) and Single sign-on on Linux: an authenticating front.
The legacy nginx front needs no change.
Warning
OAuth 2.1 requires HTTPS: the token endpoints refuse plain http://
(except from localhost), and client registration accepts only
https:// redirect URIs (or http://localhost).
"allow_insecure_http": true in OAUTH lifts both for a
pilot — the endpoints are served over plain HTTP and an application on a
plain-HTTP address in the LAN (for example LibreChat at
http://chat.company.local) can register its callback — the sign-in
password and the tokens then travel in the clear. With Active Directory
configured REQUIRE_HTTPS applies (it is on by default) and the
flag is ignored unless REQUIRE_HTTPS is explicitly false.
Checklist for an integrator (e.g. a web application on FastMCP):
Point the client at
https://your-server/mcp— nothing else to configure; discovery, registration and PKCE are standard.The client registers with its own
redirect_uri(https://…orhttp://localhost…); a confidential client may requesttoken_endpoint_auth_method: client_secret_post.One application user = one XLTable (domain) user: the token carries the person who signed in, and the data is filtered by that person’s roles.
Handle
401withWWW-Authenticate: Bearer error="invalid_token"by refreshing or re-signing in; the oldBasicand packed-Bearer methods keep working for scripts.The same access token is accepted by the REST API data endpoints (
/api/cubes,/api/query) — a web application can sign the user in once and use both.
MCP licensing¶
In the server edition MCP availability is controlled by the boolean mcp
field of the license — a feature flag, not a separate seat count:
License without the flag (or with ``false``). MCP is disabled: every request to
/mcp— even with valid credentials — is answered with a clear JSON-RPC error “MCP is not included in your license”. Excel/XMLA access is not affected in any way. If your license predates MCP support, contact the vendor for an updated license file and upload it on the License page of the admin panel.License with ``”mcp”: true``. Every licensed user may use MCP.
One seat pool, counted per user. Named seats are not counted per interface: a user occupies one seat whether they connect from Excel, from an AI assistant via MCP, or both — one name = one seat. The seat is assigned by the first data query, exactly as on the Excel path, and is shown and released in the usual Named user seats section of the admin panel. Connecting an assistant does not consume an extra seat.
The free edition has no license at all, and MCP works there without any of the above — this section applies to the server edition only.
Logging and cache¶
For an administrator the MCP path behaves exactly like the Excel (XMLA) path — same debug output, same log artifacts, same caches:
Console. With
WRITE_LOGenabled, everyquery_cubecall prints the familiar debug blocks to the server console:REQUEST(catalog and cube),PIVOT SPEC(the pivot specification sent by the assistant — the MCP counterpart of theMDXblock),CONTEXT,SQLandRESULT.Log files. With
WRITE_LOGenabled, each MCP request leaves the same artifacts in thelogfolder as an XMLA request: a request/response pair named<timestamp>_req_<user>_<id>.txt/..._res_<user>_<id>.txt(the body is the JSON-RPC message instead of XML) plus the generated SQL and the Jinja context dump. A failed SQL query writes anerror_sqldump regardless ofWRITE_LOG, as on the Excel path. MCP request/response dumps are also written whenDUMP_XMLAis enabled, so protocol dumps cover both paths.Shared SQL cache. MCP queries go through the same SQL result cache as Excel, keyed by the generated SQL text — a slice computed for the assistant opens instantly in Excel and vice versa (for example, the query that fills an Excel filter drop-down and a
query_cubecall for the same dimension level share one cache entry).Metadata cache. Cube definitions are cached with the same
METADATA_CACHE_TTLpolicy as on the Excel path; with the watched-folder cube source the cache is bypassed, so an edited.sqlcube is visible to the assistant immediately (hot reload).
Privacy¶
The connection and the server stay on your machine, and the warehouse
credentials never leave settings.json. Keep in mind, however, that tool
results (cube names, schemas and query results) are sent to the AI assistant
and processed by its cloud model. With run_sql enabled for cube authors,
rows read from the warehouse are sent the same way — see Building cubes with an assistant.