Skip to main content
Glama
SAP BusinessObjects MCP Server

SAP BusinessObjects MCP Server

by alexraio

SAP BusinessObjects MCP Server (bo-mcp)

FastMCP MCP Python Package Manager License CI SAP BO

A Model Context Protocol (MCP) server that exposes SAP BusinessObjects BI Platform 4.3 SP5 administration, semantic analysis, and Web Intelligence inspection capabilities to AI coding assistants and autonomous agents. Built using FastMCP 2.0 and the SAP BI Platform REST Web Services (biprws and raylight), this server enables AI agents (such as Google Antigravity IDE, Antigravity CLI agy, Claude Desktop, and Cursor) to execute 48 specialized enterprise tools directly from natural language prompts.


Table of Contents


Related MCP server: bw-modeling-mcp

Key Features

  • Enterprise Authentication & Zero-Plaintext Security: Interactive CLI credential intake with masked input (getpass), OS Keyring integration (macOS Keychain, Windows Credential Manager, Linux SecretService), and automatic account discovery. Eliminates plaintext passwords in .env files or LLM chat transcripts.

  • Session Isolation & Native SAP BO Security Rights: Manages independent client sessions with dedicated BOEClient instances and X-SAP-LogonToken tokens, strictly preserving individual SAP BO user permissions, folder access, and universe row-level security.

  • Web Intelligence Execution & Data Extraction: Retrieve prompts, query Allowed Values (LOV), answer prompts, trigger live document refresh, and extract tabular cell data from table and chart blocks without generating bloated binary files.

  • Data Provider SQL Inspection: Extract the raw SQL query generated by the Semantic Layer for any Data Provider in a report.

  • Central Management Server (CMS) SQL Engine: Execute arbitrary CMS SQL queries against CI_INFOOBJECTS, CI_APPOBJECTS, and CI_SYSTEMOBJECTS for deep platform introspection.

  • User & Security Administration: List user accounts, inspect profile details, enable/disable accounts, list user groups, inspect group memberships, monitor active sessions, and terminate connections.

  • Semantic Layer & Universe Lineage: Query UNX and UNV universes, inspect business classes/dimensions/measures, and map reports referencing each universe.

  • Schedule & Instance Diagnostics: View scheduled execution rules, inspect instance history (Success, Failed, Running), and diagnose error messages of failed jobs.

  • Intelligent Diagnostics & Batch Health Monitoring: Scan, cluster, and diagnose failed nocturnal batch executions (SI_SCHEDULE_STATUS = 3) for Web Intelligence reports and Publications (bursting). Normalizes error signatures and delivers Pydantic v2 structured reports with up to 3 ranked probable causes and actionable administrator remediation steps.

  • Repository Hierarchy Traversal: Recursively traverse CMS folder trees and corporate categories.

  • Modular & Web-Ready: Architecture decoupled into standalone domain services (services/), ready for native integration into a future FastAPI or Flask web application.


Tech Stack

Layer

Component

Version / Description

Runtime

Python

>= 3.13 (Modern Python 3.13+ typing, dataclasses, pattern matching)

Package Management

Astral uv

Fast virtual environment & dependency management via pyproject.toml

MCP Framework

fastmcp

2.13.1 (FastMCP 2.0 Generation 2, 48 registered tools)

MCP Specification

mcp

1.22.0 (Standard Model Context Protocol)

HTTP Engine

requests

2.32.5 persistent HTTP keep-alive session with custom timeout

Security & Secrets

keyring

25.7.0 (Native OS Keychain / Credential Manager integration)

Platform Paths

platformdirs

4.5.0 (Standard OS user config & cache directories)

Data Validation

pydantic

2.12.5 (Strict schema validation and structured diagnostic models)

Configuration

python-dotenv

1.2.1 for loading .env configuration relative to script location

Target Platform

SAP BusinessObjects BI

BI 4.3 SP5 (Support Package 5) REST Web Services (biprws and raylight)


