SAP BTP Cloud Foundry MCP Server

SAP BTP Cloud Foundry MCP Server

An MCP server for automating SAP BTP Cloud Foundry operations, providing tools for deploying, managing, and monitoring applications.

Category
访问服务器

README

SAP BTP Cloud Foundry MCP Server

npm version License: MIT

An MCP (Model Context Protocol) server for automating SAP BTP Cloud Foundry operations. This server provides comprehensive tools for deploying, managing, and monitoring applications on SAP BTP Cloud Foundry.

🚀 Quick Start

Installation

For Cline (VS Code)

  1. Install via NPM (recommended):

    npx sap-btp-cf-mcp-server
    
  2. Add to your Cline MCP settings (~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):

    {
      "mcpServers": {
        "sap-btp-cf": {
          "command": "npx",
          "args": ["-y", "sap-btp-cf-mcp-server"],
          "env": {
            "CF_API_ENDPOINT": "https://api.cf.us10.hana.ondemand.com",
            "CF_USERNAME": "your-username",
            "CF_PASSWORD": "your-password",
            "CF_ORG": "your-org",
            "CF_SPACE": "your-space"
          }
        }
      }
    }
    
  3. Restart VS Code

For Claude Desktop

  1. Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

    {
      "mcpServers": {
        "sap-btp-cf": {
          "command": "npx",
          "args": ["-y", "sap-btp-cf-mcp-server"],
          "env": {
            "CF_API_ENDPOINT": "https://api.cf.us10.hana.ondemand.com",
            "CF_USERNAME": "your-username",
            "CF_PASSWORD": "your-password",
            "CF_ORG": "your-org",
            "CF_SPACE": "your-space"
          }
        }
      }
    }
    
  2. Restart Claude Desktop

From Source

git clone https://github.com/Shreesha4994/sap-btp-cf-mcp-server.git
cd sap-btp-cf-mcp-server
npm install
npm run build

Features

Authentication & Session Management

  • cf_login - Authenticate with Cloud Foundry
  • cf_target - Switch organization and/or space
  • cf_get_target - Get current target information

Application Management

  • cf_push - Deploy applications
  • cf_app - Get application details
  • cf_apps - List all applications
  • cf_start - Start an application
  • cf_stop - Stop an application
  • cf_restart - Restart an application
  • cf_restage - Restage an application
  • cf_scale - Scale application resources
  • cf_delete_app - Delete an application
  • cf_logs - Get application logs

Environment Variables

  • cf_set_env - Set environment variable
  • cf_unset_env - Unset environment variable
  • cf_get_env - Get all environment variables

Service Management

  • cf_create_service - Create service instance
  • cf_delete_service - Delete service instance
  • cf_bind_service - Bind service to application
  • cf_unbind_service - Unbind service from application
  • cf_services - List all service instances
  • cf_service - Get service instance details
  • cf_marketplace - List available services

Organization & Space Management

  • cf_orgs - List all organizations
  • cf_spaces - List all spaces
  • cf_create_space - Create a new space

Route Management

  • cf_map_route - Map route to application
  • cf_unmap_route - Unmap route from application

Deployment Workflows

  • cf_deploy_workflow - Complete deployment workflow (push, bind services, configure, start)

Prerequisites

  • Cloud Foundry CLI installed and accessible in PATH
  • SAP BTP account with appropriate permissions
  • Node.js installed

Configuration

The server is configured in the MCP settings with the following environment variables:

{
  "sap-btp-cf": {
    "command": "node",
    "args": ["/path/to/sap-btp-cf-server/build/index.js"],
    "env": {
      "CF_API_ENDPOINT": "https://api.cf.us10.hana.ondemand.com",
      "CF_USERNAME": "your-username",
      "CF_PASSWORD": "your-password",
      "CF_ORG": "your-org",
      "CF_SPACE": "your-space"
    }
  }
}

Getting Your Credentials

  1. API Endpoint: Your region-specific CF API endpoint

    • US10: https://api.cf.us10.hana.ondemand.com
    • EU10: https://api.cf.eu10.hana.ondemand.com
    • Check your SAP BTP Cockpit for your specific endpoint
  2. Username/Password: Your SAP BTP credentials

    • Available from SAP BTP Cockpit
  3. Organization & Space: Your target org and space

    • Optional - can be specified in tool calls if not set as defaults

Usage Examples

Deploy an Application

Deploy my application located at ./my-app with 2 instances and 512M memory

This will use the cf_push tool.

Create and Bind Service

Create a HANA service instance called my-hana-db with plan hdi-shared, then bind it to my-app

This will use cf_create_service and cf_bind_service tools.

Complete Deployment Workflow

Deploy my-app from ./app-dir, bind services my-hana and my-xsuaa, and set environment variable NODE_ENV to production

This will use the cf_deploy_workflow tool for a complete automated deployment.

Scale Application

Scale my-app to 3 instances with 1GB memory

This will use the cf_scale tool.

View Logs

Show me the recent logs for my-app

This will use the cf_logs tool.

Development

Building

npm run build

Project Structure

sap-btp-cf-server/
├── src/
│   ├── index.ts          # Main MCP server
│   ├── cf-client.ts      # Cloud Foundry CLI wrapper
│   └── types.ts          # TypeScript type definitions
├── build/                # Compiled JavaScript
├── package.json
└── tsconfig.json

Benefits

  • Speed: Execute complex CF operations with simple commands
  • Error Prevention: Structured inputs with validation
  • Automation: Multi-step workflows in single operations
  • Consistency: Standardized deployment patterns
  • Integration: Seamless integration with other development tools

Troubleshooting

Server Not Connected

  • Verify the build path in MCP settings matches the compiled output location
  • Check that Node.js is installed and accessible
  • Ensure Cloud Foundry CLI is installed: cf --version

Authentication Errors

  • Verify your credentials are correct
  • Check your API endpoint matches your region
  • Ensure you have appropriate permissions in the org/space

Tool Execution Errors

  • Check CF CLI is working: cf target
  • Verify you're logged in: cf auth
  • Check application/service names are correct

📦 Installation from NPM

npm install -g sap-btp-cf-mcp-server

Or use directly with npx:

npx sap-btp-cf-mcp-server

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

Shreesha KJ

🙏 Acknowledgments

📊 Project Status

This project is actively maintained. Issues and feature requests are welcome!


Made with ❤️ for the SAP Developer Community

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选