- Explore MCP Servers
- ob-operator-mcp-server
Ob Operator Mcp Server
What is Ob Operator Mcp Server
The OceanBase Kubernetes Control Tool (okctl) MCP Server is a server implementation that allows users to manage OceanBase clusters, tenants, and backup policies through a set of tool functions. It serves as an interface between clients and the command-line tool okctl, utilizing the MCP protocol to expose its capabilities.
Use cases
This tool is designed for administrators and developers looking to manage OceanBase databases efficiently. Use cases include creating and deleting clusters and tenants, scaling resources, managing backup policies, executing SQL commands, and upgrading components within an OceanBase environment.
How to use
To use the MCP Server, configure the server with the necessary environment settings and command line arguments. Launch it via the uv package manager, specifying tool options, and connect to the desired Kubernetes environment to facilitate operations on OceanBase clusters.
Key features
Key features include comprehensive cluster management (create, delete, scale, upgrade), tenant management (create, view, switch, activate), backup policy management (create, pause, resume), SQL operations (execute queries), and component management (install, update). Each module is built to interact seamlessly with the underlying okctl tool.
Where to use
The MCP Server is primarily used in Kubernetes environments that host OceanBase clusters, making it suitable for cloud-native applications, enterprise database management, and scenarios requiring robust and scalable database solutions.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Ob Operator Mcp Server
The OceanBase Kubernetes Control Tool (okctl) MCP Server is a server implementation that allows users to manage OceanBase clusters, tenants, and backup policies through a set of tool functions. It serves as an interface between clients and the command-line tool okctl, utilizing the MCP protocol to expose its capabilities.
Use cases
This tool is designed for administrators and developers looking to manage OceanBase databases efficiently. Use cases include creating and deleting clusters and tenants, scaling resources, managing backup policies, executing SQL commands, and upgrading components within an OceanBase environment.
How to use
To use the MCP Server, configure the server with the necessary environment settings and command line arguments. Launch it via the uv package manager, specifying tool options, and connect to the desired Kubernetes environment to facilitate operations on OceanBase clusters.
Key features
Key features include comprehensive cluster management (create, delete, scale, upgrade), tenant management (create, view, switch, activate), backup policy management (create, pause, resume), SQL operations (execute queries), and component management (install, update). Each module is built to interact seamlessly with the underlying okctl tool.
Where to use
The MCP Server is primarily used in Kubernetes environments that host OceanBase clusters, making it suitable for cloud-native applications, enterprise database management, and scenarios requiring robust and scalable database solutions.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
OceanBase Kubernetes Control Tool (okctl) MCP Server
English | 简体中文
Project Overview
This project is the MCP server implementation for the OceanBase Kubernetes Control Tool (okctl). It provides a set of tool functions for managing OceanBase clusters, tenants, and backup policies. These functions are implemented by calling the underlying okctl command-line tool and exposing these features to clients through the MCP protocol.
Functional Modules
This project includes the following main tools:
1. Cluster Management (clusters.py)
Provides functionality for creating, deleting, viewing, scaling, updating, and upgrading OceanBase clusters.
list_all_clusters()- List all OceanBase clustersshow_cluster()- Display detailed information of a specified clustercreate_cluster()- Create a new OceanBase clusterdelete_cluster()- Delete a specified OceanBase clusterscale_cluster()- Scale an OceanBase clusterupdate_cluster()- Update OceanBase cluster configurationupgrade_cluster()- Upgrade OceanBase cluster version
2. Tenant Management (tenants.py)
Provides functionality for creating, deleting, viewing, scaling, updating, and managing OceanBase tenants.
list_tenants()- List all tenantscreate_tenant()- Create a new tenantdelete_tenant()- Delete a specified tenantshow_tenant()- Display tenant detailed informationscale_tenant()- Scale tenant resourcesupdate_tenant()- Update tenant configurationupgrade_tenant()- Upgrade tenant versionchange_tenant_password()- Change tenant passwordactivate_tenant()- Activate standby tenantreplay_tenant_log()- Replay tenant logsswitchover_tenant()- Switch between primary and standby tenants
3. Backup Policy Management (backup_policy.py)
Provides functionality for creating, deleting, viewing, updating, and managing OceanBase backup policies.
list_backup_policies()- List all backup policiescreate_backup_policy()- Create a new backup policydelete_backup_policy()- Delete a specified backup policyshow_backup_policy()- Display backup policy detailed informationupdate_backup_policy()- Update backup policypause_backup_policy()- Pause backup policyresume_backup_policy()- Resume backup policy
4. SQL Operations (sql.py)
Provides functionality for configuring database connections and executing SQL queries on OceanBase clusters.
configure_cluster_connection()- Configure database connection to a cluster- Parameters: cluster_name, tenant_name (default: “sys”), namespace (default: “default”), user, password (if not provided, will use environment variable OB_CLUSTER_PASSWORD), port (default: 2881)
- Returns: Database connection configuration information
execute_cluster_sql()- Execute SQL queries on a cluster- Parameters: query, cluster_name (optional), tenant_name (default: “sys”), database (default: “oceanbase”), namespace (default: “default”)
- Returns: Query results
- Supports various SQL commands including SELECT, SHOW TABLES, SHOW COLUMNS, DESCRIBE, and DML statements
5. Component Management (components.py)
Provides functionality for installing, updating, and managing OceanBase components.
list_components()- List all installed componentsinstall_component()- Install a new componentupdate_component()- Update component
Development Environment Setup
Prerequisites
- Python 3.10 or higher installed
- uv package manager installed (uv official documentation)
- OceanBase Kubernetes Control Tool (okctl) installed and configured
- Kubernetes environment configured with access permissions to OceanBase clusters
Configuring the MCP Server
Command Line Arguments
-
--tools: Specify which tools to enable, comma separated. Options:all: Enable all tools (default)clusters: Enable cluster management tools onlytenants: Enable tenant management tools onlybackup_policy: Enable backup policy management tools onlycomponents: Enable component management tools onlysql: Enable SQL operation tools only
Example:
--tools=clusters,tenants,sql -
--use_sse: Use Server-Sent Events (SSE) transport instead of stdio -
--port: Specify the port for SSE transport (default: 8000)
Important Notes
- The server needs to run in an environment with access to the Kubernetes cluster
- All functions are implemented by calling the underlying okctl command-line tool, so ensure okctl is properly installed and configured
- Most functions provide a namespace parameter with a default value of “default”, which can be specified as needed
- Some operations (such as deleting clusters, deleting tenants) may be irreversible, please proceed with caution
- When executing SQL queries, it is recommended to provide a more precise prompt, otherwise it may return an error
- It is recommended to perform backups before executing important operations
Contributing
Issues and Pull Requests are welcome to improve this project.
License
This project is licensed under the Apache 2.0 License.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










