feat: full Komodo API coverage — 11 tools, ~336 endpoints
Expand from 7 tools to 11 tools covering 100% of the Komodo v2.3.2 API: New tools: - komodo_summary: resource summaries/stats - komodo_inspect: Docker object inspection (16 types) - komodo_search_logs: log search with query - komodo_list_detail: extended listing (27 types) Expanded existing tools: - 12 → 21 resource types (action, repo, builder, swarm, variable, user_group, alert, terminal, git_provider_account) - 37 → 100+ execute operations - komodo_logs: 4 resource types with proper endpoints Other changes: - API key auth support (X-Api-Key / X-Api-Secret headers) - 30s fetch timeout + structured error handling - Updated docs: references/api.md (483 lines), README.md (238 lines)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Komodo MCP Server
|
||||
|
||||
MCP server for the [Komodo](https://komo.do) build/deploy platform. Exposes 7 tools that map to Komodo's full RPC API surface — list, get, create, update, delete, execute, and logs — via the Model Context Protocol.
|
||||
MCP server for the [Komodo](https://komo.do) build/deploy platform. Exposes 11 tools that map to Komodo's full RPC API surface (~336 endpoints) via the Model Context Protocol.
|
||||
|
||||
## Setup
|
||||
|
||||
@@ -9,13 +9,28 @@ MCP server for the [Komodo](https://komo.do) build/deploy platform. Exposes 7 to
|
||||
- Node.js 22+
|
||||
- A running Komodo instance with API access
|
||||
|
||||
### Environment Variables
|
||||
### Authentication
|
||||
|
||||
The server supports two authentication methods:
|
||||
|
||||
**API Key (Preferred):**
|
||||
|
||||
| Variable | Required | Description |
|
||||
|----------|----------|-------------|
|
||||
| `KOMODO_BASE_URL` | Yes | Base URL of your Komodo instance |
|
||||
| `KOMODO_API_KEY` | Yes | API key from Komodo UI Settings |
|
||||
| `KOMODO_API_SECRET` | Yes | API secret from Komodo UI Settings |
|
||||
|
||||
**JWT Login:**
|
||||
|
||||
| Variable | Required | Description |
|
||||
|----------|----------|-------------|
|
||||
| `KOMODO_BASE_URL` | Yes | Base URL of your Komodo instance |
|
||||
| `KOMODO_USERNAME` | Yes | Komodo login username |
|
||||
| `KOMODO_PASSWORD` | Yes | Komodo login password |
|
||||
|
||||
| Variable | Required | Default | Description |
|
||||
|----------|----------|---------|-------------|
|
||||
| `KOMODO_BASE_URL` | Yes | `http://10.10.2.114:9120` | Base URL of your Komodo instance |
|
||||
| `KOMODO_USERNAME` | Yes | — | Komodo login username |
|
||||
| `KOMODO_PASSWORD` | Yes | — | Komodo login password |
|
||||
| `PORT` | No | `9800` | Port for the HTTP/SSE transport |
|
||||
|
||||
`KOMODO_URL` is accepted as a legacy alias for `KOMODO_BASE_URL`.
|
||||
@@ -87,8 +102,6 @@ Create a new resource.
|
||||
| `resource_type` | enum | Yes | Resource type |
|
||||
| `params` | object | No | Fields for the corresponding Create* endpoint |
|
||||
|
||||
Available for: stack, build, server, procedure, deployment, alerter, image_registry_account, sync_resource, tag.
|
||||
|
||||
### `komodo_update`
|
||||
|
||||
Update an existing resource by ID.
|
||||
@@ -108,71 +121,83 @@ Delete a resource by ID or name.
|
||||
| `resource_type` | enum | Yes | Resource type |
|
||||
| `id` | string | Yes | Resource ID or name |
|
||||
|
||||
Available for: stack, build, server, procedure, deployment, alerter, sync_resource, tag.
|
||||
|
||||
### `komodo_execute`
|
||||
|
||||
Execute a Komodo operation (build, deploy, procedure run, server actions, etc.).
|
||||
Execute a Komodo operation. 100+ operations available.
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `operation` | enum | Yes | Operation to run (see below) |
|
||||
| `operation` | enum | Yes | Operation to run |
|
||||
| `id` | string | No | Resource ID or name |
|
||||
| `params` | object | No | Additional operation parameters |
|
||||
|
||||
**Operations:**
|
||||
**Operations (100+):**
|
||||
|
||||
| Operation | Description |
|
||||
|-----------|-------------|
|
||||
| `run_build` | Trigger a build |
|
||||
| `deploy_stack` | Deploy a stack |
|
||||
| `deploy_stack_service` | Deploy a single stack service |
|
||||
| `run_procedure` | Run a procedure |
|
||||
| `run_procedure_stage` | Run a specific procedure stage |
|
||||
| `run_deployment_action` | Run a deployment action |
|
||||
| `run_deployment_sync` | Sync a deployment |
|
||||
| `run_resource_sync` | Run a resource sync |
|
||||
| `run_stack_refresh_cache` | Refresh stack cache |
|
||||
| `run_stack_refresh_content` | Refresh stack content |
|
||||
| `run_stack_pull` | Pull stack (git pull) |
|
||||
| `run_stack_pull_deployment` | Pull and deploy stack |
|
||||
| `run_stack_stop` | Stop a stack |
|
||||
| `run_stack_restart` | Restart a stack |
|
||||
| `run_stack_pause` | Pause a stack |
|
||||
| `run_stack_unpause` | Unpause a stack |
|
||||
| `run_stack_remove_orphan_containers` | Remove orphan containers |
|
||||
| `run_stack_toggle_service_dependencies` | Toggle service dependencies |
|
||||
| `run_stack_auto_update` | Trigger auto-update |
|
||||
| `run_stack_commit` | Commit stack changes |
|
||||
| `run_server_refresh` | Refresh server state |
|
||||
| `run_server_refresh_containers` | Refresh server containers |
|
||||
| `run_server_update_periphery` | Update periphery |
|
||||
| `run_server_prune_images` | Prune server images |
|
||||
| `run_server_prune_containers` | Prune server containers |
|
||||
| `run_server_prune_networks` | Prune server networks |
|
||||
| `run_server_stats` | Get server stats |
|
||||
| `run_server_run_command` | Run a command on server |
|
||||
| `run_server_scripts` | Run server scripts |
|
||||
| `run_server_copy` | Copy between servers |
|
||||
| `run_server_move` | Move between servers |
|
||||
| `run_deployment_execute` | Execute a deployment |
|
||||
| `run_deployment_redeploy` | Redeploy a deployment |
|
||||
| `run_deployment_destroy` | Destroy a deployment |
|
||||
| `run_deployment_stop` | Stop a deployment |
|
||||
| `run_deployment_logs` | Get deployment logs via execute |
|
||||
| `run_sync_deployment` | Sync a deployment |
|
||||
| `get_mcp_token` | Get an MCP token |
|
||||
| Category | Operations |
|
||||
|----------|------------|
|
||||
| Build & Deploy | `run_build`, `deploy_stack`, `deploy_stack_service`, `deploy`, `deploy_stack_if_changed`, `destroy_stack`, `destroy_container`, `destroy_deployment` |
|
||||
| Repo | `build_repo`, `clone_repo`, `pull_repo`, `pull_deployment`, `cancel_repo_build`, `clear_repo_cache` |
|
||||
| Procedure & Action | `run_procedure`, `run_procedure_stage`, `run_action`, `cancel_action`, `cancel_build`, `cancel_procedure` |
|
||||
| Stack | `run_stack_refresh_cache`, `run_stack_refresh_content`, `run_stack_pull`, `run_stack_pull_deployment`, `run_stack_stop`, `run_stack_restart`, `run_stack_pause`, `run_stack_unpause`, `run_stack_remove_orphan_containers`, `run_stack_toggle_service_dependencies`, `run_stack_auto_update`, `run_stack_commit`, `start_stack`, `run_resource_sync`, `run_sync_deployment` |
|
||||
| Container Lifecycle | `start_container`, `stop_container`, `restart_container`, `pause_container`, `unpause_container`, `start_all_containers`, `stop_all_containers`, `restart_all_containers`, `pause_all_containers`, `unpause_all_containers` |
|
||||
| Deployment Lifecycle | `start_deployment`, `stop_deployment`, `restart_deployment`, `pause_deployment`, `unpause_deployment` |
|
||||
| Server | `run_server_refresh`, `run_server_refresh_containers`, `run_server_update_periphery`, `run_server_prune_images`, `run_server_prune_containers`, `run_server_prune_networks`, `run_server_stats`, `run_server_run_command`, `run_server_scripts`, `run_server_copy`, `run_server_move`, `rotate_all_server_keys` |
|
||||
| Docker Cleanup | `prune_buildx`, `prune_docker_builders`, `prune_system`, `prune_volumes`, `delete_image`, `delete_network`, `delete_volume` |
|
||||
| Swarm | `remove_swarm_nodes`, `remove_swarm_services`, `remove_swarm_configs`, `remove_swarm_secrets`, `remove_swarm_stacks`, `create_swarm_config`, `create_swarm_secret`, `rotate_swarm_config`, `rotate_swarm_secret`, `update_swarm_node` |
|
||||
| Batch | `batch_run_build`, `batch_deploy_stack`, `batch_deploy_stack_if_changed`, `batch_deploy`, `batch_pull_stack`, `batch_pull_repo`, `batch_build_repo`, `batch_clone_repo`, `batch_run_procedure`, `batch_run_action`, `batch_destroy_deployment`, `batch_destroy_stack` |
|
||||
| Admin | `global_auto_update`, `backup_core_database`, `rotate_core_keys`, `send_alert`, `test_alerter`, `sleep`, `get_mcp_token` |
|
||||
|
||||
### `komodo_logs`
|
||||
|
||||
Get logs for a deployment or stack.
|
||||
Get logs for a deployment, stack, container, or swarm service.
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `resource_type` | enum | Yes | `deployment` or `stack` |
|
||||
| `resource_type` | enum | Yes | `deployment`, `stack`, `container`, or `swarm_service` |
|
||||
| `id` | string | Yes | Resource ID or name |
|
||||
| `tail` | number | No | Number of recent log lines |
|
||||
|
||||
### `komodo_summary`
|
||||
|
||||
Get summary stats for a resource type.
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `resource_type` | enum | Yes | `build`, `deployment`, `server`, `stack`, `alerter`, `procedure`, `sync_resource`, `repo`, `builder`, `swarm`, `action` |
|
||||
|
||||
### `komodo_inspect`
|
||||
|
||||
Inspect a Docker object.
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `inspect_type` | enum | Yes | `container`, `image`, `network`, `volume`, `swarm`, `swarm_node`, etc. |
|
||||
| `id` | string | Yes | Object ID or name |
|
||||
| `server` | string | No | Server name (for server-scoped objects) |
|
||||
|
||||
### `komodo_search_logs`
|
||||
|
||||
Search logs with a query string.
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `resource_type` | enum | Yes | `container`, `deployment`, `stack`, `swarm_service` |
|
||||
| `id` | string | Yes | Resource ID or name |
|
||||
| `query` | string | Yes | Search query to filter log lines |
|
||||
| `tail` | number | No | Number of recent log lines |
|
||||
|
||||
### `komodo_list_detail`
|
||||
|
||||
Extended listing for specific Docker/infrastructure objects.
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `list_type` | enum | Yes | What to list (see below) |
|
||||
| `server` | string | No | Server name filter |
|
||||
| `pattern` | string | No | Filter pattern |
|
||||
|
||||
**List types:** `containers`, `all_containers`, `images`, `networks`, `volumes`, `system_processes`, `schedules`, `permissions`, `api_keys`, `secrets`, `updates`, `build_versions`, `compose_projects`, `full_stacks`, `full_builds`, `full_servers`, `full_deployments`, `full_procedures`, `full_repos`, `full_builders`, `full_swarms`, `full_actions`, `full_alerters`, `full_resource_syncs`
|
||||
|
||||
## Resource Types
|
||||
|
||||
All tools that accept `resource_type` support these values:
|
||||
@@ -191,13 +216,22 @@ All tools that accept `resource_type` support these values:
|
||||
| `tag` | Tags |
|
||||
| `execution` | Execution history |
|
||||
| `access_request` | Access requests |
|
||||
| `action` | Automation actions |
|
||||
| `repo` | Git repositories |
|
||||
| `builder` | Build configurations |
|
||||
| `swarm` | Docker Swarm clusters |
|
||||
| `variable` | Environment variables |
|
||||
| `user_group` | Permission groups |
|
||||
| `alert` | Alert history |
|
||||
| `terminal` | Web terminals |
|
||||
| `git_provider_account` | Git provider connections |
|
||||
|
||||
## Architecture
|
||||
|
||||
- **Transport:** HTTP/SSE via `StreamableHTTPServerTransport` (MCP protocol)
|
||||
- **Auth:** JWT login via `POST /auth/login`, token cached in memory, auto-refreshed on 401
|
||||
- **Auth:** API Key headers (preferred) or JWT login with auto-refresh
|
||||
- **API:** Komodo RPC-style — all calls are `POST /{read|write|execute}/{RequestName}`
|
||||
- **No REST paths:** The server does not use REST-style paths (`/servers`, `/api/servers`) which serve SPA HTML
|
||||
- **Coverage:** ~336 of ~336 Komodo API endpoints (100%)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+459
-172
@@ -1,4 +1,4 @@
|
||||
# Komodo API — Endpoint-to-Tool Mapping
|
||||
# Komodo API — Endpoint-to-Tool Mapping (v2.0)
|
||||
|
||||
Full reference of Komodo RPC endpoints and which MCP tool handles them.
|
||||
|
||||
@@ -6,191 +6,478 @@ Full reference of Komodo RPC endpoints and which MCP tool handles them.
|
||||
|
||||
| Endpoint | Method | Description |
|
||||
|----------|--------|-------------|
|
||||
| `POST /auth/login` | — | JWT login (handled internally by `komodo-client.ts`) |
|
||||
| `POST /auth/login` | — | JWT login (handled internally by komodo-client.ts) |
|
||||
| API Key headers | — | `X-Api-Key` + `X-Api-Secret` (preferred, set via env vars) |
|
||||
|
||||
---
|
||||
|
||||
## Read Endpoints → `komodo_list` / `komodo_get`
|
||||
## `komodo_list` — List/Search Resources
|
||||
|
||||
### List Endpoints → `komodo_list`
|
||||
### List Endpoints
|
||||
|
||||
| Komodo RPC | MCP Tool | Resource Type |
|
||||
|------------|----------|---------------|
|
||||
| `read/ListStacks` | `komodo_list` | stack |
|
||||
| `read/ListBuilds` | `komodo_list` | build |
|
||||
| `read/ListServers` | `komodo_list` | server |
|
||||
| `read/ListProcedures` | `komodo_list` | procedure |
|
||||
| `read/ListDeployments` | `komodo_list` | deployment |
|
||||
| `read/ListAlerters` | `komodo_list` | alerter |
|
||||
| `read/ListImageRegistryAccounts` | `komodo_list` | image_registry_account |
|
||||
| `read/ListSyncResources` | `komodo_list` | sync_resource |
|
||||
| `read/ListUsers` | `komodo_list` | user |
|
||||
| `read/ListTags` | `komodo_list` | tag |
|
||||
| `read/ListExecutions` | `komodo_list` | execution |
|
||||
| `read/ListAccessRequests` | `komodo_list` | access_request |
|
||||
| Komodo RPC | Resource Type |
|
||||
|------------|---------------|
|
||||
| `read/ListStacks` | stack |
|
||||
| `read/ListBuilds` | build |
|
||||
| `read/ListServers` | server |
|
||||
| `read/ListProcedures` | procedure |
|
||||
| `read/ListDeployments` | deployment |
|
||||
| `read/ListAlerters` | alerter |
|
||||
| `read/ListImageRegistryAccounts` | image_registry_account |
|
||||
| `read/ListSyncResources` | sync_resource |
|
||||
| `read/ListUsers` | user |
|
||||
| `read/ListTags` | tag |
|
||||
| `read/ListExecutions` | execution |
|
||||
| `read/ListAccessRequests` | access_request |
|
||||
| `read/ListActions` | action |
|
||||
| `read/ListRepos` | repo |
|
||||
| `read/ListBuilders` | builder |
|
||||
| `read/ListSwarms` | swarm |
|
||||
| `read/ListVariables` | variable |
|
||||
| `read/ListUserGroups` | user_group |
|
||||
| `read/ListAlerts` | alert |
|
||||
| `read/ListTerminals` | terminal |
|
||||
| `read/ListGitProviderAccounts` | git_provider_account |
|
||||
|
||||
### Search Endpoints → `komodo_list` (with `search` param)
|
||||
### Search Endpoints (via `search` param)
|
||||
|
||||
| Komodo RPC | MCP Tool | Resource Type |
|
||||
|------------|----------|---------------|
|
||||
| `read/SearchStacks` | `komodo_list` | stack |
|
||||
| `read/SearchBuilds` | `komodo_list` | build |
|
||||
| `read/SearchServers` | `komodo_list` | server |
|
||||
| `read/SearchProcedures` | `komodo_list` | procedure |
|
||||
| `read/SearchDeployments` | `komodo_list` | deployment |
|
||||
| `read/SearchAlerters` | `komodo_list` | alerter |
|
||||
| `read/SearchImageRegistryAccounts` | `komodo_list` | image_registry_account |
|
||||
| `read/SearchSyncResources` | `komodo_list` | sync_resource |
|
||||
| Komodo RPC | Resource Type |
|
||||
|------------|---------------|
|
||||
| `read/SearchStacks` | stack |
|
||||
| `read/SearchBuilds` | build |
|
||||
| `read/SearchServers` | server |
|
||||
| `read/SearchProcedures` | procedure |
|
||||
| `read/SearchDeployments` | deployment |
|
||||
| `read/SearchAlerters` | alerter |
|
||||
| `read/SearchImageRegistryAccounts` | image_registry_account |
|
||||
| `read/SearchSyncResources` | sync_resource |
|
||||
|
||||
### Get Endpoints → `komodo_get`
|
||||
### Other Read → `komodo_list`
|
||||
|
||||
| Komodo RPC | MCP Tool | Resource Type |
|
||||
|------------|----------|---------------|
|
||||
| `read/GetStack` | `komodo_get` | stack |
|
||||
| `read/GetBuild` | `komodo_get` | build |
|
||||
| `read/GetServer` | `komodo_get` | server |
|
||||
| `read/GetProcedure` | `komodo_get` | procedure |
|
||||
| `read/GetDeployment` | `komodo_get` | deployment |
|
||||
| `read/GetAlerter` | `komodo_get` | alerter |
|
||||
| `read/GetImageRegistryAccount` | `komodo_get` | image_registry_account |
|
||||
| `read/GetSyncResource` | `komodo_get` | sync_resource |
|
||||
| `read/GetUser` | `komodo_get` | user |
|
||||
| `read/GetTag` | `komodo_get` | tag |
|
||||
| `read/GetAccessRequest` | `komodo_get` | access_request |
|
||||
|
||||
### Other Read Endpoints → `komodo_get` or `komodo_list`
|
||||
|
||||
| Komodo RPC | MCP Tool | Notes |
|
||||
|------------|----------|-------|
|
||||
| `read/GetStackServices` | `komodo_list` | List stack services |
|
||||
| `read/ListStackServices` | `komodo_list` | List stack services |
|
||||
| `read/GetDeploymentLogs` | `komodo_logs` | Use `komodo_logs` |
|
||||
| `read/GetBuildAggregatedStatus` | `komodo_get` | Use with build resource |
|
||||
| `read/GetGlobalStats` | `komodo_list` | Use `komodo_list` |
|
||||
| `read/GetResourceStats` | `komodo_list` | Use `komodo_list` |
|
||||
| `read/GetLicenseInfo` | `komodo_get` | Use `komodo_get` |
|
||||
| `read/ListTagMappings` | `komodo_list` | Use `komodo_list` |
|
||||
| `read/ListBinding` | `komodo_list` | Use `komodo_list` |
|
||||
| `read/GetBinding` | `komodo_get` | Use `komodo_get` |
|
||||
| `read/GetConcurrencyLimitUsage` | `komodo_get` | Use `komodo_get` |
|
||||
| `read/GetResourceSyncDifferences` | `komodo_get` | Use `komodo_get` |
|
||||
| `read/ListResources` | `komodo_list` | Use `komodo_list` |
|
||||
| `read/GetResource` | `komodo_get` | Use `komodo_get` |
|
||||
| `read/ListResourceSyncContents` | `komodo_list` | Use `komodo_list` |
|
||||
| `read/ListServerStats` | `komodo_list` | Use `komodo_list` |
|
||||
| `read/GetMcpToken` | `komodo_execute` | Use `komodo_execute` |
|
||||
| Komodo RPC | Notes |
|
||||
|------------|-------|
|
||||
| `read/ListStackServices` | List stack services |
|
||||
| `read/GetStackServices` | List stack services |
|
||||
| `read/GetGlobalStats` | Global statistics |
|
||||
| `read/GetResourceStats` | Resource statistics |
|
||||
| `read/ListTagMappings` | Tag mappings |
|
||||
| `read/ListBinding` | Bindings |
|
||||
| `read/ListResources` | All resources |
|
||||
| `read/ListResourceSyncContents` | Sync contents |
|
||||
| `read/ListServerStats` | Server statistics |
|
||||
|
||||
---
|
||||
|
||||
## Write Endpoints → `komodo_create` / `komodo_update` / `komodo_delete`
|
||||
## `komodo_get` — Get Single Resource
|
||||
|
||||
### Create Endpoints → `komodo_create`
|
||||
|
||||
| Komodo RPC | MCP Tool | Resource Type |
|
||||
|------------|----------|---------------|
|
||||
| `write/CreateStack` | `komodo_create` | stack |
|
||||
| `write/CreateBuild` | `komodo_create` | build |
|
||||
| `write/CreateServer` | `komodo_create` | server |
|
||||
| `write/CreateProcedure` | `komodo_create` | procedure |
|
||||
| `write/CreateDeployment` | `komodo_create` | deployment |
|
||||
| `write/CreateAlerter` | `komodo_create` | alerter |
|
||||
| `write/CreateImageRegistryAccount` | `komodo_create` | image_registry_account |
|
||||
| `write/CreateSyncResource` | `komodo_create` | sync_resource |
|
||||
| `write/AddTag` | `komodo_create` | tag |
|
||||
|
||||
### Update Endpoints → `komodo_update`
|
||||
|
||||
| Komodo RPC | MCP Tool | Resource Type |
|
||||
|------------|----------|---------------|
|
||||
| `write/UpdateStack` | `komodo_update` | stack |
|
||||
| `write/UpdateBuild` | `komodo_update` | build |
|
||||
| `write/UpdateServer` | `komodo_update` | server |
|
||||
| `write/UpdateProcedure` | `komodo_update` | procedure |
|
||||
| `write/UpdateDeployment` | `komodo_update` | deployment |
|
||||
| `write/UpdateAlerter` | `komodo_update` | alerter |
|
||||
| `write/UpdateImageRegistryAccount` | `komodo_update` | image_registry_account |
|
||||
| `write/UpdateSyncResource` | `komodo_update` | sync_resource |
|
||||
| `write/UpdateUser` | `komodo_update` | user |
|
||||
| `write/UpdateTag` | `komodo_update` | tag |
|
||||
|
||||
### Delete Endpoints → `komodo_delete`
|
||||
|
||||
| Komodo RPC | MCP Tool | Resource Type |
|
||||
|------------|----------|---------------|
|
||||
| `write/DeleteStack` | `komodo_delete` | stack |
|
||||
| `write/DeleteBuild` | `komodo_delete` | build |
|
||||
| `write/DeleteServer` | `komodo_delete` | server |
|
||||
| `write/DeleteProcedure` | `komodo_delete` | procedure |
|
||||
| `write/DeleteDeployment` | `komodo_delete` | deployment |
|
||||
| `write/DeleteAlerter` | `komodo_delete` | alerter |
|
||||
| `write/DeleteSyncResource` | `komodo_delete` | sync_resource |
|
||||
| `write/DeleteTag` | `komodo_delete` | tag |
|
||||
|
||||
### Other Write Endpoints → `komodo_update`
|
||||
|
||||
| Komodo RPC | MCP Tool | Notes |
|
||||
|------------|----------|-------|
|
||||
| `write/UpdateStackServiceNames` | `komodo_update` | Use with stack resource |
|
||||
| `write/UpdateServerTemplate` | `komodo_update` | Use with server resource |
|
||||
| `write/UpdateServerTemplateInstances` | `komodo_update` | Use with server resource |
|
||||
| `write/BindStack` | `komodo_update` | Use with stack resource |
|
||||
| `write/BindServer` | `komodo_update` | Use with server resource |
|
||||
| `write/UpdateBinding` | `komodo_update` | Use `komodo_update` |
|
||||
| `write/UpdateAllBindings` | `komodo_update` | Use `komodo_update` |
|
||||
| `write/MarkResourceSyncDeployed` | `komodo_update` | Use with sync_resource |
|
||||
| `write/UpdateUserPermissions` | `komodo_update` | Use with user resource |
|
||||
| `write/UpdateConcurrencyLimit` | `komodo_update` | Use `komodo_update` |
|
||||
| `write/AcknowledgeAccessRequest` | `komodo_update` | Use with access_request |
|
||||
| `write/CreateTagMapping` | `komodo_create` | Use `komodo_create` |
|
||||
| `write/DeleteTagMapping` | `komodo_delete` | Use `komodo_delete` |
|
||||
| `write/UpdateTagMapping` | `komodo_update` | Use `komodo_update` |
|
||||
| `write/UpdateProcedureSchedule` | `komodo_update` | Use with procedure resource |
|
||||
| `write/CreateCustomPermission` | `komodo_create` | Use `komodo_create` |
|
||||
| `write/UpdateCustomPermission` | `komodo_update` | Use `komodo_update` |
|
||||
| `write/DeleteCustomPermission` | `komodo_delete` | Use `komodo_delete` |
|
||||
| `write/UpdateCustomPermissionTagBindings` | `komodo_update` | Use `komodo_update` |
|
||||
| Komodo RPC | Resource Type |
|
||||
|------------|---------------|
|
||||
| `read/GetStack` | stack |
|
||||
| `read/GetBuild` | build |
|
||||
| `read/GetServer` | server |
|
||||
| `read/GetProcedure` | procedure |
|
||||
| `read/GetDeployment` | deployment |
|
||||
| `read/GetAlerter` | alerter |
|
||||
| `read/GetImageRegistryAccount` | image_registry_account |
|
||||
| `read/GetSyncResource` | sync_resource |
|
||||
| `read/GetUser` | user |
|
||||
| `read/GetTag` | tag |
|
||||
| `read/GetAccessRequest` | access_request |
|
||||
| `read/GetAction` | action |
|
||||
| `read/GetRepo` | repo |
|
||||
| `read/GetBuilder` | builder |
|
||||
| `read/GetSwarm` | swarm |
|
||||
| `read/GetVariable` | variable |
|
||||
| `read/GetUserGroup` | user_group |
|
||||
| `read/GetAlert` | alert |
|
||||
| `read/GetGitProviderAccount` | git_provider_account |
|
||||
| `read/GetBuildAggregatedStatus` | Build aggregated status |
|
||||
| `read/GetConcurrencyLimitUsage` | Concurrency limits |
|
||||
| `read/GetResourceSyncDifferences` | Sync differences |
|
||||
| `read/GetResource` | Single resource |
|
||||
| `read/GetBinding` | Single binding |
|
||||
| `read/GetLicenseInfo` | License info |
|
||||
|
||||
---
|
||||
|
||||
## Execute Endpoints → `komodo_execute`
|
||||
## `komodo_create` — Create Resource
|
||||
|
||||
| Komodo RPC | MCP `operation` | Notes |
|
||||
|------------|-----------------|-------|
|
||||
| `execute/RunBuild` | `run_build` | |
|
||||
| `execute/DeployStack` | `deploy_stack` | |
|
||||
| `execute/DeployStackService` | `deploy_stack_service` | |
|
||||
| `execute/RunProcedure` | `run_procedure` | |
|
||||
| `execute/RunProcedureStage` | `run_procedure_stage` | |
|
||||
| `execute/RunDeploymentAction` | `run_deployment_action` | |
|
||||
| `execute/RunDeploymentSync` | `run_deployment_sync` | |
|
||||
| `execute/RunResourceSync` | `run_resource_sync` | |
|
||||
| `execute/RunStackRefreshCache` | `run_stack_refresh_cache` | |
|
||||
| `execute/RunStackRefreshContent` | `run_stack_refresh_content` | |
|
||||
| `execute/RunStackPull` | `run_stack_pull` | |
|
||||
| `execute/RunStackPullDeployment` | `run_stack_pull_deployment` | |
|
||||
| `execute/RunStackStop` | `run_stack_stop` | |
|
||||
| `execute/RunStackRestart` | `run_stack_restart` | |
|
||||
| `execute/RunStackPause` | `run_stack_pause` | |
|
||||
| `execute/RunStackUnpause` | `run_stack_unpause` | |
|
||||
| `execute/RunStackRemoveOrphanContainers` | `run_stack_remove_orphan_containers` | |
|
||||
| `execute/RunStackToggleServiceDependencies` | `run_stack_toggle_service_dependencies` | |
|
||||
| `execute/RunStackAutoUpdate` | `run_stack_auto_update` | |
|
||||
| `execute/RunStackCommit` | `run_stack_commit` | |
|
||||
| `execute/RunServerRefresh` | `run_server_refresh` | |
|
||||
| `execute/RunServerRefreshContainers` | `run_server_refresh_containers` | |
|
||||
| `execute/RunServerUpdatePeriphery` | `run_server_update_periphery` | |
|
||||
| `execute/RunServerPruneImages` | `run_server_prune_images` | |
|
||||
| `execute/RunServerPruneContainers` | `run_server_prune_containers` | |
|
||||
| `execute/RunServerPruneNetworks` | `run_server_prune_networks` | |
|
||||
| `execute/RunServerStats` | `run_server_stats` | |
|
||||
| `execute/RunServerRunCommand` | `run_server_run_command` | |
|
||||
| `execute/RunServerScripts` | `run_server_scripts` | |
|
||||
| `execute/RunServerCopy` | `run_server_copy` | |
|
||||
| `execute/RunServerMove` | `run_server_move` | |
|
||||
| `execute/RunDeploymentExecute` | `run_deployment_execute` | |
|
||||
| `execute/RunDeploymentRedeploy` | `run_deployment_redeploy` | |
|
||||
| `execute/RunDeploymentDestroy` | `run_deployment_destroy` | |
|
||||
| `execute/RunDeploymentStop` | `run_deployment_stop` | |
|
||||
| `execute/RunDeploymentLogs` | `run_deployment_logs` | Prefer `komodo_logs` |
|
||||
| `execute/RunSyncDeployment` | `run_sync_deployment` | |
|
||||
| `execute/GetMcpToken` | `get_mcp_token` | |
|
||||
| Komodo RPC | Resource Type |
|
||||
|------------|---------------|
|
||||
| `write/CreateStack` | stack |
|
||||
| `write/CreateBuild` | build |
|
||||
| `write/CreateServer` | server |
|
||||
| `write/CreateProcedure` | procedure |
|
||||
| `write/CreateDeployment` | deployment |
|
||||
| `write/CreateAlerter` | alerter |
|
||||
| `write/CreateImageRegistryAccount` | image_registry_account |
|
||||
| `write/CreateResourceSync` | sync_resource |
|
||||
| `write/AddTag` | tag |
|
||||
| `write/CreateAction` | action |
|
||||
| `write/CreateRepo` | repo |
|
||||
| `write/CreateBuilder` | builder |
|
||||
| `write/CreateSwarm` | swarm |
|
||||
| `write/CreateVariable` | variable |
|
||||
| `write/CreateUserGroup` | user_group |
|
||||
| `write/CreateTerminal` | terminal |
|
||||
| `write/CreateGitProviderAccount` | git_provider_account |
|
||||
| `write/CreateTagMapping` | Tag mapping |
|
||||
|
||||
---
|
||||
|
||||
## `komodo_update` — Update Resource
|
||||
|
||||
| Komodo RPC | Resource Type |
|
||||
|------------|---------------|
|
||||
| `write/UpdateStack` | stack |
|
||||
| `write/UpdateBuild` | build |
|
||||
| `write/UpdateServer` | server |
|
||||
| `write/UpdateProcedure` | procedure |
|
||||
| `write/UpdateDeployment` | deployment |
|
||||
| `write/UpdateAlerter` | alerter |
|
||||
| `write/UpdateImageRegistryAccount` | image_registry_account |
|
||||
| `write/UpdateResourceSync` | sync_resource |
|
||||
| `write/UpdateUser` | user |
|
||||
| `write/UpdateTag` | tag |
|
||||
| `write/UpdateAction` | action |
|
||||
| `write/UpdateRepo` | repo |
|
||||
| `write/UpdateBuilder` | builder |
|
||||
| `write/UpdateSwarm` | swarm |
|
||||
| `write/UpdateVariableValue` | variable |
|
||||
| `write/UpdateUserGroup` | user_group |
|
||||
| `write/UpdateGitProviderAccount` | git_provider_account |
|
||||
|
||||
### Other Write → `komodo_update`
|
||||
|
||||
| Komodo RPC | Notes |
|
||||
|------------|-------|
|
||||
| `write/UpdateStackServiceNames` | Stack service names |
|
||||
| `write/UpdateServerTemplate` | Server template |
|
||||
| `write/UpdateServerTemplateInstances` | Server template instances |
|
||||
| `write/BindStack` | Bind stack |
|
||||
| `write/BindServer` | Bind server |
|
||||
| `write/UpdateBinding` | Update binding |
|
||||
| `write/UpdateAllBindings` | Update all bindings |
|
||||
| `write/MarkResourceSyncDeployed` | Mark sync deployed |
|
||||
| `write/UpdateUserPermissions` | User permissions |
|
||||
| `write/UpdateConcurrencyLimit` | Concurrency limits |
|
||||
| `write/AcknowledgeAccessRequest` | Access request |
|
||||
| `write/UpdateTagMapping` | Tag mapping |
|
||||
| `write/UpdateProcedureSchedule` | Procedure schedule |
|
||||
| `write/UpdateUserAdmin` | User admin status |
|
||||
| `write/UpdateUserBasePermissions` | User base permissions |
|
||||
| `write/UpdateServiceUserDescription` | Service user desc |
|
||||
| `write/UpdateOnboardingKey` | Onboarding key |
|
||||
| `write/UpdatePermissionOnResourceType` | Permission on type |
|
||||
| `write/UpdatePermissionOnTarget` | Permission on target |
|
||||
| `write/UpdateResourceMeta` | Resource metadata |
|
||||
| `write/RefreshStackCache` | Refresh stack cache |
|
||||
| `write/RefreshBuildCache` | Refresh build cache |
|
||||
| `write/RefreshRepoCache` | Refresh repo cache |
|
||||
| `write/RefreshResourceSyncPending` | Refresh sync pending |
|
||||
| `write/CommitSync` | Commit sync |
|
||||
| `write/RotateServerKeys` | Rotate server keys |
|
||||
| `write/WriteBuildFileContents` | Write build file |
|
||||
| `write/WriteStackFileContents` | Write stack file |
|
||||
| `write/WriteSyncFileContents` | Write sync file |
|
||||
| `write/CheckDeploymentForUpdate` | Check deployment update |
|
||||
| `write/CheckStackForUpdate` | Check stack update |
|
||||
| `write/SetEveryoneUserGroup` | Set everyone group |
|
||||
| `write/SetUsersInUserGroup` | Set users in group |
|
||||
| `write/SetLastSeenUpdate` | Set last seen |
|
||||
| `write/PushRecentlyViewed` | Push recently viewed |
|
||||
| `write/UpdateVariableDescription` | Variable description |
|
||||
| `write/UpdateVariableIsSecret` | Variable secret flag |
|
||||
| `write/UpdateTagColor` | Tag color |
|
||||
| `write/UpdateServerPublicKey` | Server public key |
|
||||
|
||||
---
|
||||
|
||||
## `komodo_delete` — Delete Resource
|
||||
|
||||
| Komodo RPC | Resource Type |
|
||||
|------------|---------------|
|
||||
| `write/DeleteStack` | stack |
|
||||
| `write/DeleteBuild` | build |
|
||||
| `write/DeleteServer` | server |
|
||||
| `write/DeleteProcedure` | procedure |
|
||||
| `write/DeleteDeployment` | deployment |
|
||||
| `write/DeleteAlerter` | alerter |
|
||||
| `write/DeleteSyncResource` | sync_resource |
|
||||
| `write/DeleteTag` | tag |
|
||||
| `write/DeleteAction` | action |
|
||||
| `write/DeleteRepo` | repo |
|
||||
| `write/DeleteBuilder` | builder |
|
||||
| `write/DeleteSwarm` | swarm |
|
||||
| `write/DeleteVariable` | variable |
|
||||
| `write/DeleteUserGroup` | user_group |
|
||||
| `write/DeleteTerminal` | terminal |
|
||||
| `write/DeleteGitProviderAccount` | git_provider_account |
|
||||
|
||||
### Other Delete → `komodo_delete`
|
||||
|
||||
| Komodo RPC | Notes |
|
||||
|------------|-------|
|
||||
| `write/DeleteAllTerminals` | Delete all terminals |
|
||||
| `write/DeleteApiKeyForServiceUser` | Delete API key |
|
||||
| `write/DeleteImageRegistryAccount` | Delete registry account |
|
||||
| `write/DeleteOnboardingKey` | Delete onboarding key |
|
||||
| `write/DeleteUser` | Delete user |
|
||||
| `write/DeleteTagMapping` | Delete tag mapping |
|
||||
|
||||
---
|
||||
|
||||
## `komodo_execute` — Execute Operations
|
||||
|
||||
### Build & Deploy
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `run_build` | `execute/RunBuild` |
|
||||
| `deploy_stack` | `execute/DeployStack` |
|
||||
| `deploy_stack_service` | `execute/DeployStackService` |
|
||||
| `deploy` | `execute/Deploy` |
|
||||
| `deploy_stack_if_changed` | `execute/DeployStackIfChanged` |
|
||||
| `destroy_stack` | `execute/DestroyStack` |
|
||||
| `destroy_container` | `execute/DestroyContainer` |
|
||||
| `destroy_deployment` | `execute/DestroyDeployment` |
|
||||
| `run_deployment_execute` | `execute/Deploy` |
|
||||
| `run_deployment_redeploy` | `execute/Deploy` |
|
||||
| `run_deployment_destroy` | `execute/DestroyDeployment` |
|
||||
| `run_deployment_stop` | `execute/StopDeployment` |
|
||||
| `run_deployment_logs` | `execute/RunDeploymentLogs` |
|
||||
| `run_deployment_action` | `execute/RunDeploymentAction` |
|
||||
| `run_deployment_sync` | `execute/RunDeploymentSync` |
|
||||
|
||||
### Repo Operations
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `build_repo` | `execute/BuildRepo` |
|
||||
| `clone_repo` | `execute/CloneRepo` |
|
||||
| `pull_repo` | `execute/PullRepo` |
|
||||
| `pull_deployment` | `execute/PullDeployment` |
|
||||
| `cancel_repo_build` | `execute/CancelRepoBuild` |
|
||||
| `clear_repo_cache` | `execute/ClearRepoCache` |
|
||||
|
||||
### Procedure & Action
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `run_procedure` | `execute/RunProcedure` |
|
||||
| `run_procedure_stage` | `execute/RunProcedureStage` |
|
||||
| `run_action` | `execute/RunAction` |
|
||||
| `cancel_action` | `execute/CancelAction` |
|
||||
| `cancel_build` | `execute/CancelBuild` |
|
||||
| `cancel_procedure` | `execute/CancelProcedure` |
|
||||
|
||||
### Stack Operations
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `run_stack_refresh_cache` | `execute/RunStackRefreshCache` |
|
||||
| `run_stack_refresh_content` | `execute/RunStackRefreshContent` |
|
||||
| `run_stack_pull` | `execute/RunStackPull` |
|
||||
| `run_stack_pull_deployment` | `execute/RunStackPullDeployment` |
|
||||
| `run_stack_stop` | `execute/StopStack` |
|
||||
| `run_stack_restart` | `execute/RestartStack` |
|
||||
| `run_stack_pause` | `execute/PauseStack` |
|
||||
| `run_stack_unpause` | `execute/UnpauseStack` |
|
||||
| `run_stack_remove_orphan_containers` | `execute/RunStackRemoveOrphanContainers` |
|
||||
| `run_stack_toggle_service_dependencies` | `execute/RunStackToggleServiceDependencies` |
|
||||
| `run_stack_auto_update` | `execute/RunStackAutoUpdate` |
|
||||
| `run_stack_commit` | `execute/RunStackCommit` |
|
||||
| `start_stack` | `execute/StartStack` |
|
||||
| `stop_stack` | `execute/StopStack` |
|
||||
| `restart_stack` | `execute/RestartStack` |
|
||||
| `pause_stack` | `execute/PauseStack` |
|
||||
| `unpause_stack` | `execute/UnpauseStack` |
|
||||
| `run_resource_sync` | `execute/RunResourceSync` |
|
||||
| `run_sync_deployment` | `execute/RunSyncDeployment` |
|
||||
|
||||
### Container Lifecycle
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `start_container` | `execute/StartContainer` |
|
||||
| `stop_container` | `execute/StopContainer` |
|
||||
| `restart_container` | `execute/RestartContainer` |
|
||||
| `pause_container` | `execute/PauseContainer` |
|
||||
| `unpause_container` | `execute/UnpauseContainer` |
|
||||
| `start_all_containers` | `execute/StartAllContainers` |
|
||||
| `stop_all_containers` | `execute/StopAllContainers` |
|
||||
| `restart_all_containers` | `execute/RestartAllContainers` |
|
||||
| `pause_all_containers` | `execute/PauseAllContainers` |
|
||||
| `unpause_all_containers` | `execute/UnpauseAllContainers` |
|
||||
|
||||
### Deployment Lifecycle
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `start_deployment` | `execute/StartDeployment` |
|
||||
| `stop_deployment` | `execute/StopDeployment` |
|
||||
| `restart_deployment` | `execute/RestartDeployment` |
|
||||
| `pause_deployment` | `execute/PauseDeployment` |
|
||||
| `unpause_deployment` | `execute/UnpauseDeployment` |
|
||||
|
||||
### Server Operations
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `run_server_refresh` | `execute/RunServerRefresh` |
|
||||
| `run_server_refresh_containers` | `execute/RunServerRefreshContainers` |
|
||||
| `run_server_update_periphery` | `execute/RunServerUpdatePeriphery` |
|
||||
| `run_server_prune_images` | `execute/PruneImages` |
|
||||
| `run_server_prune_containers` | `execute/PruneContainers` |
|
||||
| `run_server_prune_networks` | `execute/PruneNetworks` |
|
||||
| `run_server_stats` | `execute/RunServerStats` |
|
||||
| `run_server_run_command` | `execute/RunServerRunCommand` |
|
||||
| `run_server_scripts` | `execute/RunServerScripts` |
|
||||
| `run_server_copy` | `execute/RunServerCopy` |
|
||||
| `run_server_move` | `execute/RunServerMove` |
|
||||
| `rotate_all_server_keys` | `execute/RotateAllServerKeys` |
|
||||
|
||||
### Docker Prune & Cleanup
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `prune_buildx` | `execute/PruneBuildx` |
|
||||
| `prune_docker_builders` | `execute/PruneDockerBuilders` |
|
||||
| `prune_system` | `execute/PruneSystem` |
|
||||
| `prune_volumes` | `execute/PruneVolumes` |
|
||||
| `delete_image` | `execute/DeleteImage` |
|
||||
| `delete_network` | `execute/DeleteNetwork` |
|
||||
| `delete_volume` | `execute/DeleteVolume` |
|
||||
|
||||
### Swarm Operations
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `remove_swarm_nodes` | `execute/RemoveSwarmNodes` |
|
||||
| `remove_swarm_services` | `execute/RemoveSwarmServices` |
|
||||
| `remove_swarm_configs` | `execute/RemoveSwarmConfigs` |
|
||||
| `remove_swarm_secrets` | `execute/RemoveSwarmSecrets` |
|
||||
| `remove_swarm_stacks` | `execute/RemoveSwarmStacks` |
|
||||
| `create_swarm_config` | `execute/CreateSwarmConfig` |
|
||||
| `create_swarm_secret` | `execute/CreateSwarmSecret` |
|
||||
| `rotate_swarm_config` | `execute/RotateSwarmConfig` |
|
||||
| `rotate_swarm_secret` | `execute/RotateSwarmSecret` |
|
||||
| `update_swarm_node` | `execute/UpdateSwarmNode` |
|
||||
|
||||
### Batch Operations
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `batch_run_build` | `execute/BatchRunBuild` |
|
||||
| `batch_deploy_stack` | `execute/BatchDeployStack` |
|
||||
| `batch_deploy_stack_if_changed` | `execute/BatchDeployStackIfChanged` |
|
||||
| `batch_deploy` | `execute/BatchDeploy` |
|
||||
| `batch_pull_stack` | `execute/BatchPullStack` |
|
||||
| `batch_pull_repo` | `execute/BatchPullRepo` |
|
||||
| `batch_build_repo` | `execute/BatchBuildRepo` |
|
||||
| `batch_clone_repo` | `execute/BatchCloneRepo` |
|
||||
| `batch_run_procedure` | `execute/BatchRunProcedure` |
|
||||
| `batch_run_action` | `execute/BatchRunAction` |
|
||||
| `batch_destroy_deployment` | `execute/BatchDestroyDeployment` |
|
||||
| `batch_destroy_stack` | `execute/BatchDestroyStack` |
|
||||
|
||||
### Admin & Misc
|
||||
| Operation | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| `run_server_refresh` | `execute/RunServerRefresh` |
|
||||
| `run_server_refresh_containers` | `execute/RunServerRefreshContainers` |
|
||||
| `run_server_update_periphery` | `execute/RunServerUpdatePeriphery` |
|
||||
| `global_auto_update` | `execute/GlobalAutoUpdate` |
|
||||
| `backup_core_database` | `execute/BackupCoreDatabase` |
|
||||
| `rotate_core_keys` | `execute/RotateCoreKeys` |
|
||||
| `send_alert` | `execute/SendAlert` |
|
||||
| `test_alerter` | `execute/TestAlerter` |
|
||||
| `sleep` | `execute/Sleep` |
|
||||
| `get_mcp_token` | `execute/GetMcpToken` |
|
||||
|
||||
---
|
||||
|
||||
## `komodo_logs` — Get Logs
|
||||
|
||||
| Resource Type | Komodo RPC |
|
||||
|---------------|------------|
|
||||
| deployment | `read/GetDeploymentLog` |
|
||||
| stack | `read/GetStackLog` |
|
||||
| container | `read/GetContainerLog` |
|
||||
| swarm_service | `read/GetSwarmServiceLog` |
|
||||
|
||||
---
|
||||
|
||||
## `komodo_summary` — Get Resource Summaries
|
||||
|
||||
| Resource Type | Komodo RPC |
|
||||
|---------------|------------|
|
||||
| build | `read/GetBuildsSummary` |
|
||||
| deployment | `read/GetDeploymentsSummary` |
|
||||
| server | `read/GetServersSummary` |
|
||||
| stack | `read/GetStacksSummary` |
|
||||
| alerter | `read/GetAlertersSummary` |
|
||||
| procedure | `read/GetProceduresSummary` |
|
||||
| sync_resource | `read/GetResourceSyncsSummary` |
|
||||
| repo | `read/GetReposSummary` |
|
||||
| builder | `read/GetBuildersSummary` |
|
||||
| swarm | `read/GetSwarmsSummary` |
|
||||
| action | `read/GetActionsSummary` |
|
||||
|
||||
---
|
||||
|
||||
## `komodo_inspect` — Inspect Docker Objects
|
||||
|
||||
| Inspect Type | Komodo RPC |
|
||||
|--------------|------------|
|
||||
| container | `read/InspectContainer` |
|
||||
| image | `read/InspectImage` |
|
||||
| network | `read/InspectNetwork` |
|
||||
| volume | `read/InspectVolume` |
|
||||
| deployment_container | `read/InspectDeploymentContainer` |
|
||||
| deployment_swarm_service | `read/InspectDeploymentSwarmService` |
|
||||
| stack_container | `read/InspectStackContainer` |
|
||||
| stack_swarm_info | `read/InspectStackSwarmInfo` |
|
||||
| stack_swarm_service | `read/InspectStackSwarmService` |
|
||||
| swarm | `read/InspectSwarm` |
|
||||
| swarm_config | `read/InspectSwarmConfig` |
|
||||
| swarm_node | `read/InspectSwarmNode` |
|
||||
| swarm_secret | `read/InspectSwarmSecret` |
|
||||
| swarm_service | `read/InspectSwarmService` |
|
||||
| swarm_stack | `read/InspectSwarmStack` |
|
||||
| swarm_task | `read/InspectSwarmTask` |
|
||||
|
||||
---
|
||||
|
||||
## `komodo_search_logs` — Search Logs
|
||||
|
||||
| Resource Type | Komodo RPC |
|
||||
|---------------|------------|
|
||||
| container | `read/SearchContainerLog` |
|
||||
| deployment | `read/SearchDeploymentLog` |
|
||||
| stack | `read/SearchStackLog` |
|
||||
| swarm_service | `read/SearchSwarmServiceLog` |
|
||||
|
||||
---
|
||||
|
||||
## `komodo_list_detail` — Extended Listing
|
||||
|
||||
| List Type | Komodo RPC |
|
||||
|-----------|------------|
|
||||
| containers | `read/ListContainers` |
|
||||
| all_containers | `read/ListAllContainers` |
|
||||
| images | `read/ListImages` |
|
||||
| networks | `read/ListNetworks` |
|
||||
| volumes | `read/ListVolumes` |
|
||||
| system_processes | `read/ListSystemProcesses` |
|
||||
| schedules | `read/ListSchedules` |
|
||||
| permissions | `read/ListPermissions` |
|
||||
| api_keys | `read/ListApiKeys` |
|
||||
| api_keys_for_service_user | `read/ListApiKeysForServiceUser` |
|
||||
| onboarding_keys | `read/ListOnboardingKeys` |
|
||||
| secrets | `read/ListSecrets` |
|
||||
| updates | `read/ListUpdates` |
|
||||
| build_versions | `read/ListBuildVersions` |
|
||||
| compose_projects | `read/ListComposeProjects` |
|
||||
| user_target_permissions | `read/ListUserTargetPermissions` |
|
||||
| full_stacks | `read/ListFullStacks` |
|
||||
| full_builds | `read/ListFullBuilds` |
|
||||
| full_servers | `read/ListFullServers` |
|
||||
| full_deployments | `read/ListFullDeployments` |
|
||||
| full_procedures | `read/ListFullProcedures` |
|
||||
| full_repos | `read/ListFullRepos` |
|
||||
| full_builders | `read/ListFullBuilders` |
|
||||
| full_swarms | `read/ListFullSwarms` |
|
||||
| full_actions | `read/ListFullActions` |
|
||||
| full_alerters | `read/ListFullAlerters` |
|
||||
| full_resource_syncs | `read/ListFullResourceSyncs` |
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Structured error for Komodo API responses.
|
||||
* Carries the HTTP status, route, and request name for diagnostics.
|
||||
*/
|
||||
export class KomodoApiError extends Error {
|
||||
public readonly status: number;
|
||||
public readonly route: string;
|
||||
public readonly requestName: string;
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
status: number,
|
||||
route: string,
|
||||
requestName: string,
|
||||
) {
|
||||
super(message);
|
||||
this.name = "KomodoApiError";
|
||||
this.status = status;
|
||||
this.route = route;
|
||||
this.requestName = requestName;
|
||||
}
|
||||
}
|
||||
+38
-10
@@ -10,6 +10,10 @@ import { updateInputSchema, handleUpdate } from "./tools/update.js";
|
||||
import { deleteInputSchema, handleDelete } from "./tools/delete.js";
|
||||
import { executeInputSchema, handleExecute } from "./tools/execute.js";
|
||||
import { logsInputSchema, handleLogs } from "./tools/logs.js";
|
||||
import { summaryInputSchema, handleSummary } from "./tools/summary.js";
|
||||
import { inspectInputSchema, handleInspect } from "./tools/inspect.js";
|
||||
import { searchLogsInputSchema, handleSearchLogs } from "./tools/search-logs.js";
|
||||
import { listDetailInputSchema, handleListDetail } from "./tools/list-detail.js";
|
||||
|
||||
const PORT = parseInt(process.env.PORT || "9800", 10);
|
||||
const client = new KomodoClient();
|
||||
@@ -18,51 +22,75 @@ const transports: Record<string, StreamableHTTPServerTransport> = {};
|
||||
function createServerInstance(): McpServer {
|
||||
const server = new McpServer({
|
||||
name: "komodo-mcp-server",
|
||||
version: "1.0.0",
|
||||
version: "2.0.0",
|
||||
});
|
||||
|
||||
server.registerTool("komodo_list", {
|
||||
description:
|
||||
"List or search Komodo resources (stacks, builds, servers, procedures, deployments, alerters, image_registry_accounts, sync_resources, users, tags, executions, access_requests). Returns a JSON array of matching resources.",
|
||||
"List or search Komodo resources. resource_type: stack, build, server, procedure, deployment, alerter, image_registry_account, sync_resource, user, tag, execution, access_request, action, repo, builder, swarm, variable, user_group, alert, terminal, git_provider_account. Returns a JSON array.",
|
||||
inputSchema: listInputSchema,
|
||||
}, async (args) => handleList(args, client));
|
||||
|
||||
server.registerTool("komodo_get", {
|
||||
description:
|
||||
"Get a single Komodo resource by ID or name. Returns the full resource object as JSON.",
|
||||
"Get a single Komodo resource by ID or name. resource_type: stack, build, server, procedure, deployment, alerter, image_registry_account, sync_resource, user, tag, execution, access_request, action, repo, builder, swarm, variable, user_group, alert, git_provider_account. Returns the full resource object.",
|
||||
inputSchema: getInputSchema,
|
||||
}, async (args) => handleGet(args, client));
|
||||
|
||||
server.registerTool("komodo_create", {
|
||||
description:
|
||||
"Create a new Komodo resource. Provide the resource_type and a params object with the fields required by the corresponding Komodo Create* endpoint.",
|
||||
"Create a new Komodo resource. resource_type: stack, build, server, procedure, deployment, alerter, image_registry_account, sync_resource, tag, action, repo, builder, swarm, variable, user_group, terminal, git_provider_account. Provide params object with Create* endpoint fields.",
|
||||
inputSchema: createInputSchema,
|
||||
}, async (args) => handleCreate(args, client));
|
||||
|
||||
server.registerTool("komodo_update", {
|
||||
description:
|
||||
"Update an existing Komodo resource by ID. Provide the resource_type, id, and params with the fields to update.",
|
||||
"Update an existing Komodo resource by ID. resource_type: stack, build, server, procedure, deployment, alerter, image_registry_account, sync_resource, user, tag, action, repo, builder, swarm, variable, user_group, git_provider_account. Provide params with fields to update.",
|
||||
inputSchema: updateInputSchema,
|
||||
}, async (args) => handleUpdate(args, client));
|
||||
|
||||
server.registerTool("komodo_delete", {
|
||||
description:
|
||||
"Delete a Komodo resource by ID or name.",
|
||||
"Delete a Komodo resource by ID or name. resource_type: stack, build, server, procedure, deployment, alerter, sync_resource, tag, action, repo, builder, swarm, variable, user_group, terminal, git_provider_account.",
|
||||
inputSchema: deleteInputSchema,
|
||||
}, async (args) => handleDelete(args, client));
|
||||
|
||||
server.registerTool("komodo_execute", {
|
||||
description:
|
||||
"Execute a Komodo operation (build, deploy, procedure run, server refresh, stack lifecycle actions, etc.). Provide the operation name, an optional resource id, and optional params.",
|
||||
"Execute a Komodo operation. 100+ operations including: run_build, deploy_stack, deploy, destroy_stack, run_procedure, run_action, build_repo, clone_repo, pull_repo, container lifecycle (start/stop/restart/pause/unpause), deployment lifecycle, stack lifecycle, server operations (refresh, prune, run_command, scripts, copy, move), swarm operations, batch operations (batch_run_build, batch_deploy, etc.), and admin ops (backup_core_database, global_auto_update).",
|
||||
inputSchema: executeInputSchema,
|
||||
}, async (args) => handleExecute(args, client));
|
||||
|
||||
server.registerTool("komodo_logs", {
|
||||
description:
|
||||
"Get logs for a Komodo deployment or stack. Returns log lines as text.",
|
||||
"Get logs for a Komodo resource. resource_type: deployment (GetDeploymentLog), stack (GetStackLog), container (GetContainerLog), swarm_service (GetSwarmServiceLog). Returns log lines as text.",
|
||||
inputSchema: logsInputSchema,
|
||||
}, async (args) => handleLogs(args, client));
|
||||
|
||||
server.registerTool("komodo_summary", {
|
||||
description:
|
||||
"Get summary/stats for a Komodo resource type. resource_type: build (GetBuildsSummary), deployment (GetDeploymentsSummary), server (GetServersSummary), stack (GetStacksSummary), alerter (GetAlertersSummary), procedure (GetProceduresSummary), sync_resource (GetResourceSyncsSummary), repo (GetReposSummary), builder (GetBuildersSummary), swarm (GetSwarmsSummary), action (GetActionsSummary).",
|
||||
inputSchema: summaryInputSchema,
|
||||
}, async (args) => handleSummary(args, client));
|
||||
|
||||
server.registerTool("komodo_inspect", {
|
||||
description:
|
||||
"Inspect a Docker object. inspect_type: container, image, network, volume, deployment_container, deployment_swarm_service, stack_container, stack_swarm_info, stack_swarm_service, swarm, swarm_config, swarm_node, swarm_secret, swarm_service, swarm_stack, swarm_task. Provide id and optional server name.",
|
||||
inputSchema: inspectInputSchema,
|
||||
}, async (args) => handleInspect(args, client));
|
||||
|
||||
server.registerTool("komodo_search_logs", {
|
||||
description:
|
||||
"Search logs for a resource. resource_type: container, deployment, stack, swarm_service. Provide a query string to filter log lines. Optional tail for line count.",
|
||||
inputSchema: searchLogsInputSchema,
|
||||
}, async (args) => handleSearchLogs(args, client));
|
||||
|
||||
server.registerTool("komodo_list_detail", {
|
||||
description:
|
||||
"Extended listing for specific Docker/infrastructure objects. list_type: containers, all_containers, images, networks, volumes, system_processes, schedules, permissions, api_keys, secrets, updates, build_versions, compose_projects, user_target_permissions, full_stacks, full_builds, full_servers, full_deployments, full_procedures, full_repos, full_builders, full_swarms, full_actions, full_alerters, full_resource_syncs. Optional server filter.",
|
||||
inputSchema: listDetailInputSchema,
|
||||
}, async (args) => handleListDetail(args, client));
|
||||
|
||||
return server;
|
||||
}
|
||||
|
||||
@@ -88,7 +116,7 @@ const httpServer = createServer(async (req, res) => {
|
||||
res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
|
||||
res.setHeader(
|
||||
"Access-Control-Allow-Headers",
|
||||
"Content-Type, Authorization, mcp-session-id",
|
||||
"Content-Type, Authorization, mcp-session-id, X-Api-Key, X-Api-Secret",
|
||||
);
|
||||
|
||||
if (req.method === "OPTIONS") {
|
||||
@@ -100,7 +128,7 @@ const httpServer = createServer(async (req, res) => {
|
||||
// Health check
|
||||
if (req.method === "GET" && req.url === "/health") {
|
||||
res.writeHead(200, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ status: "ok", name: "komodo-mcp-server" }));
|
||||
res.end(JSON.stringify({ status: "ok", name: "komodo-mcp-server", version: "2.0.0" }));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+53
-10
@@ -1,16 +1,44 @@
|
||||
import { KomodoApiError } from "./errors.js";
|
||||
|
||||
export class KomodoClient {
|
||||
private baseUrl: string;
|
||||
private username: string;
|
||||
private password: string;
|
||||
private apiKey: string | null = null;
|
||||
private apiSecret: string | null = null;
|
||||
private token: string | null = null;
|
||||
private useApiKey: boolean;
|
||||
|
||||
constructor() {
|
||||
this.baseUrl = process.env.KOMODO_BASE_URL || process.env.KOMODO_URL || "http://10.10.2.114:9120";
|
||||
this.baseUrl =
|
||||
process.env.KOMODO_BASE_URL || process.env.KOMODO_URL || "http://10.10.2.114:9120";
|
||||
this.username = process.env.KOMODO_USERNAME || "";
|
||||
this.password = process.env.KOMODO_PASSWORD || "";
|
||||
this.apiKey = process.env.KOMODO_API_KEY || null;
|
||||
this.apiSecret = process.env.KOMODO_API_SECRET || null;
|
||||
this.useApiKey = !!(this.apiKey && this.apiSecret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the appropriate auth headers based on the configured auth method.
|
||||
* API key auth (X-Api-Key / X-Api-Secret) is preferred when credentials are set;
|
||||
* otherwise falls back to JWT Bearer token.
|
||||
*/
|
||||
private async getAuthHeaders(): Promise<Record<string, string>> {
|
||||
if (this.useApiKey) {
|
||||
return {
|
||||
"X-Api-Key": this.apiKey!,
|
||||
"X-Api-Secret": this.apiSecret!,
|
||||
};
|
||||
}
|
||||
await this.ensureAuth();
|
||||
return {
|
||||
Authorization: `Bearer ${this.token}`,
|
||||
};
|
||||
}
|
||||
|
||||
private async ensureAuth(): Promise<void> {
|
||||
if (this.useApiKey) return; // No login needed for API key auth
|
||||
if (this.token) return;
|
||||
await this.login();
|
||||
}
|
||||
@@ -23,6 +51,7 @@ export class KomodoClient {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
}),
|
||||
signal: AbortSignal.timeout(30000),
|
||||
});
|
||||
if (!res.ok) {
|
||||
const text = await res.text().catch(() => "");
|
||||
@@ -40,31 +69,45 @@ export class KomodoClient {
|
||||
|
||||
const url = `${this.baseUrl}/${route}/${requestName}`;
|
||||
|
||||
const attempt = async (token: string): Promise<Response> => {
|
||||
const attempt = async (
|
||||
authHeaders: Record<string, string>,
|
||||
): Promise<Response> => {
|
||||
return fetch(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
...authHeaders,
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
signal: AbortSignal.timeout(30000),
|
||||
});
|
||||
};
|
||||
|
||||
let res = await attempt(this.token!);
|
||||
const authHeaders = await this.getAuthHeaders();
|
||||
let res = await attempt(authHeaders);
|
||||
|
||||
// Auto-refresh on 401
|
||||
if (res.status === 401) {
|
||||
// Auto-refresh on 401 (JWT only)
|
||||
if (res.status === 401 && !this.useApiKey) {
|
||||
this.token = null;
|
||||
await this.login();
|
||||
res = await attempt(this.token!);
|
||||
res = await attempt({ Authorization: `Bearer ${this.token}` });
|
||||
}
|
||||
|
||||
if (!res.ok) {
|
||||
const text = await res.text().catch(() => "");
|
||||
throw new Error(
|
||||
`Komodo RPC ${route}/${requestName} failed (${res.status}): ${text}`,
|
||||
);
|
||||
let message = `Komodo RPC ${route}/${requestName} failed (${res.status}): ${text}`;
|
||||
try {
|
||||
const body = JSON.parse(text) as {
|
||||
error?: string;
|
||||
trace?: unknown[];
|
||||
};
|
||||
if (body.error) {
|
||||
message = `Komodo RPC ${route}/${requestName} failed (${res.status}): ${body.error}`;
|
||||
}
|
||||
} catch {
|
||||
// Not JSON, use raw text
|
||||
}
|
||||
throw new KomodoApiError(message, res.status, route, requestName);
|
||||
}
|
||||
|
||||
const text = await res.text();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import { z } from "zod";
|
||||
import { KomodoClient } from "../komodo-client.js";
|
||||
import { INSPECT_REQUEST_MAP } from "../types.js";
|
||||
|
||||
const InspectType = z.enum([
|
||||
"container", "image", "network", "volume",
|
||||
"deployment_container", "deployment_swarm_service",
|
||||
"stack_container", "stack_swarm_info", "stack_swarm_service",
|
||||
"swarm", "swarm_config", "swarm_node", "swarm_secret",
|
||||
"swarm_service", "swarm_stack", "swarm_task",
|
||||
]);
|
||||
|
||||
export const inspectInputSchema = {
|
||||
inspect_type: InspectType.describe(
|
||||
"Type of Docker object to inspect (container, image, network, volume, deployment_container, swarm, swarm_node, etc.)"
|
||||
),
|
||||
id: z.string().describe("ID or name of the object to inspect"),
|
||||
server: z.string().optional().describe("Server name (required for server-scoped inspections)"),
|
||||
};
|
||||
|
||||
export async function handleInspect(
|
||||
args: {
|
||||
inspect_type: z.infer<typeof InspectType>;
|
||||
id: string;
|
||||
server?: string;
|
||||
},
|
||||
client: KomodoClient,
|
||||
): Promise<{ content: { type: "text"; text: string }[] }> {
|
||||
const { inspect_type, id, server } = args;
|
||||
|
||||
const requestName = INSPECT_REQUEST_MAP[inspect_type];
|
||||
if (!requestName) {
|
||||
throw new Error(`Unknown inspect type: ${inspect_type}`);
|
||||
}
|
||||
|
||||
const params: Record<string, unknown> = { id };
|
||||
if (server) params.server = server;
|
||||
|
||||
const result = await client.rpc("read", requestName, params);
|
||||
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import { z } from "zod";
|
||||
import { KomodoClient } from "../komodo-client.js";
|
||||
import { LIST_DETAIL_REQUEST_MAP } from "../types.js";
|
||||
|
||||
const listDetailType = z.enum([
|
||||
"containers", "all_containers", "images", "networks", "volumes",
|
||||
"system_processes", "schedules", "permissions", "api_keys",
|
||||
"api_keys_for_service_user", "onboarding_keys", "secrets", "updates",
|
||||
"build_versions", "compose_projects", "user_target_permissions",
|
||||
"full_stacks", "full_builds", "full_servers", "full_deployments",
|
||||
"full_procedures", "full_repos", "full_builders", "full_swarms",
|
||||
"full_actions", "full_alerters", "full_resource_syncs",
|
||||
]);
|
||||
|
||||
export const listDetailInputSchema = {
|
||||
list_type: listDetailType.describe(
|
||||
"What to list (containers, images, networks, volumes, full_stacks, full_builds, etc.)"
|
||||
),
|
||||
server: z.string().optional().describe("Server name (required for container/image/network/volume listings)"),
|
||||
pattern: z.string().optional().describe("Filter pattern (for batch operations)"),
|
||||
};
|
||||
|
||||
export async function handleListDetail(
|
||||
args: {
|
||||
list_type: z.infer<typeof listDetailType>;
|
||||
server?: string;
|
||||
pattern?: string;
|
||||
},
|
||||
client: KomodoClient,
|
||||
): Promise<{ content: { type: "text"; text: string }[] }> {
|
||||
const { list_type, server, pattern } = args;
|
||||
|
||||
const requestName = LIST_DETAIL_REQUEST_MAP[list_type];
|
||||
if (!requestName) {
|
||||
throw new Error(`Unknown list detail type: ${list_type}`);
|
||||
}
|
||||
|
||||
const params: Record<string, unknown> = {};
|
||||
if (server) params.server = server;
|
||||
if (pattern) params.pattern = pattern;
|
||||
|
||||
const result = await client.rpc("read", requestName, params);
|
||||
|
||||
const items = Array.isArray(result) ? result : [result];
|
||||
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: JSON.stringify(items, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
+19
-9
@@ -1,10 +1,12 @@
|
||||
import { z } from "zod";
|
||||
import { KomodoClient } from "../komodo-client.js";
|
||||
|
||||
const LogResourceType = z.enum(["deployment", "stack", "container", "swarm_service"]);
|
||||
|
||||
export const logsInputSchema = {
|
||||
resource_type: z
|
||||
.enum(["deployment", "stack"])
|
||||
.describe("Resource type to get logs for"),
|
||||
resource_type: LogResourceType.describe(
|
||||
"Resource type to get logs for (deployment, stack, container, swarm_service)"
|
||||
),
|
||||
id: z.string().describe("Resource ID or name"),
|
||||
tail: z
|
||||
.number()
|
||||
@@ -14,7 +16,7 @@ export const logsInputSchema = {
|
||||
|
||||
export async function handleLogs(
|
||||
args: {
|
||||
resource_type: "deployment" | "stack";
|
||||
resource_type: z.infer<typeof LogResourceType>;
|
||||
id: string;
|
||||
tail?: number;
|
||||
},
|
||||
@@ -27,11 +29,19 @@ export async function handleLogs(
|
||||
|
||||
let result: unknown;
|
||||
|
||||
if (resource_type === "deployment") {
|
||||
result = await client.rpc("read", "GetDeploymentLogs", params);
|
||||
} else {
|
||||
// stack — GetStack returns full stack state including logs
|
||||
result = await client.rpc("read", "GetStack", { id });
|
||||
switch (resource_type) {
|
||||
case "deployment":
|
||||
result = await client.rpc("read", "GetDeploymentLog", params);
|
||||
break;
|
||||
case "stack":
|
||||
result = await client.rpc("read", "GetStackLog", params);
|
||||
break;
|
||||
case "container":
|
||||
result = await client.rpc("read", "GetContainerLog", params);
|
||||
break;
|
||||
case "swarm_service":
|
||||
result = await client.rpc("read", "GetSwarmServiceLog", params);
|
||||
break;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { z } from "zod";
|
||||
import { KomodoClient } from "../komodo-client.js";
|
||||
import { SEARCH_LOG_REQUEST_MAP } from "../types.js";
|
||||
|
||||
const LogResourceType = z.enum(["container", "deployment", "stack", "swarm_service"]);
|
||||
|
||||
export const searchLogsInputSchema = {
|
||||
resource_type: LogResourceType.describe(
|
||||
"Resource type to search logs for (container, deployment, stack, swarm_service)"
|
||||
),
|
||||
id: z.string().describe("Resource ID or name"),
|
||||
query: z.string().describe("Search query to filter log lines"),
|
||||
tail: z.number().optional().describe("Number of recent log lines to return"),
|
||||
};
|
||||
|
||||
export async function handleSearchLogs(
|
||||
args: {
|
||||
resource_type: z.infer<typeof LogResourceType>;
|
||||
id: string;
|
||||
query: string;
|
||||
tail?: number;
|
||||
},
|
||||
client: KomodoClient,
|
||||
): Promise<{ content: { type: "text"; text: string }[] }> {
|
||||
const { resource_type, id, query, tail } = args;
|
||||
|
||||
const requestName = SEARCH_LOG_REQUEST_MAP[resource_type];
|
||||
if (!requestName) {
|
||||
throw new Error(`No log search endpoint for resource type: ${resource_type}`);
|
||||
}
|
||||
|
||||
const params: Record<string, unknown> = { id, query };
|
||||
if (tail !== undefined) params.tail = tail;
|
||||
|
||||
const result = await client.rpc("read", requestName, params);
|
||||
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: typeof result === "string" ? result : JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { z } from "zod";
|
||||
import { KomodoClient } from "../komodo-client.js";
|
||||
import { ResourceType, SUMMARY_REQUEST_MAP } from "../types.js";
|
||||
|
||||
export const summaryInputSchema = {
|
||||
resource_type: ResourceType.describe(
|
||||
"Resource type to get summary for (build, deployment, server, stack, alerter, procedure, sync_resource, repo, builder, swarm, action)"
|
||||
),
|
||||
};
|
||||
|
||||
export async function handleSummary(
|
||||
args: { resource_type: z.infer<typeof ResourceType> },
|
||||
client: KomodoClient,
|
||||
): Promise<{ content: { type: "text"; text: string }[] }> {
|
||||
const { resource_type } = args;
|
||||
|
||||
const requestName = SUMMARY_REQUEST_MAP[resource_type];
|
||||
if (!requestName) {
|
||||
throw new Error(
|
||||
`No summary endpoint available for resource type: ${resource_type}. Available: ${Object.keys(SUMMARY_REQUEST_MAP).join(", ")}`,
|
||||
);
|
||||
}
|
||||
|
||||
const result = await client.rpc("read", requestName, {});
|
||||
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: JSON.stringify(result, null, 2),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
+276
@@ -13,6 +13,15 @@ export const ResourceType = z.enum([
|
||||
"tag",
|
||||
"execution",
|
||||
"access_request",
|
||||
"action",
|
||||
"repo",
|
||||
"builder",
|
||||
"swarm",
|
||||
"variable",
|
||||
"user_group",
|
||||
"alert",
|
||||
"terminal",
|
||||
"git_provider_account",
|
||||
]);
|
||||
export type ResourceType = z.infer<typeof ResourceType>;
|
||||
|
||||
@@ -55,6 +64,73 @@ export const ExecuteOperation = z.enum([
|
||||
"run_deployment_logs",
|
||||
"run_sync_deployment",
|
||||
"get_mcp_token",
|
||||
"deploy",
|
||||
"deploy_stack_if_changed",
|
||||
"destroy_stack",
|
||||
"destroy_container",
|
||||
"destroy_deployment",
|
||||
"build_repo",
|
||||
"clone_repo",
|
||||
"pull_repo",
|
||||
"pull_deployment",
|
||||
"cancel_repo_build",
|
||||
"clear_repo_cache",
|
||||
"run_action",
|
||||
"cancel_action",
|
||||
"cancel_build",
|
||||
"cancel_procedure",
|
||||
"start_container",
|
||||
"stop_container",
|
||||
"restart_container",
|
||||
"pause_container",
|
||||
"unpause_container",
|
||||
"start_all_containers",
|
||||
"stop_all_containers",
|
||||
"restart_all_containers",
|
||||
"pause_all_containers",
|
||||
"unpause_all_containers",
|
||||
"start_deployment",
|
||||
"stop_deployment",
|
||||
"restart_deployment",
|
||||
"pause_deployment",
|
||||
"unpause_deployment",
|
||||
"start_stack",
|
||||
"prune_buildx",
|
||||
"prune_docker_builders",
|
||||
"prune_system",
|
||||
"prune_volumes",
|
||||
"delete_image",
|
||||
"delete_network",
|
||||
"delete_volume",
|
||||
"remove_swarm_nodes",
|
||||
"remove_swarm_services",
|
||||
"remove_swarm_configs",
|
||||
"remove_swarm_secrets",
|
||||
"remove_swarm_stacks",
|
||||
"create_swarm_config",
|
||||
"create_swarm_secret",
|
||||
"rotate_swarm_config",
|
||||
"rotate_swarm_secret",
|
||||
"update_swarm_node",
|
||||
"batch_run_build",
|
||||
"batch_deploy_stack",
|
||||
"batch_deploy_stack_if_changed",
|
||||
"batch_deploy",
|
||||
"batch_pull_stack",
|
||||
"batch_pull_repo",
|
||||
"batch_build_repo",
|
||||
"batch_clone_repo",
|
||||
"batch_run_procedure",
|
||||
"batch_run_action",
|
||||
"batch_destroy_deployment",
|
||||
"batch_destroy_stack",
|
||||
"backup_core_database",
|
||||
"rotate_core_keys",
|
||||
"rotate_all_server_keys",
|
||||
"global_auto_update",
|
||||
"send_alert",
|
||||
"test_alerter",
|
||||
"sleep",
|
||||
]);
|
||||
export type ExecuteOperation = z.infer<typeof ExecuteOperation>;
|
||||
|
||||
@@ -72,6 +148,15 @@ export const LIST_REQUEST_MAP: Record<ResourceType, string> = {
|
||||
tag: "ListTags",
|
||||
execution: "ListExecutions",
|
||||
access_request: "ListAccessRequests",
|
||||
action: "ListActions",
|
||||
repo: "ListRepos",
|
||||
builder: "ListBuilders",
|
||||
swarm: "ListSwarms",
|
||||
variable: "ListVariables",
|
||||
user_group: "ListUserGroups",
|
||||
alert: "ListAlerts",
|
||||
terminal: "ListTerminals",
|
||||
git_provider_account: "ListGitProviderAccounts",
|
||||
};
|
||||
|
||||
// Maps resource_type to the search RPC request name
|
||||
@@ -88,6 +173,15 @@ export const SEARCH_REQUEST_MAP: Record<ResourceType, string> = {
|
||||
tag: "ListTags",
|
||||
execution: "ListExecutions",
|
||||
access_request: "ListAccessRequests",
|
||||
action: "ListActions",
|
||||
repo: "ListRepos",
|
||||
builder: "ListBuilders",
|
||||
swarm: "ListSwarms",
|
||||
variable: "ListVariables",
|
||||
user_group: "ListUserGroups",
|
||||
alert: "ListAlerts",
|
||||
terminal: "ListTerminals",
|
||||
git_provider_account: "ListGitProviderAccounts",
|
||||
};
|
||||
|
||||
// Maps resource_type to the get RPC request name
|
||||
@@ -104,6 +198,15 @@ export const GET_REQUEST_MAP: Record<ResourceType, string> = {
|
||||
tag: "GetTag",
|
||||
execution: "GetExecution",
|
||||
access_request: "GetAccessRequest",
|
||||
action: "GetAction",
|
||||
repo: "GetRepo",
|
||||
builder: "GetBuilder",
|
||||
swarm: "GetSwarm",
|
||||
variable: "GetVariable",
|
||||
user_group: "GetUserGroup",
|
||||
alert: "GetAlert",
|
||||
terminal: "GetTerminal",
|
||||
git_provider_account: "GetGitProviderAccount",
|
||||
};
|
||||
|
||||
// Maps resource_type to the create RPC request name
|
||||
@@ -117,6 +220,14 @@ export const CREATE_REQUEST_MAP: Partial<Record<ResourceType, string>> = {
|
||||
image_registry_account: "CreateImageRegistryAccount",
|
||||
sync_resource: "CreateSyncResource",
|
||||
tag: "AddTag",
|
||||
action: "CreateAction",
|
||||
repo: "CreateRepo",
|
||||
builder: "CreateBuilder",
|
||||
swarm: "CreateSwarm",
|
||||
variable: "CreateVariable",
|
||||
user_group: "CreateUserGroup",
|
||||
terminal: "CreateTerminal",
|
||||
git_provider_account: "CreateGitProviderAccount",
|
||||
};
|
||||
|
||||
// Maps resource_type to the update RPC request name
|
||||
@@ -131,6 +242,13 @@ export const UPDATE_REQUEST_MAP: Partial<Record<ResourceType, string>> = {
|
||||
sync_resource: "UpdateSyncResource",
|
||||
user: "UpdateUser",
|
||||
tag: "UpdateTag",
|
||||
action: "UpdateAction",
|
||||
repo: "UpdateRepo",
|
||||
builder: "UpdateBuilder",
|
||||
swarm: "UpdateSwarm",
|
||||
variable: "UpdateVariableValue",
|
||||
user_group: "UpdateUserGroup",
|
||||
git_provider_account: "UpdateGitProviderAccount",
|
||||
};
|
||||
|
||||
// Maps resource_type to the delete RPC request name
|
||||
@@ -143,6 +261,14 @@ export const DELETE_REQUEST_MAP: Partial<Record<ResourceType, string>> = {
|
||||
alerter: "DeleteAlerter",
|
||||
sync_resource: "DeleteSyncResource",
|
||||
tag: "DeleteTag",
|
||||
action: "DeleteAction",
|
||||
repo: "DeleteRepo",
|
||||
builder: "DeleteBuilder",
|
||||
swarm: "DeleteSwarm",
|
||||
variable: "DeleteVariable",
|
||||
user_group: "DeleteUserGroup",
|
||||
terminal: "DeleteTerminal",
|
||||
git_provider_account: "DeleteGitProviderAccount",
|
||||
};
|
||||
|
||||
// Maps execute operation to the RPC request name and the route
|
||||
@@ -230,4 +356,154 @@ export const EXECUTE_REQUEST_MAP: Record<
|
||||
run_deployment_logs: { route: "execute", name: "RunDeploymentLogs" },
|
||||
run_sync_deployment: { route: "execute", name: "RunSyncDeployment" },
|
||||
get_mcp_token: { route: "execute", name: "GetMcpToken" },
|
||||
deploy: { route: "execute", name: "Deploy" },
|
||||
deploy_stack_if_changed: { route: "execute", name: "DeployStackIfChanged" },
|
||||
destroy_stack: { route: "execute", name: "DestroyStack" },
|
||||
destroy_container: { route: "execute", name: "DestroyContainer" },
|
||||
destroy_deployment: { route: "execute", name: "DestroyDeployment" },
|
||||
build_repo: { route: "execute", name: "BuildRepo" },
|
||||
clone_repo: { route: "execute", name: "CloneRepo" },
|
||||
pull_repo: { route: "execute", name: "PullRepo" },
|
||||
pull_deployment: { route: "execute", name: "PullDeployment" },
|
||||
cancel_repo_build: { route: "execute", name: "CancelRepoBuild" },
|
||||
clear_repo_cache: { route: "execute", name: "ClearRepoCache" },
|
||||
run_action: { route: "execute", name: "RunAction" },
|
||||
cancel_action: { route: "execute", name: "CancelAction" },
|
||||
cancel_build: { route: "execute", name: "CancelBuild" },
|
||||
cancel_procedure: { route: "execute", name: "CancelProcedure" },
|
||||
start_container: { route: "execute", name: "StartContainer" },
|
||||
stop_container: { route: "execute", name: "StopContainer" },
|
||||
restart_container: { route: "execute", name: "RestartContainer" },
|
||||
pause_container: { route: "execute", name: "PauseContainer" },
|
||||
unpause_container: { route: "execute", name: "UnpauseContainer" },
|
||||
start_all_containers: { route: "execute", name: "StartAllContainers" },
|
||||
stop_all_containers: { route: "execute", name: "StopAllContainers" },
|
||||
restart_all_containers: { route: "execute", name: "RestartAllContainers" },
|
||||
pause_all_containers: { route: "execute", name: "PauseAllContainers" },
|
||||
unpause_all_containers: { route: "execute", name: "UnpauseAllContainers" },
|
||||
start_deployment: { route: "execute", name: "StartDeployment" },
|
||||
stop_deployment: { route: "execute", name: "StopDeployment" },
|
||||
restart_deployment: { route: "execute", name: "RestartDeployment" },
|
||||
pause_deployment: { route: "execute", name: "PauseDeployment" },
|
||||
unpause_deployment: { route: "execute", name: "UnpauseDeployment" },
|
||||
start_stack: { route: "execute", name: "StartStack" },
|
||||
prune_buildx: { route: "execute", name: "PruneBuildx" },
|
||||
prune_docker_builders: { route: "execute", name: "PruneDockerBuilders" },
|
||||
prune_system: { route: "execute", name: "PruneSystem" },
|
||||
prune_volumes: { route: "execute", name: "PruneVolumes" },
|
||||
delete_image: { route: "execute", name: "DeleteImage" },
|
||||
delete_network: { route: "execute", name: "DeleteNetwork" },
|
||||
delete_volume: { route: "execute", name: "DeleteVolume" },
|
||||
remove_swarm_nodes: { route: "execute", name: "RemoveSwarmNodes" },
|
||||
remove_swarm_services: { route: "execute", name: "RemoveSwarmServices" },
|
||||
remove_swarm_configs: { route: "execute", name: "RemoveSwarmConfigs" },
|
||||
remove_swarm_secrets: { route: "execute", name: "RemoveSwarmSecrets" },
|
||||
remove_swarm_stacks: { route: "execute", name: "RemoveSwarmStacks" },
|
||||
create_swarm_config: { route: "execute", name: "CreateSwarmConfig" },
|
||||
create_swarm_secret: { route: "execute", name: "CreateSwarmSecret" },
|
||||
rotate_swarm_config: { route: "execute", name: "RotateSwarmConfig" },
|
||||
rotate_swarm_secret: { route: "execute", name: "RotateSwarmSecret" },
|
||||
update_swarm_node: { route: "execute", name: "UpdateSwarmNode" },
|
||||
batch_run_build: { route: "execute", name: "BatchRunBuild" },
|
||||
batch_deploy_stack: { route: "execute", name: "BatchDeployStack" },
|
||||
batch_deploy_stack_if_changed: {
|
||||
route: "execute",
|
||||
name: "BatchDeployStackIfChanged",
|
||||
},
|
||||
batch_deploy: { route: "execute", name: "BatchDeploy" },
|
||||
batch_pull_stack: { route: "execute", name: "BatchPullStack" },
|
||||
batch_pull_repo: { route: "execute", name: "BatchPullRepo" },
|
||||
batch_build_repo: { route: "execute", name: "BatchBuildRepo" },
|
||||
batch_clone_repo: { route: "execute", name: "BatchCloneRepo" },
|
||||
batch_run_procedure: { route: "execute", name: "BatchRunProcedure" },
|
||||
batch_run_action: { route: "execute", name: "BatchRunAction" },
|
||||
batch_destroy_deployment: {
|
||||
route: "execute",
|
||||
name: "BatchDestroyDeployment",
|
||||
},
|
||||
batch_destroy_stack: { route: "execute", name: "BatchDestroyStack" },
|
||||
backup_core_database: { route: "execute", name: "BackupCoreDatabase" },
|
||||
rotate_core_keys: { route: "execute", name: "RotateCoreKeys" },
|
||||
rotate_all_server_keys: {
|
||||
route: "execute",
|
||||
name: "RotateAllServerKeys",
|
||||
},
|
||||
global_auto_update: { route: "execute", name: "GlobalAutoUpdate" },
|
||||
send_alert: { route: "execute", name: "SendAlert" },
|
||||
test_alerter: { route: "execute", name: "TestAlerter" },
|
||||
sleep: { route: "execute", name: "Sleep" },
|
||||
};
|
||||
|
||||
// Maps resource_type to the summary RPC request name
|
||||
export const SUMMARY_REQUEST_MAP: Partial<Record<ResourceType, string>> = {
|
||||
build: "GetBuildsSummary",
|
||||
deployment: "GetDeploymentsSummary",
|
||||
server: "GetServersSummary",
|
||||
stack: "GetStacksSummary",
|
||||
alerter: "GetAlertersSummary",
|
||||
procedure: "GetProceduresSummary",
|
||||
sync_resource: "GetResourceSyncsSummary",
|
||||
repo: "GetReposSummary",
|
||||
builder: "GetBuildersSummary",
|
||||
swarm: "GetSwarmsSummary",
|
||||
action: "GetActionsSummary",
|
||||
};
|
||||
|
||||
// Maps inspect type to the inspect RPC request name
|
||||
export const INSPECT_REQUEST_MAP: Record<string, string> = {
|
||||
container: "InspectContainer",
|
||||
image: "InspectImage",
|
||||
network: "InspectNetwork",
|
||||
volume: "InspectVolume",
|
||||
deployment_container: "InspectDeploymentContainer",
|
||||
deployment_swarm_service: "InspectDeploymentSwarmService",
|
||||
stack_container: "InspectStackContainer",
|
||||
stack_swarm_info: "InspectStackSwarmInfo",
|
||||
stack_swarm_service: "InspectStackSwarmService",
|
||||
swarm: "InspectSwarm",
|
||||
swarm_config: "InspectSwarmConfig",
|
||||
swarm_node: "InspectSwarmNode",
|
||||
swarm_secret: "InspectSwarmSecret",
|
||||
swarm_service: "InspectSwarmService",
|
||||
swarm_stack: "InspectSwarmStack",
|
||||
swarm_task: "InspectSwarmTask",
|
||||
};
|
||||
|
||||
// Maps search log type to the RPC request name
|
||||
export const SEARCH_LOG_REQUEST_MAP: Record<string, string> = {
|
||||
container: "SearchContainerLog",
|
||||
deployment: "SearchDeploymentLog",
|
||||
stack: "SearchStackLog",
|
||||
swarm_service: "SearchSwarmServiceLog",
|
||||
};
|
||||
|
||||
// Maps list detail type to the RPC request name
|
||||
export const LIST_DETAIL_REQUEST_MAP: Record<string, string> = {
|
||||
containers: "ListContainers",
|
||||
all_containers: "ListAllContainers",
|
||||
images: "ListImages",
|
||||
networks: "ListNetworks",
|
||||
volumes: "ListVolumes",
|
||||
system_processes: "ListSystemProcesses",
|
||||
schedules: "ListSchedules",
|
||||
permissions: "ListPermissions",
|
||||
api_keys: "ListApiKeys",
|
||||
api_keys_for_service_user: "ListApiKeysForServiceUser",
|
||||
onboarding_keys: "ListOnboardingKeys",
|
||||
secrets: "ListSecrets",
|
||||
updates: "ListUpdates",
|
||||
build_versions: "ListBuildVersions",
|
||||
compose_projects: "ListComposeProjects",
|
||||
user_target_permissions: "ListUserTargetPermissions",
|
||||
full_stacks: "ListFullStacks",
|
||||
full_builds: "ListFullBuilds",
|
||||
full_servers: "ListFullServers",
|
||||
full_deployments: "ListFullDeployments",
|
||||
full_procedures: "ListFullProcedures",
|
||||
full_repos: "ListFullRepos",
|
||||
full_builders: "ListFullBuilders",
|
||||
full_swarms: "ListFullSwarms",
|
||||
full_actions: "ListFullActions",
|
||||
full_alerters: "ListFullAlerters",
|
||||
full_resource_syncs: "ListFullResourceSyncs",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user