MCP Server for YugabyteDB Management
Interact with your YugabyteDB using the MCP server to monitor, configure, and manage deployments efficiently.
npx -y @yugabyte/yugabytedb-mcp-serverOverview
The Model Context Protocol (MCP) server for YugabyteDB provides a centralized API and control plane for inspecting, configuring, and operating YugabyteDB deployments. It exposes programmatic interfaces to observe cluster state, apply configuration changes, run maintenance operations, and collect diagnostics. The MCP server is intended to be used by operators, automation systems, and developer tools to integrate cluster management into CI/CD pipelines, monitoring dashboards, and orchestration systems.
Running an MCP server separates management logic from client tooling: instead of embedding operational workflows into many scripts or tools, you can call a single, well-defined service that understands the cluster model and enforces safe operations. This approach helps standardize workflows (health checks, rolling restarts, config drift remediation), improves observability, and can simplify role-based access to management operations.
Features
- Central API for cluster introspection (nodes, tablets, metrics, replication)
- Safe configuration rollouts and dynamic config application
- Diagnostic collection and log/metrics aggregation helpers
- Health checks and readiness probes for automation
- Pluggable authentication and role-based access control hooks
- Integration points for monitoring (Prometheus metrics) and alerting
- Can be run as a standalone process, container, or sidecar to orchestration systems
Installation / Configuration
Note: the repository includes build scripts and container artifacts. The examples below show typical steps: cloning, building, and running the server in a container.
Clone the repository:
Build (example using Maven or Gradle — check the repo for the actual build tool):
# If the project uses Maven
# Or if the project uses Gradle
Run the server locally using the provided binary or JAR:
# If the project produces a JAR
Run the server in Docker (example Dockerfile / image name is illustrative):
# Build image locally
# Run with a configuration volume
Example configuration (YAML):
server:
port: 8080
logLevel: INFO
storage:
provider: file
path: /var/lib/mcp/state
auth:
enabled: true
provider: oidc
yugabyte:
apiEndpoint: "https://yb-master.example.local:7000"
tls:
enabled: true
certFile: /etc/mcp/certs/tls.crt
keyFile: /etc/mcp/certs/tls.key
Systemd unit (example):
[Unit]
MCP Server for YugabyteDB
network.target
[Service]
/usr/local/bin/mcp-server --config /etc/mcp/mcp-server.yml
on-failure
mcp
[Install]
multi-user.target
Available Resources
- GitHub repository: https://github.com/yugabyte/yugabytedb-mcp-server
- Built-in API endpoints (typical):
- /health — health checks and readiness
- /api/v1/clusters — list and inspect clusters
- /api/v1/nodes — node-level information
- /api/v1/config — view/apply configuration
- /api/v1/diagnostics — request collection of logs/metrics
- Metrics endpoint for Prometheus scraping: /metrics
- Example configuration files are included in the repository under config/ or examples/
Refer to the repo README and the included OpenAPI/Swagger spec (if present) for exact API definitions and authentication configuration.
Use Cases
Cluster health monitoring and alerting
- Periodically call the /health and /api/v1/clusters endpoints from your monitoring stack. The MCP server can aggregate node statuses, report under-replicated tablets, and expose Prometheus metrics for alert rules.
- Example:
|
Safe configuration rollout
- Store cluster-wide configuration in the MCP server and use its apply operation to perform controlled rollouts (validate, stage, and apply). This centralizes configuration changes and reduces drift across nodes.
- Example:
Automated diagnostics for incident response
- On alert, trigger the diagnostics endpoint to collect logs, core dumps, and metrics snapshots from one or more nodes. The MCP server can package artifacts and upload them to an object store or make them downloadable.
- Example:
Orchestration and CI/CD integration
- Use the MCP server as a target in automation pipelines for tasks such as rolling upgrades, schema changes, or operator-driven maintenance windows. The server provides programmatic hooks to sequence operations safely.
RBAC and delegated operations
- Integrate with your identity provider and use the MCP server to expose limited management capabilities to application owners while keeping sensitive operations restricted to operators.
Examples and Tips
- Start small: deploy MCP server in a non-production environment and integrate it with monitoring to verify the telemetry and health endpoints.
- Secure the management plane: enable TLS and an authentication provider before exposing the MCP server beyond your internal network.
- Use the metrics endpoint for SLO dashboards and alerting; prefer aggregated metrics from the MCP server to reduce direct load on cluster nodes.
- Consult the repository for runtime flags, API versions, and sample manifests for Kubernetes or Docker Compose.
If you need API specifics (request/response schemas, auth flows, or exact endpoints), check the GitHub repository and the included OpenAPI/Swagger definitions in the codebase.