{
  "markdown": "<!-- mcp-name: io.github.ABRANJAN07/btp-mcp-server -->\n\n# SAP BTP Services Discovery — MCP Server\n\nA production-ready MCP (Model Context Protocol) server that exposes SAP BTP platform\nAPIs as tools for any MCP-compatible AI agent — Claude Code, Cursor, Joule Studio,\nLangGraph agents, or any other MCP client.\n\n<img width=\"1382\" height=\"854\" alt=\"image\" src=\"https://github.com/user-attachments/assets/84860cfa-d985-4701-9198-fdb31096aa10\" />\n\n> Connect any AI agent to your SAP BTP landscape via the Model Context Protocol.\n\n[![PyPI version](https://img.shields.io/pypi/v/btp-mcp-server.svg)](https://pypi.org/project/btp-mcp-server/)\n[![Python](https://img.shields.io/pypi/pyversions/btp-mcp-server.svg)](https://pypi.org/project/btp-mcp-server/)\n[![MCP](https://img.shields.io/badge/MCP-compatible-blue.svg)](https://modelcontextprotocol.io)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n---\n\n## What is this?\n\nThe **BTP MCP Server** is an open-source [Model Context Protocol](https://modelcontextprotocol.io)\nserver that connects AI agents to the SAP Business Technology Platform (BTP) APIs.\n\nInstead of switching to BTP Cockpit to answer common developer questions,\nyou can ask your AI agent directly:\n\n- _\"What BTP services are available in my account?\"_\n- _\"Is HANA Cloud already running in my subaccount?\"_\n- _\"I need async messaging in my CAP app — what should I use?\"_\n- _\"What destinations are configured and what authentication do they use?\"_\n\nWorks with **Claude Code**, **Cursor**, **Joule Studio**, **LangGraph agents**,\nand any other MCP-compatible AI client.\n\n---\n\n## Tools\n\n| Tool                    | What it answers                                  |\n| ----------------------- | ------------------------------------------------ |\n| `list_btp_services`     | What BTP services exist in the global catalog?   |\n| `get_btp_service_plans` | What plans does service X have? Are any free?    |\n| `list_btp_instances`    | What is running in my subaccount? Is it healthy? |\n| `get_btp_destinations`  | What external connections are configured?        |\n| `recommend_btp_service` | Given a use case, what service should I use?     |\n\n---\n\n## Installation\n\n```bash\npip install btp-mcp-server\n```\n\n---\n\n## Prerequisites\n\nYou need a **Service Manager** service key from your BTP subaccount.\n\n**Steps to get one:**\n\n1. Go to BTP Cockpit → your subaccount → **Services → Service Marketplace**\n2. Search for **Service Manager** → Create instance with plan `subaccount-admin`\n3. Create a **Service Key** on the instance\n4. The key JSON contains your credentials — see Configuration below\n\n---\n\n## Configuration\n\nAll configuration is via environment variables. Copy `.env.example` to `.env`\nand fill in the values from your Service Manager service key:\n\n```bash\n# From your Service Manager service key JSON\nBTP_CLIENT_ID=your-client-id          # from \"clientid\"\nBTP_CLIENT_SECRET=your-client-secret  # from \"clientsecret\"\nBTP_TOKEN_URL=https://your-subdomain.authentication.us10.hana.ondemand.com/oauth/token\nBTP_SM_URL=https://service-manager.cfapps.us10.hana.ondemand.com  # from \"sm_url\"\n\n# From BTP Cockpit → your subaccount → Overview → \"Subaccount ID\"\nBTP_SUBACCOUNT_ID=your-subaccount-guid\n\n# Destination Service URL (region-specific — adjust region if needed)\nBTP_DESTINATION_URL=https://destination.cfapps.us10.hana.ondemand.com\n\n# Optional: cache TTL in seconds (default: 300)\n# CACHE_TTL_SECONDS=300\n```\n\n> **Note:** Never commit your `.env` file to GitHub.\n> Use `.env.example` (with no real values) as a reference template.\n\n---\n\n## Usage\n\n### With Claude Desktop\n\nAdd to your `claude_desktop_config.json`:\n\n**Mac:** `~/.claude/claude_desktop_config.json`\n**Windows:** `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"sap-btp\": {\n      \"command\": \"btp-mcp-server\",\n      \"env\": {\n        \"BTP_CLIENT_ID\": \"your-client-id\",\n        \"BTP_CLIENT_SECRET\": \"your-client-secret\",\n        \"BTP_TOKEN_URL\": \"https://your-subdomain.authentication.us10.hana.ondemand.com/oauth/token\",\n        \"BTP_SM_URL\": \"https://service-manager.cfapps.us10.hana.ondemand.com\",\n        \"BTP_SUBACCOUNT_ID\": \"your-subaccount-guid\",\n        \"BTP_DESTINATION_URL\": \"https://destination.cfapps.us10.hana.ondemand.com\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Desktop. Then ask:\n\n- _\"What BTP services do I have available?\"_\n- _\"Are there any failed service instances?\"_\n- _\"I need to connect to an on-premise SAP system — what BTP service handles that?\"_\n\n---\n\n### With Claude Code / Cursor\n\n```json\n{\n  \"mcpServers\": {\n    \"sap-btp\": {\n      \"command\": \"btp-mcp-server\",\n      \"env\": {\n        \"BTP_CLIENT_ID\": \"...\",\n        \"BTP_CLIENT_SECRET\": \"...\",\n        \"BTP_TOKEN_URL\": \"...\",\n        \"BTP_SM_URL\": \"...\",\n        \"BTP_SUBACCOUNT_ID\": \"...\"\n      }\n    }\n  }\n}\n```\n\n### With a LangGraph agent\n\n```python\nfrom langchain_mcp_adapters.client import MultiServerMCPClient\nfrom langgraph.prebuilt import create_react_agent\nfrom langchain_anthropic import ChatAnthropic\n\nasync with MultiServerMCPClient({\n    \"btp\": {\n        \"command\": \"btp-mcp-server\",\n        \"transport\": \"stdio\",\n        \"env\": {\n            \"BTP_CLIENT_ID\": \"...\",\n            \"BTP_CLIENT_SECRET\": \"...\",\n            \"BTP_TOKEN_URL\": \"...\",\n            \"BTP_SM_URL\": \"...\",\n            \"BTP_SUBACCOUNT_ID\": \"...\",\n        }\n    }\n}) as client:\n    tools = client.get_tools()\n    agent = create_react_agent(\n        ChatAnthropic(model=\"claude-sonnet-4-6\"),\n        tools\n    )\n    result = await agent.ainvoke({\n        \"messages\": [{\"role\": \"user\", \"content\":\n            \"What BTP services do I have? Is there anything I should use for messaging?\"\n        }]\n    })\n```\n\n### With Joule Studio (BTP)\n\nDeploy in HTTP mode and register as a BTP Destination:\n\n```bash\nMCP_TRANSPORT=http btp-mcp-server\n# Server starts at http://0.0.0.0:8080/mcp\n```\n\nThen in BTP Cockpit → Destinations → create a destination pointing to your server URL.\nIn Joule Studio Agent Builder → Tools → Add MCP Server → select the destination.\n\n---\n\n## Running locally from source\n\n```bash\ngit clone https://github.com/ABRANJAN07/btp-mcp-server.git\ncd btp-mcp-server\n\npip install -r requirements.txt\ncp .env.example .env\n# fill in .env with your BTP credentials\n\n# Test BTP connectivity\npython test_connection.py\n\n# Start the MCP server\npython server.py\n```\n\n---\n\n## Running tests\n\nTests use mocked BTP responses — no real credentials needed.\n\n```bash\npip install -r requirements.txt\npytest tests/ -v\n```\n\nExpected output: **17 tests passed**\n\n---\n\n## Project structure\n\n```\nbtp-mcp-server/\n├── server.py              ← MCP server entry point (5 tools)\n├── test_connection.py     ← Verify BTP connectivity\n├── requirements.txt\n├── .env.example           ← Configuration template\n├── btp_mcp/\n│   ├── config.py          ← Reads .env settings\n│   ├── auth.py            ← OAuth2 token management\n│   ├── btp_client.py      ← BTP API calls + caching\n│   ├── cache.py           ← TTL cache\n│   └── models.py          ← Pydantic response models\n└── tests/\n    └── test_tools.py      ← 17 tests with mocked responses\n```\n\n---\n\n## How it works\n\n```\nAI Agent (Claude / Cursor / LangGraph)\n    │\n    │  MCP Protocol (stdio)\n    ▼\nBTP MCP Server (this package)\n    │  OAuth2 client_credentials\n    │  + TTL cache (5 min)\n    ▼\nSAP BTP APIs\n  ├── Service Manager API  → service catalog, instances, plans\n  └── Destination API      → configured connections\n```\n\n**Caching:** BTP API responses are cached for 5 minutes by default.\nThe service catalog and instance list change rarely — caching keeps\nresponses fast without sacrificing data freshness.\n\n**Pagination:** All list endpoints fetch every page from BTP, not\njust the first 50 results.\n\n---\n\n## Roadmap\n\nThis is **Phase 2** of a 6-phase project building toward a full\nAI-powered BTP operations platform.\n\n| Phase   | Status     | Description                                            |\n| ------- | ---------- | ------------------------------------------------------ |\n| Phase 1 | ✅ Done    | BTP auth + 2 tools + local MCP server                  |\n| Phase 2 | ✅ Done    | 5 tools + caching + pagination + tests + PyPI          |\n| Phase 3 | 🔜 Next    | LangGraph agent + FastAPI streaming + memory           |\n| Phase 4 | 📋 Planned | Chainlit prototype → React + UI5 Web Components on BTP |\n| Phase 5 | 📋 Planned | Multi-agent supervisor + RAG + proactive alerts        |\n| Phase 6 | 📋 Planned | Production hardening + CI/CD + BTP marketplace         |\n\n---\n\n## Coming soon (Phase 3)\n\n- LangGraph ReAct agent with multi-turn conversation memory\n- FastAPI SSE streaming endpoint\n- Code generation for recommended services\n  (CAP binding config, CLI commands, YAML manifests)\n\n---\n\n## Entitlements API (temporarily disabled)\n\nThe `get_btp_entitlements` tool requires a separate\n**Cloud Management Service** (CIS Central plan) service key.\nThe code is fully written and commented out — see\n`ENTITLEMENTS_SETUP.md` to enable it when ready.\n\n---\n\n## Contributing\n\nContributions are welcome! Please open an issue first to discuss\nwhat you'd like to change.\n\n```bash\ngit clone https://github.com/ABRANJAN07/btp-mcp-server.git\ncd btp-mcp-server\npip install -r requirements.txt\npytest tests/ -v   # make sure tests pass before submitting a PR\n```\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE) for details.\n\n---\n\n## Author\n\nBuilt by [Abhijeet Ranjan](https://linkedin.com/in/abhijeet-ranjan-06b58b137/)\nas part of a series on AI + SAP BTP integration.\n\nFollow the journey on LinkedIn for Phase 3 updates.\n",
  "bytes": 9550,
  "sha": "2169f35054ecdba7470e0d38f2b69694c1a1610e30845116f1f80cf87f7154bc",
  "repo_slug": "abranjan07/btp-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_abranjan07_btp_mcp_server_367fb0be/readme"
}