This MCP Server provides an LLM interface for interacting with your Cloud Foundry foundation. It was built with the Spring AI MCP Server Boot Starter.
This MCP Server now uses the Streamable HTTP Transport, instead of SSE. If you are connecting to this server with Tanzu Platform Chat, be sure to consult the README for instructions on configuring the service binding for Streamable transport.
./mvnw clean packageWhen deploying the MCP server to Cloud Foundry, use a variables file to inject credentials. This approach keeps sensitive credentials out of your manifest files and version control.
Create a file named vars.yaml with your Cloud Foundry credentials:
CF_APIHOST: api.sys.mycf.com
CF_USERNAME: your-cf-username
CF_PASSWORD: your-cf-password
CF_ORG: your-org
CF_SPACE: your-spaceIMPORTANT: The
vars.yamlfile contains sensitive credentials and should never be committed to Git. Add it to your.gitignorefile:echo "vars.yaml" >> .gitignore
Deploy using the --vars-file flag:
cf push --vars-file=vars.yamlThe manifest.yml references these variables using the ((variable-name)) syntax, which injects them as environment variables at deploy time.
You can publish this MCP server as a service in the Tanzu Platform marketplace using Tanzu Service Publisher. This allows other applications to bind to the MCP server and consume it as a service.
Before publishing, ensure:
- You have space developer privileges in the app's space
- The MCP server application is running
- A route is mapped to the app on the
apps.internaldomain using HTTP protocol
A service.yaml file is included in the root of this repository with the service configuration for publishing.
Use the Tanzu cf CLI to publish the app:
cf publish-service cloud-foundry-mcp-server -f service.yamlCheck the publishing status:
cf published-service cloud-foundry-mcp-serverWait until the status shows successful.
By default, new service offerings are disabled. An admin must enable access for the service to appear in the marketplace:
cf enable-service-access cloud-foundry-mcpOnce enabled, developers can create service instances:
cf create-service cloud-foundry-mcp default my-mcp-serviceAnd bind them to applications:
cf bind-service my-app my-mcp-serviceThis MCP server exposes the following Cloud Foundry operations as tools:
- applicationsList - List all applications in a space
- applicationDetails - Get detailed information about a specific application
- cloneApplication - Clone an existing application
- scaleApplication - Scale application instances, memory, or disk quota
- startApplication - Start a stopped application
- stopApplication - Stop a running application
- restartApplication - Restart an application
- deleteApplication - Delete an application
- organizationsList - List all organizations
- organizationDetails - Get details about a specific organization
- spacesList - List all spaces in an organization
- getSpaceQuota - Get quota information for a space
- createSpace - Create a new space
- deleteSpace - Delete a space
- renameSpace - Rename an existing space
- serviceInstancesList - List all service instances in a space
- serviceInstanceDetails - Get details about a specific service instance
- serviceOfferingsList - List available service offerings
- bindServiceInstance - Bind a service instance to an application
- unbindServiceInstance - Unbind a service instance from an application
- deleteServiceInstance - Delete a service instance
- routesList - List all routes in a space
- createRoute - Create a new route
- deleteRoute - Delete a specific route
- deleteOrphanedRoutes - Delete all unmapped routes
- mapRoute - Map a route to an application
- unmapRoute - Unmap a route from an application
- addNetworkPolicy - Create network policy between applications
- listNetworkPolicies - List all network policies
- removeNetworkPolicy - Remove network policy between applications
All tools support multi-context operations with optional organization and space parameters to target different environments.
