Skip to content
Back to search

btp-cf-mcp

SAP BTP Cloud Foundry Python MCP Server with Standalone Approuter, XSUAA & Principal Propagation

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 21 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/encryptD/btp-cf-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/encryptD/btp-cf-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/encryptd--btp-cf-mcp/badge.svg)](/listings/encryptd--btp-cf-mcp)

HTML

<a href="/listings/encryptd--btp-cf-mcp"><img src="/api/listings/encryptd--btp-cf-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Install Dependencies

make install

2. Run the Test Suite & Linter

make test
make lint

3. Start Local Server (Mock Auth Mode)

cp .env.example .env
make dev

- **Health Check**: `http://localhost:8080/health` - **Current User Diagnostic**: `http://localhost:8080/api/me` - **MCP Streamable HTTP Endpoint**: `http://localhost:8080/mcp` - **MCP SSE Endpoint**: `http://localhost:8080/sse`

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 101 lines
  1. # SAP BTP Cloud Foundry Python MCP Server (`btp-cf-mcp`)
  2. Production-ready scaffold for a **Python Model Context Protocol (MCP) Server** on **SAP BTP Cloud Foundry**, adhering to the enterprise **SAP Approuter + XSUAA + BTP Destination Service** architecture with **Principal Propagation** and **Cross-Agent Portability**.
  3. ---
  4. ## Key Features
  5. - **FastMCP + FastAPI/Starlette ASGI Stack (`srv/`)**:
  6. - Supports both **Streamable HTTP (`/mcp`)** (with `stateless_http=True` for multi-instance Cloud Foundry scaling) and **SSE (`/sse`, `/messages`)** transports.
  7. - **Standalone Node.js SAP Approuter (`approuter/`)**:
  8. - Routes `/mcp`, `/sse`, `/messages`, and `/api/*` with `authenticationType: "xsuaa"`, `forwardAuthToken: true`, and `csrfProtection: false` for seamless MCP client compatibility.
  9. - **Dual-Mode XSUAA JWT Security (`srv/app/auth/`)**:
  10. - Supports `sap-xssec` and `PyJWT` (PEM `verificationkey` & `/token_keys` JWKS validation), plus a local development `AUTH_MODE=mock` mode (automatically disabled in Cloud Foundry production).
  11. - Pure ASGI middleware (`XsuaaAuthASGIMiddleware`) propagates the validated `UserSecurityContext` (user, tenant, scopes, SAML attributes, raw JWT) into MCP tools via `contextvars`.
  12. - **SAP BTP Destination Service & Principal Propagation (`srv/app/btp/`)**:
  13. - Resolves BTP Destinations using the caller's XSUAA JWT (`X-user-token` header or `urn:ietf:params:oauth:grant-type:jwt-bearer` token exchange) and queries SAP OData V2/V4 services via `SapODataClient`.
  14. - **Coding Agent Handover & Portability**:
  15. - Includes [`AGENTS.md`](AGENTS.md), [`docs/AGENT_HANDOVER.md`](docs/AGENT_HANDOVER.md), [`.cursorrules`](.cursorrules), [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md), and Architecture Decision Records (`docs/adr/`).
  16. ---
  17. ## Repository Structure
  18. ```text
  19. btp-cf-mcp/
  20. ├── AGENTS.md # Universal coding agent entrypoint
  21. ├── .cursorrules # Cursor / Windsurf IDE agent rules
  22. ├── mta.yaml # SAP BTP Multi-Target Application descriptor
  23. ├── xs-security.json # XSUAA scopes, attributes, role templates & collections
  24. ├── Makefile # Developer & agent automation targets
  25. ├── approuter/ # Standalone @sap/approuter Node.js module
  26. │ ├── package.json
  27. │ ├── xs-app.json # Routing & XSUAA scope rules
  28. │ └── default-env.json.example
  29. ├── srv/ # Python MCP Server (CF python_buildpack)
  30. │ ├── Procfile
  31. │ ├── runtime.txt
  32. │ ├── requirements.txt
  33. │ ├── pyproject.toml
  34. │ ├── app/
  35. │ │ ├── config.py # Settings & VCAP_SERVICES parser
  36. │ │ ├── main.py # FastAPI + FastMCP ASGI app factory
  37. │ │ ├── auth/ # XSUAA validator, ContextVar & pure ASGI middleware
  38. │ │ ├── btp/ # BTP Destination Service & OData client
  39. │ │ └── mcp_server/ # FastMCP tools, resources & prompts
  40. │ └── tests/ # Async pytest suite (auth, destination, MCP tools)
  41. └── docs/
  42. ├── AGENT_HANDOVER.md # Portable handover guide & extension playbooks
  43. ├── ARCHITECTURE.md # Mermaid topology & sequence diagrams
  44. └── adr/ # Architecture Decision Records
  45. ```
  46. ---
  47. ## Quickstart (Local Development)
  48. ### 1. Install Dependencies
  49. ```bash
  50. make install
  51. ```
  52. ### 2. Run the Test Suite & Linter
  53. ```bash
  54. make test
  55. make lint
  56. ```
  57. ### 3. Start Local Server (Mock Auth Mode)
  58. ```bash
  59. cp .env.example .env
  60. make dev
  61. ```
  62. - **Health Check**: `http://localhost:8080/health`
  63. - **Current User Diagnostic**: `http://localhost:8080/api/me`
  64. - **MCP Streamable HTTP Endpoint**: `http://localhost:8080/mcp`
  65. - **MCP SSE Endpoint**: `http://localhost:8080/sse`
  66. ---
  67. ## Deploying to SAP BTP Cloud Foundry
  68. ### Prerequisites
  69. - [Cloud Foundry CLI (`cf`)](https://github.com/cloudfoundry/cli) with MultiApps plugin (`cf install-plugin multiapps`)
  70. - [Cloud MTA Build Tool (`mbt`)](https://sap.github.io/cloud-mta-build-tool/)
  71. ### Build & Deploy
  72. ```bash
  73. # 1. Log in to your SAP BTP Cloud Foundry target
  74. cf login -a https://api.cf.<region>.hana.ondemand.com
  75. # 2. Build the MTA archive (.mtar)
  76. make build-mta
  77. # 3. Deploy to Cloud Foundry
  78. make deploy
  79. ```
  80. After deployment:
  81. 1. Open the **SAP BTP Cockpit** -> **Security** -> **Role Collections** and assign `BTP_MCP_User` or `BTP_MCP_Admin` to your users.
  82. 2. Connect your MCP client to `https://<approuter-route>/mcp` (or `/sse`) with an XSUAA Bearer token.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.