btp-doctor-mcp
v0.1.1MCP server that lets AI assistants check, fix and diagnose SAP BTP apps: CAP/MTA/Fiori deployments, XSUAA and AMS roles, JWTs, and destinations.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
check_project Check BTP project
Checks mta.yaml, package.json, .cdsrc.json, Fiori app files and multitenancy setup for problems that make "cf deploy" fail or the app break after deploy. Returns findings with severity, location, explanation and fix IDs for one-click fixes. Read-only.
| Parameter | Type | Description |
|---|---|---|
path | string | Project root containing mta.yaml or package.json. Relative paths resolve against the server working directory. Defaults to it. |
preview_fix Preview a fix
Shows the exact file changes a fix would make, as a diff. Use a fixId from check_project. Read-only.
| Parameter | Type | Description |
|---|---|---|
fixId * | string | Fix ID from check_project, e.g. "MTA004-1a2b3c4d". |
path | string | Project root containing mta.yaml or package.json. Relative paths resolve against the server working directory. Defaults to it. |
apply_fix Apply a fix
Writes one fix to the project files, keeping their formatting and comments. Use a fixId from check_project. Refuses if the files changed since the check. Returns any follow-up step, such as npm install, and the remaining findings.
| Parameter | Type | Description |
|---|---|---|
fixId * | string | Fix ID from check_project. |
path | string | Project root containing mta.yaml or package.json. Relative paths resolve against the server working directory. Defaults to it. |
fix_all Apply all safe fixes
Applies every fix that needs no choice, one at a time, re-checking after each. Skips findings with alternative fixes and fixes that need review. With dryRun, only lists the diffs.
| Parameter | Type | Description |
|---|---|---|
dryRun | boolean | Only show what would change. Default false. |
path | string | Project root containing mta.yaml or package.json. Relative paths resolve against the server working directory. Defaults to it. |
diagnose_log Explain a deploy or app log
Matches a Cloud Foundry, MTA deploy, HDI, npm, UI5 build or CAP runtime log against known failure signatures. Returns the cause and fix for each known problem, MTA operation IDs, and unexplained error lines. Pass the text or a file path. Read-only.
| Parameter | Type | Description |
|---|---|---|
file | string | Path to a saved log file, used when text is not given. |
text | string | Log text, e.g. the output of "cf deploy" or "cf logs <app> --recent". |
diagnose_cf_app Explain recent app logs
Runs "cf logs <app> --recent" with the locally logged-in cf CLI and explains known problems. Read-only on Cloud Foundry. Needs the cf CLI installed and logged in to the right org and space.
| Parameter | Type | Description |
|---|---|---|
app * | string | Cloud Foundry app name, e.g. "bookshop-srv". |
diagnose_mta_operation Explain a failed MTA deploy
Downloads the logs of one MTA deploy operation ("cf dmol -i <id>") with the local cf CLI and explains known problems. The operation ID appears in failed "cf deploy" output. Read-only on Cloud Foundry.
| Parameter | Type | Description |
|---|---|---|
operationId * | string | MTA operation ID from the cf deploy output. |
check_roles Check roles (403 Forbidden)
Follows every role that the CDS model checks (@requires, @restrict) to xs-security.json: scope, role template and role collection, including the values mta.yaml adds at deploy (parameters.config). Also checks user attributes ($user.x) and references XSUAA would reject. For apps using Identity Authentication with AMS, lists which DCL policies give each role instead. Read-only.
| Parameter | Type | Description |
|---|---|---|
file | string | xs-security.json to use, relative to the project. Defaults to the one in the project root, or the first one found. |
path | string | Project root containing mta.yaml or package.json. Relative paths resolve against the server working directory. Defaults to it. |
explain_token Explain a JWT
Decodes a JWT locally (the signature is not verified) and explains it against this project: who it is for, expiry, which CDS roles it grants, whether it comes from another XSUAA instance, or for IAS/AMS which policies each role needs. Only use a token the user gave you. The token is not stored or sent anywhere. Read-only.
| Parameter | Type | Description |
|---|---|---|
token * | string | The JWT, with or without "Bearer ". |
file | string | xs-security.json to use, relative to the project. Defaults to the one in the project root, or the first one found. |
path | string | Project root containing mta.yaml or package.json. Relative paths resolve against the server working directory. Defaults to it. |
add_missing_roles Add missing roles to xs-security.json
Adds a scope and role template for each CDS role that has none, keeping the file formatting. Creates xs-security.json from the CDS model when the project has none. Does not create role collections or assign users. With dryRun, only lists what would be added.
| Parameter | Type | Description |
|---|---|---|
dryRun | boolean | Only show what would change. Default false. |
file | string | xs-security.json to use, relative to the project. Defaults to the one in the project root, or the first one found. |
path | string | Project root containing mta.yaml or package.json. Relative paths resolve against the server working directory. Defaults to it. |
roles | array | Only these CDS roles. Default: every role without a scope or role template. |
list_cf_apps List Cloud Foundry apps
Lists the apps in the space the local cf CLI targets, with their state. Read-only on Cloud Foundry.
check_destinations Check destinations of a deployed app
Reads a deployed app's service bindings with the local cf CLI and checks every destination it can see, the way the app would: Destination and Connectivity service bindings, destination configuration, authentication tokens (OAuth2, SAML, principal propagation), on-premise and Cloud Connector setup, and destinations the CAP project uses but that do not exist. Secrets in the configuration are masked. Read-only, but calls the Destination service API.
| Parameter | Type | Description |
|---|---|---|
app * | string | Name of the deployed Cloud Foundry app whose bindings are used, e.g. "bookshop-srv". |
destinations | array | Only check these destination names. |
path | string | Project root containing mta.yaml or package.json. Relative paths resolve against the server working directory. Defaults to it. |
testCalls | boolean | Also send one GET to each reachable Internet destination that needs no user. Default false. |
test_destination_call Test a call through a destination
Sends one GET request through a destination with the deployed app's credentials and explains the response (status, redirects to a login page, wrong path, certificate and network errors). Only Internet destinations can be called from this machine. For destinations that need a user (OAuth2UserTokenExchange, SAML bearer, principal propagation), pass a user JWT the user gave you.
| Parameter | Type | Description |
|---|---|---|
app * | string | Name of the deployed Cloud Foundry app whose bindings are used, e.g. "bookshop-srv". |
destination * | string | Destination name. |
requestPath | string | Path appended to the destination URL, e.g. "/$metadata". Default: the URL itself. |
userToken | string | A user JWT, only for user-dependent destinations. |