mcp-bw-modelling-api
This server lets AI assistants explore and query SAP BW/4HANA metadata and data through MCP tools.
Test connectivity:
check_connectionverifies access to the BW system.Search objects:
search_bw_objectsfinds BW objects by name/type;search_abap_objectssearches ABAP repository objects.List metadata: InfoAreas, InfoObjects, ADSOs, CompositeProviders, Queries, and InfoArea contents/trees.
Get object details: Full metadata for BW objects, InfoObject properties, ADSO fields, CompositeProvider parts, transformation and DTP details.
Inspect queries: Structure (characteristics, key figures, measures), filters (fixed/default/variable-driven), and restricted key figures.
Read query data:
read_query_dataruns a query's default view;read_query_data_drilldownadds drilldown, filters, and variable overrides.Analyze data flow:
get_data_flowshows transformations, DTPs, lineage, source/target, status, and process chains.Read ABAP source:
get_abap_sourcereads programs, classes, methods, function modules, CDS views, tables, etc.Read master data:
get_characteristic_valueslists actual characteristic values, optionally restricted by InfoProvider.
Provides tools for exploring and querying SAP BW4/HANA modeling metadata, including InfoAreas, InfoObjects, ADSOs, CompositeProviders, and Queries.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-bw-modelling-api What InfoAreas are defined in the system?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server - SAP BW Modeling API
An MCP (Model Context Protocol) server that exposes SAP BW4/HANA modeling objects as tools via FastMCP. Allows AI assistants to explore and query your BW system's metadata: InfoAreas, InfoObjects, ADSOs, CompositeProviders, Queries, and more.
Compatibility
This server has only been tested against SAP BW/4HANA, and it relies on the
BW Modeling API (the /sap/bw/modeling/ ADT-based endpoints).
It does not work on classic BW 7.5 on AnyDB (non-HANA). Testing on a
BW 7.5 AnyDB system showed the /sap/bw/modeling/ endpoints are not available
there, so the tools fail to retrieve anything. The BW Modeling API is a
BW/4HANA (and BW-on-HANA modeling) capability and is not exposed on classic
AnyDB installations. Use this server only against BW/4HANA.
Related MCP server: SAP S/4HANA MCP Server
Prerequisites
Python 3.10+
A SAP BW/4HANA system with the BW Modeling API enabled (
/sap/bw/modeling/). Classic BW 7.5 on AnyDB is not supported (see Compatibility).A SAP user with appropriate authorizations for the Modeling API
Installation
Using a virtual environment is strongly recommended. It isolates this
server's dependencies (notably fastmcp and its pinned pydantic) from your
system-wide Python, so a later global package upgrade can't silently break the
server. Mismatched fastmcp/pydantic versions are a common cause of the
server failing to start.
Create and activate a venv, then install the dependencies into it:
# Create the virtual environment (once)
python -m venv .venv
# Activate it
# Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
# macOS/Linux:
source .venv/bin/activate
# Install dependencies into the venv
pip install -r requirements.txtWhen configuring the MCP client, point command at the venv's Python
interpreter so the server always runs with the isolated dependencies — for
example .venv/Scripts/python.exe on Windows or .venv/bin/python on
macOS/Linux (see MCP Client Configuration).
Without a venv, install globally instead:
pip install -r requirements.txtConfiguration
The server is configured via environment variables:
Variable | Required | Description | Default |
| Yes | Base URL of the BW system (e.g. | — |
| Yes | SAP username | — |
| Yes | SAP password | — |
| No | SAP client number |
|
| No | Verify SSL certificates ( |
|
Running the Server
Standalone (stdio transport)
python server.pyWith FastMCP CLI
fastmcp run server.py:mcpHTTP transport
fastmcp run server.py:mcp --transport http --port 8000MCP Client Configuration
Add this to your MCP client config (e.g. .kiro/settings/mcp.json). If you set
up a virtual environment (recommended), set command to the venv's Python
interpreter rather than a bare python, so the server runs with the isolated
dependencies:
{
"mcpServers": {
"bw-modeling": {
"command": "path/to/.venv/Scripts/python.exe",
"args": ["path/to/server.py"],
"env": {
"BW_BASE_URL": "https://your-bw-system.example.com",
"BW_USERNAME": "your_user",
"BW_PASSWORD": "your_password",
"BW_CLIENT": "100"
}
}
}
}Available Tools
Tool | Description |
| Test connectivity to the BW system |
| Search for any BW object by name/type |
| List all InfoAreas (organizational folders) |
| List InfoObjects (characteristics, key figures) |
| List Advanced DataStore Objects |
| List CompositeProviders (HCPR) |
| List BEx/BW Queries |
| Get full metadata for any BW object |
| Get InfoObject properties, incl. navigational vs display attributes and compounding |
| Read the actual master-data values of a characteristic (e.g. list 0CUSTOMER/0MATERIAL values), optionally restricted to an InfoProvider |
| Get field list of an ADSO |
| Get the source (part) providers and join conditions of a CompositeProvider; optionally the node tree (joins, projection filters, calculated fields), per-provider field assignments (source field -> CompositeProvider field) and output-field lineage |
| List objects in an InfoArea (flat search) |
| List objects under an InfoArea via the InfoProvider structure (recursive, reliable) |
| Get transformation metadata (source, target, rules) |
| Get a Data Transfer Process's source/target, settings, and (uniquely) its filter restrictions |
| List a query's characteristics, key figures, and measures (restricted + calculated) |
| Read a query's filters (fixed/default) and restricted key figures |
| Execute a query and return its result data (default view only) - see Reading Query Result Data |
| Execute a query with an ad-hoc drilldown, an ad-hoc filter, and/or a mandatory-variable screen submitted automatically - see Reading Query Result Data |
| Show lineage: inbound/outbound transformations and DTPs (with source/target, status, and process chains) |
| Search the ABAP repository (via ADT) for programs, classes, interfaces, function modules, CDS views, tables, packages by name (read-only) |
| Read the ABAP source of a program, include, class (optionally one method, or its local includes), interface, function module, CDS view or table (read-only; e.g. a transformation's generated AMDP class) |
Reading Query Result Data
Two tools execute a query and return its actual figures, not just its
design. They trade off reliability against capability, so try
read_query_data first and only reach for read_query_data_drilldown when
you hit one of its limitations:
read_query_dataruns the query via the BW reporting (BICS) runtime - a single, stable API call. It returns exactly the query's saved default view: default variable values, default drilldown. If the query has a mandatory variable, this call returns no data (just the variable list) - it cannot submit one.read_query_data_drilldownexists to cover that gap and to add an ad-hoc characteristic to the drilldown that the query's default view doesn't show, restrict the result to specific characteristic values before execution (e.g. one customer, or a short list of fiscal periods) via itsfiltersparameter, and/or override one of the query's own variables viavariable_values(e.g. submit a specific date instead of a "current date" SAP-exit default). It does so via InA (Information Access), the internal HTTP API behind BW/4HANA's own "Data Preview" Fiori app (/sap/bw/ina/GetResponse) - reverse-engineered from that app's client-side source, since SAP does not publicly document it. It performs a 3-call handshake (fetch metadata, submit variables at their default value or the givenvariable_valuesoverride, request the result grid) and echoes back the query's design-time filters, plus any ad-hocfilters, so the server doesn't aggregate more than the caller actually needs. Bothfiltersandvariable_valuesare equality/ IN-list only (no ranges or exclusions);filterscan only target a characteristic already part of the query's design, same as the drilldown. Note that a characteristic can be restricted by both a query variable and an ad-hoc filter at once (they combine with AND) - if a variable's default is narrower than the filter you want, usevariable_valuesto change the variable itself instead offilters(seeget_query_filtersfor which characteristics are variable-driven).
Because it rides on an undocumented, unversioned protocol rather than the
BW Modeling API, read_query_data_drilldown is inherently less
future-proof: SAP could change /sap/bw/ina/* without notice. Use it when
you need what it uniquely offers, but don't treat it as a drop-in
replacement for read_query_data.
Supported Object Types
Code | Object Type |
| InfoArea |
| InfoObject |
| DataStore Object (advanced) |
| CompositeProvider |
| Query |
| Transformation |
| Data Transfer Process |
| MultiProvider |
| DataStore Object (classic) |
Available Tools
15 toolscheck_connectionA
Test the connection to the BW system.
Returns: Connection status with system info or error details.
Inputs: no named parameters. Returns: object
get_adso_fieldsB
Get the field list (InfoObjects) of an Advanced DataStore Object.
Inputs: object_name (required). Returns: result
get_composite_provider_partsB
Get the part providers (data sources) of a CompositeProvider.
Inputs: object_name (required). Returns: result
get_infoarea_contentsC
List all objects within a specific InfoArea.
Inputs: info_area (required), max_results. Returns: result
get_infoobject_detailsC
Get detailed properties of an InfoObject (characteristic or key figure).
Inputs: infoobject_name (required). Returns: object
get_object_detailsB
Get detailed metadata for a specific BW object.
Inputs: object_name (required), object_type (required). Returns: object
get_query_filtersA
Read the filter restrictions defined on a BW Query.
Retrieves the query model from the BW Modeling API and extracts the global query filter: for each restricted characteristic it returns the fixed value ranges and/or the variable references that restrict it.
Each filter is labelled with its BEx filter type (from usageType):
"Fixed Filter" (asFilter): a hard restriction the user cannot change at runtime (e.g. 0FISCVARNT = V5).
"Default Value" (asStartValue): a pre-filled default the user can override at runtime (e.g. 0CUST_GROUP = 05, 13, ...).
"Fixed Filter + Default Value" (asStartValueAndFilter): used as both.
Inputs: query_name (required), object_version. Returns: object
get_query_structureC
List the characteristics and key figures used in a BW Query.
Inputs: query_name (required), object_version. Returns: object
get_transformation_detailsB
Get detailed metadata for a transformation including source, target, and rule information.
Inputs: transformation_id (required). Returns: object
list_adsosC
List Advanced DataStore Objects (ADSOs) in the BW system.
ADSOs are the primary data storage objects in BW4/HANA.
Inputs: info_area, max_results, search_term. Returns: result
list_composite_providersA
List CompositeProviders (HCPRs) in the BW system.
CompositeProviders combine multiple data sources (ADSOs, InfoObjects, Open ODS Views) for reporting via union or join.
Inputs: info_area, max_results, search_term. Returns: result
list_infoareasA
List all InfoAreas in the BW system.
InfoAreas are organizational folders used to group BW objects.
Inputs: max_results. Returns: result
list_infoobjectsB
List InfoObjects in the BW system.
InfoObjects are the smallest units of information in BW (characteristics, key figures, time characteristics, units).
Inputs: info_area, max_results, search_term. Returns: result
list_queriesC
List BEx/BW Queries in the system.
Queries are reporting definitions built on top of CompositeProviders or ADSOs.
Inputs: info_area, max_results, search_term, info_provider. Returns: result
search_bw_objectsC
Search for BW modeling objects by name or description.
Inputs: max_results, object_type, search_term. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Tools are mostly distinct by object type (list_* for different resources), but some overlap exists: get_object_details is generic and could conflict with get_infoobject_details, and get_infoarea_contents overlaps with list_* for hierarchical access. Descriptions clarify usage, but a few boundaries are fuzzy.
All tools follow a consistent verb_noun pattern using snake_case (search_, list_, get_, check_). The pattern is uniform across the entire set, with predictable verb choices and plural nouns for list operations.
15 tools is well-scoped for a BW modeling API. Each tool serves a distinct functional need (listing, details, specific operations), and the count feels neither sparse nor overwhelming for the domain.
The API covers read-only exploration of major BW objects (InfoAreas, InfoObjects, ADSOs, CompositeProviders, Queries), but lacks listing for transformations (only get_transformation_details) and no list for Open ODS Views. There are no write operations, which may be intentional, but the missing listing for some object types creates notable gaps.
Related MCP Connectors
List datasets, schemas, run APL queries, and use prompts for exploration, anomalies, and monitoring.
Governed BI MCP. Ask questions of live company data and list workspace sources via OAuth.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables AI assistants to read, create, and modify SAP BW/4HANA modeling objects via the internal REST API, including aDSOs, InfoObjects, transformations, DTPs, queries, and more.21545 npm81MIT
- FlicenseAqualityDmaintenanceEnables interaction with SAP S/4HANA systems via OData, allowing service discovery, metadata exploration, field value retrieval, and CRUD operations through natural language.45-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with SAP Datasphere for data exploration, querying, and administration via 49 tools.1-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that enables AI assistants like Claude to work directly inside SAP BW/4HANA systems — reading, creating and modifying BW modeling objects via the internal REST API used by Eclipse BWMT.545 npmMIT