Prerequisites

  1. Python 3.13+: Verified with Python 3.13.0+.

  2. uv Package Manager (recommended) or standard pip + python3 -m venv.

    • Install uv on macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh

    • Or via Homebrew: brew install uv

  3. Network Access to SAP BusinessObjects 4.3 SP5:

    • Access to your SAP BI Platform REST Web Services URL (typically http://<host>:<port>/biprws).

    • A valid SAP BusinessObjects user account (e.g. Enterprise, LDAP, or WinAD) with rights to query the CMS and access Web Intelligence documents.


Getting Started

1. Clone or Open the Repository

git clone https://github.com/your-username/BO_MCP.git
cd BO_MCP

2. Authentication Configuration

The MCP server supports two credential methods, resolved by priority:

Store credentials directly in your operating system's native encrypted keychain (macOS Keychain, Windows Credential Manager, or Linux SecretService). Passwords are never written to disk in plaintext or logged.

  1. Run the interactive configuration wizard:

    python server.py configure

    (Prompts for API URL, Username, and Password with masked input via getpass)

  2. Manage or test stored credentials:

    python server.py status    # Check active resolved credentials
    python server.py test      # Test stored credentials against the live SAP BO server
    python server.py clear     # Remove credentials from the OS Keyring
  3. Manual OS Keyring Configuration (No Python/CLI required): You or your IT administrator can also add the credential directly in the OS GUI:

    • macOS (Keychain Access): Add a new generic password item with service sap-business-objects-mcp, your SAP username, and password.

    • Windows (Credential Manager): Under Windows Credentials -> Add a generic credential, specify Internet or network address sap-business-objects-mcp, your username, and password.

    • Linux (Seahorse / SecretService): Add an item under default keyring with service sap-business-objects-mcp.

  4. OS Keyring Account Auto-Discovery: If credentials are saved in the OS Keyring, you do not need to store your username in configuration files. If SAP_BO_USERNAME is omitted from .env or client configuration, the server automatically discovers the active account name directly from the OS Keyring. You only need to define SAP_BO_REST_API_URL.

Option B (Development / Testing): Local .env File

For local development or automated CI/CD pipelines, you can provide credentials via .env:

cp .env.example .env
# SAP BusinessObjects REST API Configuration (BI 4.3 SP5)
SAP_BO_REST_API_URL="http://your-bo-host:8080/biprws"

# Authentication Credentials (Priority 1 if defined)
SAP_BO_USERNAME="Administrator"
SAP_BO_PASSWORD="YourPasswordHere"
IMPORTANT
  • Resolution Priority: If .env contains credentials, they take precedence (Priority 1). If .env is absent or incomplete, the server automatically reads from the secure OS Keyring (Priority 2).

  • If no credentials exist anywhere, the server starts cleanly without crashing and guides the user via tool response messages to run python server.py configure.

3. Install Dependencies

Using uv (recommended):

uv sync

Alternatively, using standard pip:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

4. Verify MCP Server Installation

Run FastMCP inspection to verify that all 48 tools are registered:

uv run fastmcp inspect server.py

Expected output:

Server
  Name:         SAP Business Objects
  Version:      2.13.1
  Generation:   2

Components
  Tools:        48
  Prompts:      0
  Resources:    0
  Templates:    0

Environment
  FastMCP:      2.13.1
  MCP:          1.22.0

Architecture & Deep Dive

Modular Domain Services Architecture

The codebase follows a clean, domain-driven service architecture. Business logic is separated into independent services, making each module testable in isolation and ready to be imported into a future Web API (e.g., FastAPI) without modifying FastMCP.

BO_MCP/
├── core/
│   ├── auth/                  # Enterprise credential resolution (Keyring, Env, CLI, Auto-discovery)
│   │   ├── __init__.py
│   │   ├── cli.py             # Masked getpass setup wizard (configure, status, test, clear)
│   │   ├── models.py          # AuthCredentials with Pydantic SecretStr protection
│   │   └── providers.py       # ChainedCredentialProvider, Env, Keyring with auto-discovery
│   ├── session.py             # SessionManager & UserSession for multi-user/client isolation
│   ├── client.py              # BOEClient: HTTP keep-alive session, token lifecycle, error handling
│   ├── exceptions.py          # Custom domain exceptions (BOEAuthError, BOEProcessingError, etc.)
│   └── models.py              # Pydantic v2 schemas: BatchDiagnosticsReport, ClusterDiagnosis, etc.
├── wiki/                      # Self-contained LLM-Wiki (Karpathy + Google OKF specification)
│   ├── index.md               # Global OKF catalog & progressive disclosure entry point
│   ├── log.md                 # Chronological append-only operation log
│   ├── raw/                   # Immutable primary sources & original design RFCs
│   ├── architecture/          # System design, Enterprise Auth, Sessions & Diagnostics specs
│   ├── sap_bo/                # SAP BO 4.3 SP5 domain rules (CMS SQL, IDT vs CMC, Raylight)
│   ├── tools/                 # Complete MCP tool catalogs & Tier 1/Tier 2 safety matrices
│   └── troubleshooting/       # Error code triage runbooks (IES 10901, WIS 30553, ORA-01017)
├── services/
│   ├── __init__.py
│   ├── admin_service.py       # CMS Admin: generic SQL queries, users, groups, active sessions
│   ├── diagnostic_service.py  # Intelligent Diagnostics: error clustering, multi-cause ranking, RCA
│   ├── infostore_service.py   # InfoStore: recursive folder traversal, categories, Webi lists
│   ├── schedule_service.py    # Schedules: recurring jobs, instance history, failure diagnostics
│   ├── universe_service.py    # Universes: UNX/UNV, semantic hierarchy (/sl/v1), lineage
│   └── webi_service.py        # Web Intelligence: prompts, LOVs, refresh, tables, formulas, SQL
├── server.py                  # FastMCP server exposing 48 typed MCP tools + Auth CLI subcommands
├── sdk_parser_new.py          # Unified Facade ensuring 100% backward compatibility
├── .agents/
│   └── mcp_config.json        # Workspace configuration for Antigravity IDE
├── .env                       # Local environment secrets (excluded from git)
├── .env.example               # Clean configuration template
└── README.md

System Flow Diagram

+-------------------------------------------------------------+
|                     AI Agent Surface                        |
|   (Antigravity IDE / Antigravity CLI "agy" / Claude Desktop)|
+------------------------------+------------------------------+
                               |
                   JSON-RPC over STDIO
                               |
                               v
+-------------------------------------------------------------+
|                    FastMCP Server (server.py)               |
|  - Exposes 48 MCP Tools with docstrings & typed schemas     |
|  - Subcommands: configure, status, test, clear              |
+------------------------------+------------------------------+
                               |
              SessionManager (core/session.py)
              Resolves credentials via ChainedCredentialProvider
              (Priority 1: .env -> Priority 2: OS Keyring)
                               |
                               v
+-------------------------------------------------------------+
|               Domain Services Layer (services/)             |
|  ├── DiagnosticService  (Batch RCA, Error Clustering, Models)|
|  ├── WebiService        (Prompts, Refresh, Blocks, SQL)     |
|  ├── UniverseService    (Semantic Tree, Lineage, UNX/UNV)   |
|  ├── ScheduleService    (Instances, Diagnostics, Jobs)      |
|  ├── AdminService       (CMS SQL Query, Users, Groups)      |
|  └── InfostoreService   (Folders, Categories)               |
+------------------------------+------------------------------+
                               |
                   BOEClient (core/client.py)
                   - Isolated per UserSession
                   - requests.Session() keep-alive
                   - X-SAP-LogonToken lifecycle
                   - Configurable timeouts (default 120s)
                               |
                               v
+-------------------------------------------------------------+
|            SAP BusinessObjects Enterprise (biprws)          |
|  ├── /biprws/logon/long       (Authentication)              |
|  ├── /biprws/raylight/v1      (Web Intelligence API)        |
|  ├── /biprws/sl/v1            (Semantic Layer API)          |
|  ├── /biprws/infostore        (InfoStore Hierarchy API)     |
|  └── /biprws/v1/cmsquery      (Central Management Server)   |
+-------------------------------------------------------------+

Available MCP Tools Reference (48 Tools)

1. Authentication (2 Tools)

Tool

Parameters

Description

login

username?, password?

Authenticates against SAP BO, acquiring the X-SAP-LogonToken. Falls back to .env if omitted.

logout

none

Closes the active session on the BI platform and invalidates the session token.

2. Universes & Semantic Layer (5 Tools)

Tool

Parameters

Description

get_universes

none

Lists all published UNX and UNV universes (ID, name, folder ID).

get_universe_details

universe_id

Retrieves universe type (unx/unv), name, and CUID.

get_universe_structure

universe_id

Traverses the full business layer tree (classes, dimensions, measures, attributes, hierarchies).

get_universe_related_reports

universe_id

Queries the CMS to find all Webi reports referencing the universe (SI_SL_DOCUMENTS / SI_WEBI).

get_universe_connection_id

universe_id

Retrieves the Data Connection ID associated with the universe.

3. Web Intelligence Documents & Lifecycle (6 Tools)

Tool

Parameters

Description

get_documents

page=1, pagesize=50

Retrieves a paginated list of Webi documents from the repository.

get_doc_details

webi_doc_id

Retrieves report metadata: name, folder path, CUID, scheduled status, and state.

get_doc_properties

webi_doc_id

Retrieves document configuration properties (refreshOnOpen, autoRefresh, etc.).

save_webi_doc

webi_doc_id, webi_doc_name

Saves/overwrites a Webi document while preserving user comments.

delete_webi_doc

webi_doc_id

Permanently deletes a Webi document from the CMS repository.

export_webi_doc

webi_doc_id, export_format='pdf', report_id?, output_path?, refresh=False

Exports a Webi document or report tab to PDF, Excel (.xlsx), or CSV with optional in-session refresh.

4. Webi Prompts, Parameters & Refresh (3 Tools)

Tool

Parameters

Description

get_doc_parameters

webi_doc_id

Lists all prompt parameters (ID, prompt question, technical name, data type, optional/mandatory flag).

get_parameter_lov

webi_doc_id, parameter_id

Retrieves the List of Values (LOV) allowed for a constrained prompt parameter.

refresh_webi_doc

webi_doc_id, parameters?

Injects prompt answers and triggers report calculation in the active session.

5. Webi Tabs, Blocks & Tabular Data (5 Tools)

Tool

Parameters

Description

get_reports

webi_doc_id

Lists all sheets/tabs in a Webi document (returns report IDs and tab names).

get_report_elements

webi_doc_id, report_id

Lists all visual elements (tables, charts, sections) inside a report tab.

get_report_element_data

webi_doc_id, report_id, element_id, max_rows=1000

Extracts structured tabular data rows from a table block up to max_rows.

get_variables

webi_doc_id

Retrieves all calculated variables and custom formulas defined in a document.

get_comments

webi_doc_id

Retrieves collaborative user comments and cell annotations.

6. Data Providers, SQL & Change Data Source (8 Tools)

Tool

Parameters

Description

get_dp

webi_doc_id

Lists all Data Provider identifiers (e.g. DP0, DP1) in a document.

get_dp_details

webi_doc_id, dp_id

Retrieves data source name, ID, type, and update status for a Data Provider.

get_dp_sql

webi_doc_id, dp_id

Extracts the raw SQL query statement generated by the Semantic Layer.

get_dp_specification

webi_doc_id, dp_id

Retrieves query specification tree (result objects, query filters, sort rules) via XML specification.

refresh_dp

webi_doc_id, dp_id

Refreshes a single Data Provider without recalculating the rest of the report.

purge_dp

webi_doc_id, dp_id

Purges cached data rows from a Data Provider to reduce storage size.

get_dp_mapping_proposal

webi_doc_id, dp_id, target_datasource_id, strategies?, resolve_names?

Evaluates Change Data Source mapping strategies (UNV to UNX or repointing), returning matching statuses (Ok, Ambiguous, NotFound), match rates, and human-readable object names.

change_dp_datasource

webi_doc_id, dp_id, target_datasource_id, strategies?, custom_mappings?, save?

Executes Change Data Source on a Data Provider, applies strategy matches and custom overrides, submits changes to Raylight, and commits to the repository.

Change Data Source & Mapping Strategies Evaluation

When migrating reports from UNV to UNX or repointing between universes, the SAP Raylight REST engine evaluates objects using one or more mapping strategies from left to right:

Strategy

Matching Mechanism

Precision & Safety

Best Used For

SameID

Matches exact internal object IDs (OBJ_...).

100% Deterministic (Zero risk).

UNV -> UNX migrations where the UNX was converted using Information Design Tool (IDT), which preserves original IDs.

SamePath

Matches full qualified folder tree path ([Class]/[Subclass]/[Object]).

Very High (98%) (Safe).

Distinguishes homonyms safely (e.g. [Customer]/[Country] vs [Supplier]/[Country]) even if IDs were regenerated.

SameName

Matches exact object display names regardless of folder hierarchy.

High (85-90%).

Universes where classes or folders were reorganized or flattened, but business object names were kept identical.

SameTechnicalName

Matches underlying database column or technical field name.

High (85%).

Scenarios where business names were translated or rebranded, but database column names remain unchanged.

CloseName

Fuzzy string distance (Levenshtein) matching.

Medium / Caution.

Minor spelling adjustments or plurals. May produce false positives; recommended only with manual review.

TIP

Recommended Strategy Chain: SameID,SamePath,SameName (The Gold Standard default). It guarantees 100% precision for IDT-converted universes, resolves structural hierarchy matches next, and gracefully falls back to display name matching without risking the false positives associated with uncontrolled fuzzy matching. Custom mapping overrides (custom_mappings=[{"source_id": "...", "target_id": "..."}]) can be supplied for any unresolved edge cases.

7. Central Management Server (CMS) Admin & Security (8 Tools)

Tool

Parameters

Description

cms_query

query, page=1, pagesize=1000

Executes arbitrary CMS SQL queries against CI_INFOOBJECTS, CI_APPOBJECTS, CI_SYSTEMOBJECTS.

get_users

page=1, pagesize=100

Lists user accounts (ID, username, email, disabled status, last logon).

get_user_details

user_id

Retrieves full profile properties of a specific user ID.

set_user_status

user_id, disabled: bool

Enables (disabled=False) or disables (disabled=True) a user account.

get_user_groups

page=1, pagesize=100

Retrieves all User Groups along with member counts.

get_group_users

group_id

Lists all users that are members of a specific User Group.

get_active_sessions

none

Monitors active connections and user sessions open on the CMS.

terminate_session

session_id

Forcibly terminates an active connection session by connection ID.

8. Schedules & Instance Diagnostics (4 Tools)

Tool

Parameters

Description

get_doc_schedules

webi_doc_id

Lists scheduled execution rules defined for a Webi document.

get_doc_instances

webi_doc_id, max_instances=50

Retrieves historical run instances (Success, Failed, Running) with timestamps.

get_instance_details

instance_id

Retrieves diagnostic information for an instance run, including failure error messages.

delete_instance

instance_id

Deletes a historical report execution instance from the CMS repository.

9. InfoStore, Folders & Categories (6 Tools)

Tool

Parameters

Description

get_folders

folder_id

Recursively traverses subfolder IDs starting from a parent folder.

get_folder_details

folder_id

Retrieves metadata of a repository folder (name, CUID, parent ID, description).

create_folder

name, parent_folder_id, description?

Creates a new folder in the InfoStore repository under a parent folder.

delete_folder

folder_id

Permanently deletes a folder from the InfoStore repository.

get_webi_docs

folder_id

Lists all Webi document IDs located directly inside a repository folder.

get_categories

none

Lists all Corporate Categories defined in the BI platform repository.

10. Intelligent Diagnostics & Batch Health Monitoring (1 Tool)

Tool

Parameters

Description

diagnose_batch_failures

hours_back=12, kind='All', folder_id?, max_instances=100

Scans, deduplicates, and diagnoses batch failures for Webi reports and Publications (SI_SCHEDULE_STATUS = 3). Clusters failures by error signature and produces a structured Pydantic v2 RCA report with up to 3 ranked probable causes and actionable remediation steps.

Automated Root Cause Analysis (RCA) & Error Clustering

The diagnose_batch_failures tool automates nocturnal batch monitoring and incident triage by querying the CMS repository (CI_INFOOBJECTS) via POST /biprws/v1/cmsquery for instances with SI_SCHEDULE_STATUS = 3 (Failed).

  1. Error Normalization: Recursively extracts text from nested CMS error structures (SI_STATUSINFO, SI_SUBST_STRINGS, SI_RESOURCEID), strips volatile runtime noise (timestamps, thread PIDs, hex addresses, IP addresses), and isolates standard SAP BO and database error codes (WIS, ORA, CRS, FBE, socket timeouts).

  2. Signature Clustering & Deduplication: Groups identical failures into clusters using deterministic SHA-256 fingerprinting. This prevents LLM context exhaustion when diagnosing hundreds of batch failures.

  3. Smart Context Enrichment: For clusters linked to prompt or calculation errors (WIS 30270, WIS 30271), automatically queries /biprws/raylight/v1/documents/{id}/parameters to identify unmapped or missing mandatory prompt parameters.

  4. Multi-Cause Ranking & Actionable Remediation: Assigns up to 3 ranked potential causes per cluster with confidence scores (probability_score) and concrete administrator remediation actions.

  5. Pydantic v2 Structured Output: Returns a strictly validated BatchDiagnosticsReport model for programmatic consumption.

Failure Category

Error Codes / Patterns

Typical Root Cause

Recommended Administrator Action

DB_LOCK_CONCURRENCY

ORA-00060, deadlock, lock request time out

Heavy transactional lock contention on data warehouse staging tables

Review DBA concurrent sessions, introduce job staggering (15-30 min intervals)

AUTH_CREDENTIALS

ORA-01017, invalid username/password, logon denied

Expired DB technical service account or rotated password

Test relational connection (.cns/.cnx) in Information Design Tool (IDT) and update credentials

NETWORK_TIMEOUT

SocketTimeoutException, Connection refused, timed out

Database listener or network firewall dropped keep-alive

Verify database server reachability, check listener port and connection pool timeouts

MISSING_PROMPTS

WIS 30270, WIS 30271, missing mandatory parameter

Scheduled instance triggered without required parameter values

Inspect report prompt rules in CMS and supply missing default prompt answers

CACHE_CORRUPTED

WIS 30553, processDPCommandsEx

Corrupted microcube cache in Web Intelligence Processing Server

Purge data provider cache via purge_dp or resave document definition

BURSTING_RECIPIENT

FBE60502, CRS 30000, Publication error

Dynamic recipient source document empty or unmapped email attribute

Verify recipient query results and publication delivery destination mapping

SERVER_RESOURCE_OOM

OutOfMemoryError, Java heap space, GC overhead

Adaptive Processing Server (APS) or Webi Processing Server memory exhaustion

Increase JVM max heap allocation (-Xmx) in CMC server properties and restart service

NOTE

In SAP BusinessObjects 4.x, relational connection testing (.cns / .cnx for UNX) is supported exclusively through the Information Design Tool (IDT) (or Universe Design Tool for legacy .unv). The Central Management Console (CMC) does not provide a relational connection testing function.


Environment Variables

Variable

Required?

Default

Description

Example

SAP_BO_REST_API_URL

Yes

None

URL to SAP BI Platform REST Web Services (biprws)

http://boserver.corp:8080/biprws

SAP_BO_USERNAME

Optional

None

Default username for the login tool

Administrator

SAP_BO_PASSWORD

Optional

None

Default password for the login tool

SecretP@ssw0rd


Client Integration Guide

1. Google Antigravity IDE

Workspace Configuration

Create a .agents/mcp_config.json file in your workspace (see mcp_config.example.json). When you open this folder in Antigravity IDE, all 48 tools are registered automatically:

{
  "mcpServers": {
    "sap-business-objects": {
      "command": "uv",
      "args": ["run", "python", "server.py"],
      "env": {}
    }
  }
}

Natural Language Prompts in Sidebar Chat (Agent Mode)

  • "Log into SAP BusinessObjects and perform intelligent diagnostics on batch executions that failed in the last 12 hours."

  • "Execute a CMS query to list all Webi report instances that failed scheduling today."

  • "Extract the raw SQL query generated by data provider DP3 of Webi report 6096."

  • "Inspect prompt parameters for report 12345, answer with year=2026, and trigger a document refresh."

  • "List all user accounts in the Administrators group and inspect active CMS sessions."

  • "Traverse the corporate repository hierarchy starting from Public Folders (ID 23)."


2. Antigravity CLI (agy)

Add the server to ~/.gemini/config/mcp_config.json:

{
  "mcpServers": {
    "sap-business-objects": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/BO_MCP",
        "run",
        "python",
        "server.py"
      ]
    }
  }
}

