MCP cldkctl Server (Testing Version)
A Model Context Protocol (MCP) server that provides full access to Cloudeka's cldkctl CLI functionality through Claude Desktop, Cursor, and other MCP-compatible clients. This is the testing version (mcp-cldkctl-t) for development and testing purposes.
Features
- Smart Authentication: Automatic environment fallback (production -> staging)
- Auto-Reauthentication: Handles token expiry automatically
- Complete API Coverage: All cldkctl endpoints available as MCP tools
- Persistent Caching: JWT tokens cached locally for performance
- Environment Management: Easy switching between production and staging
- Full Tool Suite: Kubernetes, billing, VMs, registry, notebooks, and more
Installation
From PyPI (Testing Version)
pip install mcp-cldkctl-t
# or
uvx mcp-cldkctl-t
From Source
git clone https://github.com/cloudeka/mcp-cldkctl.git
cd mcp-cldkctl
pip install -e .
# or
uv sync
Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
CLDKCTL_TOKEN |
Yes | - | Your cldkctl token (starts with cldkctl_) |
CLDKCTL_BASE_URL |
No | https://ai.cloudeka.id |
Base URL (auto-fallback to staging if production fails) |
CLDKCTL_DEFAULT_PROJECT_ID |
No | - | Default project ID for convenience |
Example Setup
Linux/macOS:
export CLDKCTL_TOKEN="cldkctl_your_token_here"
export CLDKCTL_BASE_URL="https://ai.cloudeka.id"
export CLDKCTL_DEFAULT_PROJECT_ID="your_project_id"
Windows:
set CLDKCTL_TOKEN=cldkctl_your_token_here
set CLDKCTL_BASE_URL=https://ai.cloudeka.id
set CLDKCTL_DEFAULT_PROJECT_ID=your_project_id
Usage
Running the Server
# Using uvx (recommended)
uvx mcp-cldkctl-t
# Direct execution
python -m mcp_cldkctl.server
# Using the installed script
mcp-cldkctl-t
Claude Desktop Configuration (Testing Version)
Add this to your Claude Desktop configuration:
{
"mcpServers": {
"cldkctl-test": {
"command": "uvx",
"args": ["mcp-cldkctl-t"],
"env": {
"CLDKCTL_TOKEN": "your_cldkctl_token_here",
"CLDKCTL_BASE_URL": "https://ai.cloudeka.id"
}
}
}
}
Cursor Configuration (Testing Version)
Add this to your Cursor settings:
{
"mcpServers": {
"cldkctl-test": {
"command": "uvx",
"args": ["mcp-cldkctl-t"],
"env": {
"CLDKCTL_TOKEN": "your_cldkctl_token_here"
}
}
}
}
Testing
The package includes several test files for different aspects:
test_auth.py- Basic authentication teststest_production_auth.py- Production environment auth teststest_staging_auth.py- Staging environment auth teststest_api_endpoint.py- API endpoint teststest_package.py- Package functionality tests
To run tests:
# Run all tests
pytest
# Run specific test file
pytest test_auth.py
# Run with verbose output
pytest -v
# Run with coverage
pytest --cov=mcp_cldkctl
Development
For development, install the package with development dependencies:
pip install -e ".[dev]"
Building and Publishing
Use the provided script to build and publish:
python build_and_publish.py
Debugging Tools
Several debugging scripts are available:
debug_auth.py- Debug authentication issuesdebug_production_vs_staging.py- Debug environment switching
Available Tools
Authentication & Environment
auth- Authenticate with your cldkctl tokenswitch_environment- Switch between production/stagingstatus- Check current environment and auth status
Balance & Billing
balance_detail- Get project balance detailsbilling_daily_cost- Get daily billing costsbilling_monthly_cost- Get monthly billing costsbilling_history- Get billing history
Kubernetes Management
k8s_pods- List Kubernetes podsk8s_deployments- List Kubernetes deploymentsk8s_services- List Kubernetes servicesk8s_configmaps- List Kubernetes configmapsk8s_secrets- List Kubernetes secrets
Project & Organization
project_list- List all projectsproject_detail- Get project detailsorg_detail- Get organization detailsorg_members- List organization membersprofile_detail- Get user profile
Virtual Machines
vm_list- List virtual machinesvm_detail- Get VM details
Container Registry
registry_list- List container registriesregistry_repositories- List registry repositories
Notebooks
notebook_list- List Deka notebooksnotebook_create- Create a new notebook
Vouchers & Tokens
voucher_list- List available vouchersvoucher_apply- Apply a voucher codetoken_list- List cldkctl tokenstoken_create- Create a new tokentoken_delete- Delete a token
Logs
audit_logs- Get audit logs
Environment Fallback
The MCP server automatically handles environment issues:
- Tries production first (
https://ai.cloudeka.id) - Detects database errors (missing
cldkctl_tokenstable) - Auto-fallbacks to staging (
https://staging.ai.cloudeka.id) - Caches the working environment for future requests
Manual Environment Switching
# Switch to staging
switch_environment(environment="staging")
# Switch to production
switch_environment(environment="production")
# Check current status
status()
Authentication Flow
- Initial Auth: Exchange cldkctl token for JWT
- Token Caching: JWT stored locally with 24-hour expiry
- Auto-Reauth: Automatically re-authenticate when token expires
- Environment Persistence: Remember which environment works
Example Usage
Basic Authentication
# Authenticate (auto-fallback if production fails)
auth(token="cldkctl_your_token_here")
# Check status
status()
Project Management
# List all projects
project_list()
# Get specific project details
project_detail(project_id="your_project_id")
Kubernetes Operations
# List pods in default namespace
k8s_pods(project_id="your_project_id")
# List deployments in specific namespace
k8s_deployments(project_id="your_project_id", namespace="kube-system")
Billing Queries
# Get daily costs
billing_daily_cost(project_id="your_project_id")
# Get billing history
billing_history(
project_id="your_project_id",
start_date="2024-01-01",
end_date="2024-01-31"
)
Troubleshooting
Common Issues
Authentication Failed
- Check your
CLDKCTL_TOKENis valid - Ensure token starts with
cldkctl_ - Try using staging environment manually
Production Database Error
- This is normal - the server auto-fallbacks to staging
- Check status to see which environment is active
Token Expired
- The server auto-reauthenticates
- Check status to verify authentication
Environment Issues
# Force staging environment
auth(token="your_token", force_staging=True)
# Check current environment
status()
Debug Mode
Run with debug output:
uvx mcp-cldkctl-t 2>&1 | tee debug.log
Version History
Current version: 0.1.36 (Testing)
License
MIT License
Metadata
Release files for mcp-cldkctl-t 0.1.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_cldkctl_t-0.1.23.tar.gz | 119.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_cldkctl_t-0.1.23-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 134.7 kB
Release files / mcp_cldkctl_t-0.1.23.tar.gz
| Download URL | mcp_cldkctl_t-0.1.23.tar.gz |
|---|---|
| Size | 119.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2998e919382fb17a269353b1cf06dc04acffa9252773f5f43ff61c1ab5686b7
|
|
BLAKE2b-256 checksum How to use checksums |
b25c8cf29398db58614bb10db0a1c4b4d35686550a006a0369d777481eb01bb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / mcp_cldkctl_t-0.1.23-py3-none-any.whl
| Download URL | mcp_cldkctl_t-0.1.23-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bcd99f8ff77abfe7e15999bc22b0ab097a03cc5c3427392070794c5733f1bf4a
|
|
BLAKE2b-256 checksum How to use checksums |
dda085a550d2f8894eef76517f13c10dcd839f8a260a9a6a10164e0e0c8f242e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|