OceanBase MCP Server for Database Tools
Optimize OceanBase management with MCP server for database tools, streamlining deployments, monitoring, and backups.
npx -y @oceanbase/mcp-oceanbaseOverview
The OceanBase MCP (Model Context Protocol) Server is a lightweight coordination service designed for database tooling around OceanBase. It provides a consistent context layer that tools can use to discover clusters, share operational metadata, orchestrate tasks (backups, upgrades, schema changes), and collect telemetry. By centralizing context and control, MCP reduces the complexity of running multiple OceanBase clusters and integrating third-party management tools.
MCP is intended for developers and SREs who build or run database automation, monitoring, and backup pipelines. It exposes programmatic APIs, a command-line client, and integrations for common observability stacks so that toolchains can reliably exchange operational state, artifacts, and control signals without bespoke point-to-point integrations.
Features
- Centralized context store for cluster metadata, credentials, and runbooks
- REST and gRPC APIs for programmatic access
- Lightweight CLI for common operations and debugging
- Pluggable storage backends (local filesystem, S3-compatible object stores)
- Authentication and token-based access control
- Metrics endpoint compatible with Prometheus
- Support for backup orchestration and retention policies
- Event/webhook delivery for automation and alerting
- Kubernetes-friendly deployment (manifests / Helm chart)
Installation / Configuration
Prerequisites: Docker or a Kubernetes cluster, and access to an object store (optional for backups).
Quick start using Docker:
# Pull and run the MCP server container
Build from source:
# Example: build a Go binary
Kubernetes (Helm values example):
replicaCount: 2
image:
repository: ghcr.io/oceanbase/mcp-oceanbase
tag: latest
service:
ports:
http: 8080
metrics: 9090
storage:
backend: s3
s3:
endpoint: s3.example.local
bucket: mcp-data
accessKey: AKIA...
secretKey: SECRET...
Example configuration (config/mcp.yml):
server:
listen: "0.0.0.0:8080"
tls:
enabled: false
auth:
token_secret: "replace-with-secure-secret"
token_ttl: 86400
storage:
backend: filesystem
filesystem:
dir: /var/lib/mcp
metrics:
enabled: true
listen: "0.0.0.0:9090"
Systemd service unit (optional):
[Unit]
MCP Server
network.target
[Service]
simple
/usr/local/bin/mcp-server --config /etc/mcp/mcp.yml
on-failure
[Install]
multi-user.target
Available Resources
- GitHub repository: https://github.com/oceanbase/mcp-oceanbase
- REST API endpoints:
- GET /api/v1/clusters — list clusters
- POST /api/v1/clusters — register a cluster
- POST /api/v1/backups — create backup job
- GET /api/v1/context/{id} — retrieve a context snapshot
- gRPC API: mirroring REST surface for high-throughput integrations
- CLI: mcpctl (list/register clusters, trigger backups, fetch context)
- Metrics: Prometheus-compatible endpoint at /metrics
- Webhooks: configure event delivery for job status changes
- SDKs / clients: community-provided examples (Go, Python) in the repo
Table: default ports
| Port | Purpose |
|---|---|
| 8080 | HTTP API |
| 9090 | Metrics (Prom) |
Use Cases
Automated backups with retention policies
- Register clusters and schedule backups through the API or CLI. MCP stores job definitions and coordinates the backup agents to ensure consistent snapshots and lifecycle (retention/cleanup).
- Example CLI:
Centralized monitoring and alert enrichment
- Collect cluster metadata and attach it to metrics and alerts. Monitoring systems (Prometheus, Grafana) can scrape MCP metrics and query context for additional labels (environment, owner, SLA).
- Example: alert rules can include owner contact metadata pulled from MCP.
Multi-cluster orchestration and rolling upgrades
- Use MCP to coordinate upgrade waves across multiple OceanBase clusters. Define waves as context objects and mark progress via the API to prevent overlapping disruptive operations.
Incident response and forensics
- Capture and store a context snapshot (configuration, topology, recent logs reference) when an incident occurs, then attach the snapshot ID to tickets or chat ops messages for rapid access.
- Example API call:
Integration with CI/CD for schema changes
- Coordinate schema migration jobs by registering plans and gating their execution on MCP-managed health checks and canary windows.
Getting Help and Next Steps
- Clone the repo and check the examples directory for sample configs and clients:
- https://github.com/oceanbase/mcp-oceanbase
- Consult the API docs served by the running instance at /docs or /openapi (if enabled).
- For production, enable TLS, configure token secrets, and use an object store for durable artifact storage.