Run agy and prompt directly:

agy
> Login to SAP BusinessObjects and list all active CMS sessions.

3. FastMCP Development Inspector (Web UI)

Test tools via an interactive browser form:

uv run fastmcp dev server.py

4. Claude Desktop & Other MCP Hosts

For Anthropic Claude Desktop, add the configuration to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).

With credentials stored securely in your OS Keyring, no passwords or usernames are needed in the config:

{
  "mcpServers": {
    "sap-business-objects": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/BO_MCP",
        "run",
        "python",
        "server.py"
      ],
      "env": {
        "SAP_BO_REST_API_URL": "http://your-bo-host:8080/biprws"
      }
    }
  }
}

Agent Skill: sap-business-objects

The repository includes a production-grade operational skill located at .agents/skills/sap-business-objects, designed for Google Antigravity, Gemini CLI (agy), and compatible autonomous AI agents.

Core Capabilities:

  • Autonomous Intent Routing: Matches user prompts to the exact MCP tools across 7 operational domains (universes, Webi documents, prompts, tabular data, exports, CMS administration, and batch failure RCA).

  • Safe-by-Default Action Tiers: Enforces confirmation protocols for destructive actions (e.g., delete_webi_doc, terminate_session, set_user_status) while running safe queries autonomously.

  • Dedicated Operational Runbooks:

    • semantic_and_webi.md: Step-by-step guidance for universes, SQL extraction, table block extraction, and in-session refreshed PDF/Excel/CSV exports.

    • cms_admin_and_security.md: Virtual table querying (CI_INFOOBJECTS, CI_SYSTEMOBJECTS, CI_APPOBJECTS), session monitoring, and user/group administration.

    • batch_diagnostics_and_schedules.md: Root cause analysis (RCA) for nocturnal batch failures, error clustering, and strict IDT connection testing rules.

  • Repository Rules (project_rules.md): Defines architectural standards and enforces that SAP BusinessObjects relational connection testing is performed exclusively via the Information Design Tool (IDT), never the Central Management Console (CMC).


