Introduction¶
What is MCP Lifecycle Operator?¶
The MCP Lifecycle Operator is a Kubernetes operator that automates the deployment and management of Model Context Protocol (MCP) servers. It provides a Kubernetes-native way to run MCP servers as production-ready services in your cluster.
API Resources¶
MCPServer¶
The core resource provided by this operator is MCPServer. It represents a deployed MCP server instance with the following key capabilities:
Source Configuration¶
Define where your MCP server container image comes from:
Server Configuration¶
Configure the server's networking, arguments, environment variables, and storage mounts:
spec:
config:
port: 8080 # Server port (required)
path: /mcp # HTTP path (default: /mcp)
arguments: # Command-line arguments
- --config
- /etc/mcp-config/config.toml
env: # Environment variables
- name: LOG_LEVEL
value: info
envFrom: # Load env vars from ConfigMaps/Secrets
- configMapRef:
name: mcp-config
Storage and Mounts¶
Mount ConfigMaps, Secrets, or EmptyDirs:
spec:
config:
storage:
- path: /etc/mcp
source:
type: ConfigMap
configMap:
name: mcp-server-config
- path: /tmp
permissions: ReadWrite
source:
type: EmptyDir
emptyDir:
sizeLimit: 100Mi
Runtime Configuration¶
Configure replicas, resource limits, health probes, and security:
spec:
runtime:
replicas: 2
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
health:
readinessProbe:
httpGet:
path: /healthz
port: 8080
security:
serviceAccountName: mcp-viewer
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
Status and Discovery¶
The operator automatically manages the server lifecycle and provides status information:
status:
deploymentName: my-mcp-server
serviceName: my-mcp-server
address:
url: http://my-mcp-server.default.svc.cluster.local:8080/mcp
conditions:
- type: Accepted
status: "True"
reason: Valid
- type: Ready
status: "True"
reason: Available
The address.url field provides the cluster-internal URL that other workloads can use to connect to the MCP server.
Architecture¶
graph TB
User[User] -->|kubectl apply| MCPServer[MCPServer CR]
MCPServer -->|Reconciles| Operator[MCP Lifecycle Operator]
Operator -->|Creates/Updates| Deployment[Deployment]
Operator -->|Creates/Updates| Service[Service]
Deployment -->|Manages| Pods[MCP Server Pods]
Service -->|Routes to| Pods
Operator -->|Updates| Status[Status with Address]
The operator watches for MCPServer resources and automatically:
- Creates a Deployment to run the MCP server containers
- Creates a Service for network access
- Manages updates and rollouts
- Reports status and connection information
- Cleans up resources on deletion
Next Steps¶
- Get Started: Follow the Quickstart Guide
- Examples: Check out the examples directory
- API Reference: See the API documentation for all available fields
- Complete Example: See the complete MCPServer sample for a YAML with every field
- Contributing: Read the Contributing Guide to get involved
- Community: Join SIG Apps meetings and discussions