SAP BTP MCP Server
Provides tools for managing SAP Business Technology Platform (BTP) infrastructure, including provisioning subaccounts, assigning role collections, listing users, regions, directories, entitlements, service instances, environment instances, and subscriptions, all via natural language commands.
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., "@SAP BTP MCP Server Check if my BTP session is still active using ping."
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.
🚀 SAP BTP MCP Server
A professional Model Context Protocol (MCP) server providing a robust natural language interface for SAP Business Technology Platform (BTP).
Manage your cloud infrastructure, security, and entitlements conversationally through AI agents (Claude, Gemini, etc.) using your local btp CLI session.
🌟 Key Features
Conversational Infrastructure: Provision subaccounts and assign roles using simple language.
Fail-Safe Design: Built-in timeouts, non-interactive execution, and resilient output parsing.
Secure by Design:
Runs entirely locally; no external credentials or tokens are stored.
Leverages your existing BTP CLI authentication (SSO/JWT).
Proactive Error Handling: Provides clear instructions when authentication expires or inputs are invalid.
Automatic Discovery: Intelligently locates the
btpbinary across Windows, macOS, and Linux.
Related MCP server: SAP Business Data Cloud MCP Server
🏗️ Fail-Proof Architecture
This server is designed for mission-critical AI automation:
Intelligent Timeouts: Prevents "hanging" on long SAP BTP API operations with 60s/120s thresholds.
Deep JSON Recovery: Automatically extracts valid data even if the CLI returns mixed output or warnings.
Input Validation: Pre-validates technical IDs (GUIDs) and Emails to prevent unnecessary CLI failures.
Non-Interactivity: Guaranteed non-blocking execution using CI-mode environments and null-input piping.
📋 Prerequisites
SAP BTP CLI: Installed and in your system
PATH.Active Session: You must be logged in. Verify with:
btp list accounts/global-accountPython 3.10+: Ensure a modern Python environment.
🛠️ Installation
Using uv (Recommended)
uv tool install --from . btp-mcp-serverUsing pip
pip install .⚙️ Configuration
Add the following to your MCP client config (e.g., claude_desktop_config.json):
Using uv (Fastest)
{
"mcpServers": {
"btp": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/BTP MCP Server",
"run",
"btp-mcp-server"
]
}
}
}Using Python
{
"mcpServers": {
"btp": {
"command": "python3",
"args": ["-m", "btp_mcp_server"],
"env": { "PYTHONPATH": "/absolute/path/to/BTP MCP Server/src" }
}
}
}🧠 Available Tools
Category | Tool | Description |
System |
| Checks CLI health and login status. |
| Run any generic BTP CLI command. | |
Accounts |
| List all accessible subaccounts. |
| Provision a new subaccount with validation. | |
| Permanent deletion of a subaccount. | |
| List available technical regions (us10, eu10, etc). | |
| List directories in the global account. | |
Security |
| List global account users. |
| Grant roles (e.g., Admin) to a user. | |
Resources |
| Check available service plans/quotas. |
| Remove an assigned entitlement from a subaccount. | |
| List active services in a subaccount. | |
| List environments like Cloud Foundry or Kyma. | |
| List SaaS application subscriptions. |
💬 Usage Examples
"Check if my BTP session is still active using ping."
"Show me all subaccounts in region eu10."
"Assign the 'Subaccount Admin' role to colleague@example.com."
"Create a development subaccount named 'Internal-Alpha' in us10."
🆘 Troubleshooting
Authentication Error (❌ AUTHENTICATION ERROR) If you see this, your BTP CLI session has expired.
Clear the error in the AI chat.
Run
btp loginin your terminal.Refresh the AI session.
CLI Not Found (⚠️ BTP CLI not found)
Ensure btp is in your PATH. On macOS/Linux, try ln -s /path/to/btp /usr/local/bin/btp.
🏗️ System Design
The server follows a layered architecture to ensure separation of concerns and maximum stability:
Tool Layer (
server.py): UsesFastMCPto register Python functions as MCP tools. Implements strict Pydantic validation and maps technical exceptions to human-readable markdown tips.Service Layer (
btp_cli.py): Orchestrates command execution. Manages the state of the CLI path, handles binary auto-discovery, and implements the "Deep JSON Recovery" algorithm.Execution Layer (
subprocess): Interacts directly with the OS. Uses hardened environments (CI=true) and standard error redirection to maintain security and non-interactivity.Utility Layer (
utils.py): Centralizes cross-cutting concerns like logging tostderrand custom domain-specific exceptions.
🔄 Control Flow
Request Intake: The AI client (e.g., Antigravity) sends a JSON-RPC request to a registered tool (e.g.,
btp_list_subaccounts).Pre-Validation: The Tool Layer hydrates parameters and performs regex-based technical validation (IDs/GUIDs).
Execution: The Service Layer constructs a safe CLI command, injecting
--format jsonas a global prefix.Retry & Recovery:
If the command times out, it retries with exponential backoff.
If the output contains warnings + JSON, the "Deep Recovery" engine extracts the valid payload.
Error Mapping: If the CLI returns "Session Expired", the decorator catches it and provides the user with an exact
btp logincommand for their specific binary path.Structured Response: The final JSON payload is beautified and returned to the AI as a markdown-formatted string.
📄 License
MIT License.
👤 Author
Kallol Chakraborty - @kallolchakraborty
Available Tools
16 toolsbtp_create_subaccountB
Provision a new subaccount in the current global account. This operation is asynchronous on the platform side but the tool waits for the initial response.
Inputs: args (required), kwargs (required).
btp_delete_subaccountB
Delete a subaccount permanently. WARNING: This will delete all resources within the subaccount.
Inputs: args (required), kwargs (required).
btp_execute_commandA
Generic execution engine for ANY SAP BTP CLI command. Use this if a dedicated tool is not available for a specific resource type.
Safety: This tool automatically handles JSON formatting and error detection.
Inputs: args (required), kwargs (required).
btp_get_destinationC
Get the full configuration (URL, authentication, proxy) of a specific destination.
Inputs: args (required), kwargs (required).
btp_get_global_accountC
Retrieve metadata about the current global account context, including its name and ID.
Inputs: args (required), kwargs (required).
btp_get_subaccountC
Get comprehensive details for a specific subaccount, including region, subdomain, and parent IDs.
Inputs: args (required), kwargs (required).
btp_list_destinationsC
List all destinations (HTTP/RFC connections) in a subaccount.
Inputs: args (required), kwargs (required).
btp_list_environment_instancesC
List all environment instances (e.g., Cloud Foundry, Kyma) in a subaccount.
Inputs: args (required), kwargs (required).
btp_list_regionsB
List all technical regions available in the global account (e.g., 'us10', 'eu10').
Inputs: args (required), kwargs (required).
btp_list_service_bindingsC
List service bindings (credentials for applications) in a subaccount.
Inputs: args (required), kwargs (required).
btp_list_service_instancesC
List all service instances (active services) in a subaccount.
Inputs: args (required), kwargs (required).
btp_list_subaccountsC
List all subaccounts in the current global account including their IDs, names, and states.
Inputs: args (required), kwargs (required).
btp_list_subscriptionsC
List multi-tenant application subscriptions in a subaccount.
Inputs: args (required), kwargs (required).
btp_list_usersC
List all users who have been added to the current global account or custom IdP.
Inputs: args (required), kwargs (required).
btp_pingA
Diagnostic tool to verify connectivity and login status. Use this if you are unsure if the BTP CLI is configured correctly.
Inputs: args (required), kwargs (required).
btp_remove_entitlementB
Remove an entitlement (service plan quota) from a subaccount. Useful for freeing up global quota or cleaning up unused services.
Inputs: args (required), kwargs (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool targets a distinct resource type or action, with clear descriptions. The generic btp_execute_command is explicitly a fallback, reducing potential confusion with dedicated tools.
All tools start with 'btp_' and follow verb_noun pattern, though verbs vary (list, get, create, delete, remove). Minor inconsistency: 'remove_entitlement' instead of 'delete_entitlement', and 'ping'/'execute_command' lack a noun.
16 tools cover a broad yet focused domain of SAP BTP management, not too few or too many. The count is well-suited for the server's purpose.
The tool set lacks update and delete operations for most resource types (e.g., service instances, bindings, destinations, subscriptions). Only subaccounts have create and delete. The generic btp_execute_command can compensate, but the dedicated surface is significantly incomplete.
Maintenance
Related MCP Connectors
Deploy, monitor, and manage your OpenClaw AI assistants via natural language.
Connect, monitor, and control AI agents — tasks, approvals, schedules, and governance.
Your AI Agent's Infrastructure Layer. Connect Claude, Copilot, Codex, or ChatGPT to 200+ managed open source services. Start databases, pipelines, and applications through natural language.
Build and manage AI-native customer support agents from Claude or any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceTransforms SAP S/4HANA or ECC systems into conversational AI interfaces by exposing all OData services as dynamic MCP tools. Enables natural language interactions with ERP data for querying, creating, updating, and deleting business entities through SAP BTP integration.144MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage SAP Business Data Cloud operations including data shares, Delta Sharing, and data product publishing through an MCP interface.11MIT
- AlicenseAqualityDmaintenanceConnects AI agents to SAP BTP platform APIs for service discovery, instance management, and destination queries via natural language.524 PyPI1MIT
- FlicenseBqualityCmaintenanceEnables managing SAP Cloud Integration iFlows, packages, configurations, deployments, and runtime artifacts via natural language through the OData API.25-