Available Scripts & Commands

Command

Purpose

uv sync --dev

Install all dependencies including testing and linting tools

uv run python server.py configure

Interactive setup wizard to securely store credentials in OS Keyring (masked getpass)

uv run python server.py status

Inspect currently active resolved credentials and target URL

uv run python server.py test

Verify stored credentials live against the SAP BO REST platform

uv run python server.py clear

Securely delete credentials from OS Keyring and local config metadata

uv run pytest

Run offline unit test suite with coverage report (97 tests)

uv run ruff check .

Run fast linting and style validation

uv run fastmcp inspect server.py

Inspect registered tools (verifies all 48 tools)

uv run fastmcp dev server.py

Launch interactive web inspector for live debugging

uv run python server.py

Run the MCP server in STDIO mode


Testing & Verification

The project includes an offline unit test suite powered by pytest, pytest-mock, and pytest-cov.

Why Offline Testing?

Because SAP BusinessObjects Enterprise (BOE) requires a complex, proprietary on-premise installation and commercial licenses, tests are designed to execute completely offline in < 1 second without connecting to a live SAP server. They simulate:

  • HTTP status codes (200, 401 Unauthorized, 404 Not Found, 500 Internal Server Error).

  • SAP BI platform specific error payloads (WSR 00999, invalid session tokens).

  • REST content negotiation (JSON vs. XML Accept: text/xml headers for query specifications).

  • Automatic and custom mapping strategies for changing Webi data sources.

  • Integrity and docstring coverage for all 48 FastMCP tools.

  • Intelligent diagnostics error signature clustering, multi-cause ranking, and Pydantic validation.

