0pens0/tanzu-mcp-server
If you are the rightful owner of tanzu-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Cloud Foundry MCP Server is a comprehensive Model Context Protocol server that provides AI-powered access to Cloud Foundry operations through specialized tools.
Cloud Foundry MCP Server
A comprehensive Model Context Protocol (MCP) server that provides AI-powered access to Cloud Foundry operations through 38 specialized tools. Built with Spring AI 1.1.0 GA and deployed on Cloud Foundry.
Cloud Foundry MCP Server - AI-powered Cloud Foundry operations via Model Context Protocol
🚀 Quick Start
Deploy the Server
- Build and deploy the MCP server to your Cloud Foundry foundation
- Configure your Cloud Foundry credentials in the manifest
- Get the deployed URL from
cf appscommand
MCP Client Configuration
Once deployed, configure your MCP client with the server URL:
{
"mcpServers": {
"tanzu-mcp": {
"disabled": false,
"timeout": 300,
"type": "streamable",
"url": "https://tanzu-mcp-server.apps.your-cf-domain.com/mcp",
"autoApprove": []
}
}
}
Replace your-mcp-server.apps.your-cf-domain.com with your actual deployed server URL.
🛠 Building & Deployment
Build the Server
./mvnw clean package -DskipTests
Deploy to Cloud Foundry
# Copy the template and configure with your credentials
cp manifest-template.yml manifest.yml
# Edit manifest.yml with your CF credentials
cf push tanzu-mcp-server
# Get the deployed URL
cf apps
# Look for your app and copy the URL (e.g., https://tanzu-mcp-server.apps.your-domain.com)
Local Development
# Run with local profile
./mvnw spring-boot:run -Dspring-boot.run.profiles=local
⚙️ Configuration
Environment Variables
CF_APIHOST=api.your-cf-domain.com
CF_USERNAME=your-username
CF_PASSWORD=your-password
CF_ORG=your-organization
CF_SPACE=your-space
Configuration Validation
The server includes automatic configuration validation on startup:
- Required: API host, username, and password must be configured
- Optional: Organization and space (warnings if not set)
- Startup Check: Validates CF connectivity and credentials
- Error Handling: Fails fast with clear error messages if configuration is invalid
Application Properties
spring.ai.mcp.server.name=tanzu-mcp
spring.ai.mcp.server.version=0.1.0
spring.ai.mcp.server.prompt-change-notification=false
spring.ai.mcp.server.resource-change-notification=false
spring.ai.mcp.server.protocol=streamable
management.endpoints.web.exposure.include=health,info,mappings
management.endpoint.health.show-details=always
logging.level.io.modelcontextprotocol=DEBUG
logging.level.org.springframework.ai.mcp=DEBUG
# Cloud Foundry Connection Settings
cf.connection.poolSize=20
cf.connection.keepAlive=true
cf.connection.timeout=30
cf.connection.readTimeout=60
# Cloud Foundry Retry Settings
cf.retry.maxAttempts=3
cf.retry.delay=2
# Cloud Foundry Token Refresh Settings (Note: PasswordGrantTokenProvider handles refresh automatically)
# cf.token.refreshThreshold=5
🛠 Capabilities
This MCP server exposes 38 Cloud Foundry operations as AI-powered tools:
Application Management (8 tools)
- applicationsList - List applications in a CF space
- applicationDetails - Get detailed app information
- pushApplication - Deploy JAR files to CF
- scaleApplication - Scale app instances, memory, disk
- startApplication - Start CF applications
- stopApplication - Stop running applications
- restartApplication - Restart applications
- deleteApplication - Delete applications
Organization & Space Management (8 tools)
- organizationsList - List all organizations
- organizationDetails - Get org details
- spacesList - List spaces in an org
- getSpaceQuota - Get space quota details
- createSpace - Create new spaces
- deleteSpace - Delete spaces
- renameSpace - Rename spaces
- deleteOrphanedRoutes - Clean up orphaned routes
Service Management (7 tools)
- serviceInstancesList - List service instances
- serviceInstanceDetails - Get service instance details
- serviceOfferingsList - List marketplace services
- createServiceInstance - Create new service instances
- bindServiceInstance - Bind services to apps
- unbindServiceInstance - Unbind services from apps
- deleteServiceInstance - Delete service instances
Route Management (6 tools)
- routesList - List routes in a space
- createRoute - Create new routes
- deleteRoute - Delete routes
- mapRoute - Map routes to applications
- unmapRoute - Unmap routes from applications
- deleteOrphanedRoutes - Clean up orphaned routes
Network Policy Management (3 tools)
- addNetworkPolicy - Add network policies between apps
- listNetworkPolicies - List network policies
- removeNetworkPolicy - Remove network policies
Application Cloning (1 tool)
- cloneApp - Clone existing applications with buildpack consistency
Target Management (3 tools)
- targetCf - Set the target organization and space for CF operations
- getCurrentTarget - Get the current target organization and space
- clearTarget - Clear the current target, reverting to configuration defaults
Configuration & Validation (1 tool)
- CfConfigurationValidator - Validates Cloud Foundry configuration on startup
🔧 Technical Details
- Spring AI Version: 1.1.0 (GA)
- Spring Boot Version: 3.4.2
- Java Version: 21
- Transport: HTTP Streamable
- Health Endpoint:
/actuator/health - Configuration: Environment variable-based CF credentials
- MCP Java SDK: v0.15.0 (included with Spring AI 1.1.0)
📊 Health Status
The server provides comprehensive health monitoring:
- Application Health: Memory, disk, CPU usage
- SSL/TLS Status: Certificate validation
- Cloud Foundry Connectivity: API endpoint health with automatic retry logic
- MCP Server Status: Tool registration and transport health
- Connection Pooling: Optimized connection management with keep-alive
- Token Management: Automatic UAA token handling to prevent session expiry
- Retry Logic: Automatic retry for transient network failures
🚀 Current Deployment
Status: ✅ Successfully Deployed and Running
URL: https://tanzu-mcp-server.apps.tp.penso.io
Organization: tanzu-platform-demo
Space: mcp-servers
Application: tanzu-mcp-server
Recent Updates (v0.1.0)
- ✅ Upgraded to Spring AI 1.1.0 GA - Latest stable release with enhanced observability, MCP Java SDK v0.15.0, and improved security integration
- ✅ Added Target Management Tools - New
targetCf,getCurrentTarget, andclearTargetoperations - ✅ Configuration Validation - Added startup validation for CF credentials and settings
- ✅ Enhanced Error Handling - Better validation and parameter processing
- ✅ Comprehensive Testing - Added unit tests for all new services
- ✅ Fixed critical service instance creation - Added missing
createServiceInstancemethod - ✅ Improved application push handling - Fixed hardcoded parameter issues
- ✅ Verified all 38 tools - Comprehensive testing of all MCP operations
- ✅ Successful deployment - Application running and healthy on Cloud Foundry
🔒 Security
- Credential Management: Environment variable-based configuration
- SSL/TLS: HTTPS endpoints for secure communication
- Authentication: Cloud Foundry UAA integration
- Authorization: CF role-based access control
🔐 Credential Security
Important: The manifest.yml file contains sensitive credentials and is excluded from git via .gitignore.
- Template: Use
manifest-template.ymlas a starting point - Local Configuration: Copy template and add your credentials
- Environment Variables: Credentials are passed via CF environment variables
- Never Commit: Actual manifest files with credentials should never be committed to git
📚 Documentation
- Release Notes:
- API Documentation: Comprehensive tool descriptions
- Configuration Guide: Setup and deployment instructions
- Troubleshooting: Common issues and solutions
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
📄 License
This project is licensed under the MIT License.
Built with ❤️ using Spring AI and Cloud Foundry