Running Tests Locally

# Run all unit tests
uv run pytest

# Run with test coverage report
uv run pytest --cov=core --cov=services --cov=server --cov-report=term-missing

# Run code style & formatting checks
uv run ruff check .
uv run ruff format --check .

Contributing Guidelines

Contributions are welcome! Whether you are fixing bugs, adding new SAP BO REST tools, or improving documentation, we appreciate your help.

For full contribution details, please read CONTRIBUTING.md.

Quick Contribution Workflow

  1. Fork & Clone: Fork the repository on GitHub and clone your fork locally.

  2. Environment Setup: Install development dependencies with uv sync --dev.

  3. Branching: Create a focused feature branch off main:

    git checkout -b feat/your-feature-name
  4. Code Standards:

    • Follow PEP 8 and project style using uv run ruff check --fix . and uv run ruff format ..

    • Maintain type annotations and descriptive docstrings for all @mcp.tool() functions.

    • Keep domain business logic inside services/ and transport/session logic inside core/client.py.

  5. Testing:

    • Add offline unit tests in tests/ using MockBOEClient. Do not write tests that require a live SAP BO server.

    • Ensure all existing and new tests pass: uv run pytest.

  6. Submit a Pull Request: Push your branch to GitHub and open a Pull Request targeting main. The automated GitHub Actions CI will validate your PR against Python 3.13.


Troubleshooting

Symptom / Error

Probable Cause

Recommended Resolution

WSR 00999: Internal Server Error

Corrupt Web Intelligence report structure or invalid REST payload syntax.

Verify document ID via get_documents, ensure correct query specification XML, and inspect CMS logs.

401 Unauthorized / Invalid Token

The X-SAP-LogonToken has expired or credentials are invalid.

Run the login tool to refresh the session token.

404 Not Found

The requested document ID, universe ID, or folder ID does not exist in the CMS.

Query the CMS via cms_query to confirm object existence and verify folder permissions.

Connection refused / timeout

Network firewall or routing blocking access to the SAP BO REST port (default 6405 / 8080).

Verify BO_BASE_URL in .env and verify connectivity using curl -v http://<host>:<port>/biprws/infostore.


Security & Operational Best Practices

  1. Protect Sensitive Credentials: Never commit .env files, logon tokens, or CMS credentials to source control. Use .env.example as a template.

  2. Least Privilege: Configure dedicated SAP BO service accounts with permissions restricted to the target universes, folders, and reports required for your AI workflows.

  3. Session Hygiene: Always log off inactive sessions using the logout tool or terminate orphaned sessions via terminate_session.

  4. Production Safeguards: Exercise caution when using destructive tools like delete_webi_doc, delete_folder, purge_dp, or set_user_status.


Author & License

  • Author: Alessio Ballarin (@alexraio)

  • Version: 0.2.0 (Modular Domain Architecture)

  • License: Apache License 2.0 - see the LICENSE file for complete terms and copyright notices.

Available Tools

46 tools
change_dp_datasourceA

Executes Change Data Source on a Web Intelligence Data Provider (e.g. migrating UNV to UNX or repointing universes). Generates mapping proposal using evaluated strategies, applies any custom mapping overrides, submits changes to Raylight, and optionally saves the document permanently in the repository.

Parameters: webi_doc_id: ID of the Web Intelligence document. dp_id: Data Provider identifier (e.g. 'DP0'). target_datasource_id: ID of the target universe (UNX or UNV). strategies: Comma-separated list of strategies (default: 'SameID,SamePath,SameName'). custom_mappings: Optional list of explicit overrides, e.g. [{"source_id": "OBJ_147", "target_id": "OBJ_147"}]. save: If True (default), permanently commits changes to the repository via in-place save.

Inputs: dp_id (required), webi_doc_id (required), target_datasource_id (required), save, +2 more. Returns: object

cms_queryB

Executes an arbitrary SQL-like query against the CMS repository tables (CI_INFOOBJECTS, CI_APPOBJECTS, CI_SYSTEMOBJECTS). Examples:

  • 'SELECT SI_ID, SI_NAME FROM CI_INFOOBJECTS WHERE SI_KIND = "Webi"'

  • 'SELECT SI_ID, SI_NAME, SI_LASTLOGONTIME FROM CI_SYSTEMOBJECTS WHERE SI_KIND = "User"'

Inputs: query (required), page, pagesize. Returns: object

create_folderC

Creates a new folder in the InfoStore repository under a parent folder.

Inputs: name (required), parent_folder_id (required), description. Returns: object

delete_folderC

Permanently deletes a folder from the InfoStore repository.

Inputs: folder_id (required). Returns: result

delete_instanceC

Deletes a historical report execution instance from the CMS repository.

Inputs: instance_id (required). Returns: result

delete_webi_docB

Permanently deletes a Web Intelligence document from the repository.

Inputs: webi_doc_id (required). Returns: result

get_active_sessionsA

Monitors active connections and user sessions currently open on the Central Management Server.

Inputs: no named parameters. Returns: result

get_categoriesA

Lists all Corporate Categories defined in the BI platform repository.

Inputs: no named parameters. Returns: result

get_commentsB

Retrieves collaborative user comments and cell annotations in a Webi document.

Inputs: webi_doc_id (required). Returns: result

get_doc_detailsC

Retrieves metadata of a Webi report (name, repository folder path, CUID, scheduled status, and state).

Inputs: webi_doc_id (required). Returns: result

get_doc_instancesB

Retrieves historical run instances of a Webi report, including execution status (Success, Failed, Running) and execution timestamps.

Inputs: webi_doc_id (required), max_instances. Returns: result

get_doc_parametersB

Retrieves all prompt parameters required by a Web Intelligence report. Returns parameter ID, prompt question/name, technical name, data type, and whether it is mandatory or optional.

Inputs: webi_doc_id (required). Returns: result

get_doc_propertiesB

Retrieves document configuration properties (refreshOnOpen, usePersonalData, formatting locale).

Inputs: webi_doc_id (required). Returns: object

get_doc_schedulesB

Lists scheduled execution rules defined for a Web Intelligence document.

Inputs: webi_doc_id (required). Returns: result

get_documentsB

Retrieves a paginated list of Web Intelligence documents from the repository. Returns document ID, CUID, name, folder ID, and last updated timestamp.

Inputs: page, pagesize. Returns: result

get_dpB

Lists all Data Provider identifiers (e.g. 'DP0', 'DP1') within a Webi document.

Inputs: webi_doc_id (required). Returns: result

get_dp_detailsB

Retrieves metadata of a specific Data Provider (data source name, ID, type, and update status).

Inputs: dp_id (required), webi_doc_id (required). Returns: result

get_dp_mapping_proposalA

Generates and evaluates a Change Data Source mapping proposal for a Data Provider. Simulates repointing a Web Intelligence query to a target universe (e.g. UNV to UNX or repointed UNX) and reports matching status ('Ok', 'Ambiguous', 'NotFound') for all objects.

Mapping Strategies (evaluated in sequence):

  • SameID: Matches objects having identical unique IDs. Recommended for UNV->UNX converted via IDT (100% precision).

  • SamePath: Matches objects by full folder hierarchy path (e.g. [Folder]/[Subfolder]/[Object]). Distinguishes homonyms safely.

  • SameTechnicalName: Matches objects by underlying database column or technical field name.

  • SameName: Matches objects by display name across any folder reorganization.

  • CloseName: Fuzzy string distance matching (Levenshtein). Helpful for minor typos/casing, but caution recommended.

Recommended default: 'SameID,SamePath,SameName'.

Inputs: dp_id (required), webi_doc_id (required), target_datasource_id (required), strategies, +1 more. Returns: object

get_dp_specificationC

Retrieves the query specification tree (result objects, query filters, sort rules) of a Data Provider.

Inputs: dp_id (required), webi_doc_id (required). Returns: object

get_dp_sqlC

Extracts the generated SQL query statement of a Data Provider.

Inputs: dp_id (required), webi_doc_id (required). Returns: result

get_folder_detailsB

Retrieves metadata of a repository folder (name, CUID, parent ID, description).

Inputs: folder_id (required). Returns: object

get_foldersB

Gets all subfolder IDs recursively starting from a root folder ID.

Inputs: folder_id (required). Returns: result

get_group_usersB

Lists all users that are members of a specific User Group.

Inputs: group_id (required). Returns: result

get_instance_detailsB

Retrieves detailed diagnostic information for a specific instance run, including failure error messages and file sizes.

Inputs: instance_id (required). Returns: object

get_parameter_lovC

Retrieves the List of Values (LOV) allowed for a constrained prompt parameter in a Webi document.

Inputs: webi_doc_id (required), parameter_id (required). Returns: result

get_report_element_dataB

Extracts structured tabular data rows from a table or chart block in a report tab. Caps output to max_rows (default 1000) to protect LLM context windows. Returns column names and a list of dictionary rows.

Inputs: report_id (required), element_id (required), webi_doc_id (required), max_rows. Returns: object

get_report_elementsC

Lists all visual and data elements (tables, charts, sections) inside a report sheet/tab.

Inputs: report_id (required), webi_doc_id (required). Returns: result

get_reportsB

Lists all sheets/tabs in a Web Intelligence document (returns report IDs and tab names).

Inputs: webi_doc_id (required). Returns: result

get_universe_connection_idC

Retrieves the Data Connection ID associated with a Universe.

Inputs: universe_id (required). Returns: result

get_universe_detailsC

Retrieves detailed metadata of a specific Universe (engine type: 'unx' or 'unv', name, CUID).

Inputs: universe_id (required). Returns: object

get_universesA

Retrieves all published Universes (UNX and UNV) from the BI platform. Returns a list of objects containing 'id', 'name', and 'folderId'.

Inputs: no named parameters. Returns: result

get_universe_structureB

Retrieves the complete business layer hierarchy (classes, dimensions, measures, attributes) of a universe using the Semantic Layer REST API (/sl/v1/universes/{id}).

Inputs: universe_id (required). Returns: object

get_user_detailsB

Retrieves full profile properties of a specific user ID.

Inputs: user_id (required). Returns: object

get_user_groupsC

Retrieves all User Groups configured in the BI platform along with member counts.

Inputs: page, pagesize. Returns: result

get_usersC

Lists user accounts in the BI platform repository (ID, username, email, disabled status, last logon).

Inputs: page, pagesize. Returns: result

get_variablesC

Retrieves all custom formulas and calculated variables defined inside a Webi document.

Inputs: webi_doc_id (required). Returns: result

get_webi_docsB

Lists all Web Intelligence document IDs located directly inside a repository folder.

Inputs: folder_id (required). Returns: result

loginA

Log in to the SAP BusinessObjects BI Platform. Establishes an active enterprise session and acquires a logon token (X-SAP-LogonToken). If username/password are omitted, values from .env are used automatically.

Inputs: password, username. Returns: result

logoutA

Log out from the SAP BusinessObjects platform and invalidate the active session token.

Inputs: no named parameters. Returns: result

purge_dpC

Purges cached data rows from a specific Data Provider to reduce document storage size.

Inputs: dp_id (required), webi_doc_id (required). Returns: result

refresh_dpB

Refreshes a single Data Provider without recalculating the rest of the report.

Inputs: dp_id (required), webi_doc_id (required). Returns: result

refresh_webi_docB

Refreshes a Web Intelligence document. If the report requires prompts, answers can be passed as a list of objects, e.g. [{"id": 0, "value": "2026"}, {"id": 1, "value": ["Region A", "Region B"]}].

Inputs: webi_doc_id (required), parameters. Returns: object

save_webi_docA

Saves a Web Intelligence document in place (if webi_doc_name is omitted), or saves/overwrites it with a specified name (Save As). Preserves user comments and annotations.

Inputs: webi_doc_id (required), webi_doc_name. Returns: result

set_user_statusC

Enables (disabled=False) or disables (disabled=True) a user account in the BI platform.

Inputs: user_id (required), disabled (required). Returns: result

terminate_sessionB

Forcibly disconnects and terminates an active user session by connection ID.

Inputs: session_id (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 46 tools

    Disambiguation4/5

    Most tools target a clearly distinct resource+action (universe metadata vs. structure, document details vs. properties vs. parameters, each data-provider aspect separately). A few boundaries blur, notably get_documents vs. get_webi_docs and get_reports (sheets) which could momentarily confuse, but descriptions disambiguate them adequately.

    Naming Consistency4/5

    Strong, predictable verb_noun snake_case throughout with consistent prefixes (get_universe_*, get_doc_*, get_dp_*, create_*, delete_*, refresh_*). Minor deviations like cms_query (noun_verb) and verbless login/logout are the only irregularities.

    Tool Count2/5

    46 tools is very high even for a complex BI platform, and several thin getters (e.g. get_dp_details, get_dp_sql, get_universe_connection_id) could be consolidated into richer calls. The surface is heavy enough that tool selection becomes a burden for an agent.

    Completeness4/5

    Broad lifecycle coverage across universes, documents, data providers, folders, users/groups, sessions, schedules, instances, and raw CMS queries. Gaps remain (no user/group creation, no document creation or schedule triggering, no comment posting), but core workflows are well supported.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to integrate with SAP systems via OData REST APIs for querying entity sets, performing CRUD operations, and executing function imports. It features automatic service discovery, CSRF token management, and smart connection handling without requiring the SAP RFC SDK.
      11
      13
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Enables 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.
      131
      339 npm
      80
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to discover SAP B1 entities, inspect their schemas, and perform authenticated CRUD operations through natural language, translating requests into Service Layer API calls.
      316 npm
      MIT