CosmosCloudMCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CosmosCloudMCP
An MCP server for Cosmos Cloud (azukaar/Cosmos-Server), the self-hosted server manager and reverse proxy. It lets an MCP client such as Claude Code read and manage your Cosmos instance through its REST API: containers, reverse-proxy routes, Docker volumes and networks, backups, scheduled jobs, metrics and API tokens.
Not related to Azure Cosmos DB, the Cosmos blockchain or cosmos.so.
Python, official MCP Python SDK v2 (
MCPServer), stdio transportRead and write tools in three safety levels, plus a global read-only switch
Secrets (passwords, tokens, environment variable values) are redacted in responses
Built and tested against Cosmos v0.24.0; other versions may work if the API is unchanged
Install
Requires a Cosmos instance with API tokens (v0.24.0 or newer). Three options:
Prebuilt Docker image (built by GitHub Actions for linux/amd64 and linux/arm64):
docker pull ghcr.io/alike03/cosmoscloudmcp:latestTags: latest (main branch), X.Y.Z and X.Y (release tags vX.Y.Z), sha-<commit>.
Build the Docker image yourself (no local Python needed):
git clone https://github.com/alike03/CosmosCloudMCP.git
cd CosmosCloudMCP
docker build -t cosmos-cloud-mcp .Python package (Python 3.11 or newer):
git clone https://github.com/alike03/CosmosCloudMCP.git
cd CosmosCloudMCP
python3 -m venv .venv
.venv/bin/pip install .Related MCP server: homelab-mcp
Create an API token
In the Cosmos web UI open Management > Configuration, tab API, and click New Token. Set an expiry and, if possible, an IP whitelist.
The web form has no per-permission selection, only the Read Only switch:
Form setting | Permissions granted | Effect on this server |
Read Only off (default, shown as "Full Access") | all: 1, 2, 10, 11, 20, 21, 30, 31, 40 | every tool works; includes user management (11) and unmasked credentials (40) |
Read Only on | 1, 10, 20, 30 | read tools work, write tools fail with HTTP 403 |
A token with a custom permission list can only be created through the API, for example with this server's create_api_token tool (using a Full Access token once), and Cosmos refuses to grant permissions the creating token does not hold (AT016). Permission ids:
id | Permission | Needed for |
1 | ADMIN_READ | list API tokens, logs |
2 | ADMIN | restart Cosmos, create/delete API tokens |
10 | USERS_READ |
|
11 | USERS | not used by dedicated tools |
20 | RESOURCES_READ | containers, volumes, networks, backups, jobs, storage, metrics |
21 | RESOURCES | container actions, volumes/networks, backups, jobs |
30 | CONFIGURATION_READ | routes; without it |
31 | CONFIGURATION | create/update/delete routes |
40 | CREDENTIALS_READ | unmasked passwords, env vars and secrets; not needed |
Useful custom sets:
Day-to-day management: 1, 10, 20, 21, 30, 31
Everything this server uses, without user management and credentials: 1, 2, 10, 20, 21, 30, 31
API tokens bypass the sudo check of the web UI; only the token's permission list counts. A missing permission returns HTTP 403 with code AT003, which the tools report together with a hint. With a Full Access token Cosmos returns credentials unmasked; this server still redacts them by field name (COSMOS_REDACT_SECRETS=true), but a narrower token is the better protection.
Configuration
Environment variables:
Variable | Default | Meaning |
| required | Base URL of Cosmos, e.g. |
| required | API token, starts with |
|
|
|
|
|
|
|
|
|
|
| Request timeout in seconds |
| unset | Path to a |
Copy .env.example to .env, fill it in and keep it out of version control.
Register with Claude Code
Keep the token in the .env file so it does not end up in the Claude Code config.
Docker:
claude mcp add cosmos --scope user -- \
docker run -i --rm --env-file /path/to/.env ghcr.io/alike03/cosmoscloudmcp:latestUse cosmos-cloud-mcp instead of the ghcr.io/... name if you built the image yourself.
docker run --env-file takes values literally, so write them without quotes in .env. If Cosmos runs on the same host and you use COSMOS_URL=https://localhost, add --network host (inside the container localhost is the container itself) and set COSMOS_VERIFY_TLS=false if the certificate is not issued for localhost.
Python package:
claude mcp add cosmos --scope user \
-e COSMOS_ENV_FILE=/path/to/CosmosCloudMCP/.env \
-- /path/to/CosmosCloudMCP/.venv/bin/cosmos-cloud-mcpAlternatively pass the variables directly with -e COSMOS_URL=... -e COSMOS_TOKEN=.... Check the connection with claude mcp list or /mcp inside Claude Code.
Other MCP clients: run the Docker command or .venv/bin/cosmos-cloud-mcp as a stdio server with the same environment variables.
Safety levels
Level | Behaviour | Tools |
Read | Always available, no side effects |
|
Write | Run directly; the MCP client's per-tool permission prompt is the approval |
|
Destructive | Without |
|
COSMOS_READ_ONLY=true does not register write and destructive tools at all.
cosmos_request is an escape hatch for endpoints without a dedicated tool (for example GET /api/cron). It applies the same levels: it classifies the method and path (several Cosmos endpoints change state via GET, such as manage/{action} or /api/restart), refuses non-read requests in read-only mode and requires confirm=true for destructive ones (any DELETE, restarts, restores, kill/remove, token and user management). It only reaches paths under /cosmos/api/ on the configured host.
Tool annotations (readOnlyHint, destructiveHint) are set accordingly, so clients can apply their own policies.
Notes
restore_backupposts{snapshotId, target, include}as the Cosmos web UI does.targetmust be an absolute path on the host; existing files there are overwritten. If the backup has auto-stop enabled, Cosmos stops the containers that use the source path during the restore. The restore runs as a background job: follow it withlist_jobs/get_job.remove_containeruses Docker defaults: the container must be stopped first and its volumes are kept.create_api_tokenreturns the raw token once. Cosmos refuses to grant permissions the calling token does not hold (AT016).Redaction is a best-effort safety net based on field names. Container logs are returned unmodified.
Development
docker build --target test . # run the unit tests in Docker
# or locally
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytestTests mock HTTP with respx; no Cosmos instance is needed. The OpenAPI spec of Cosmos v0.24.0 is in docs/api/.
License
MIT, see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Linux server administration over OAuth MCP: shell, Docker, systemd, files and monitoring.
Hosted MCP for Celesto cloud computers: create, exec, ports, start/stop/delete.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Caelara Labs Agent Safety tools over remote MCP. Calls need an X-Caelara-Key API key.
Related MCP Servers
AlicenseCqualityAmaintenanceThis Model Context Protocol server enables interaction with RunPod's REST API through Claude or other MCP-compatible clients, providing tools for managing pods, endpoints, templates, network volumes, and container registry authentications.366,573 npm87Apache 2.0- AlicenseNot gradedqualityDmaintenanceLets MCP clients (Claude Code, Claude Desktop) inspect a Linux home server's health over the network: uptime, load, memory, disk, Docker containers, systemd services, journal errors, and listening ports. Read-only, bearer-token secured.MIT
- FlicenseNot gradedqualityCmaintenanceA read-only, OAuth 2.1-authenticated MCP server that lets Claude inspect the live state of a self-hosted server — system resources, containers, service and website health, n8n automations, video jobs, backups, repositories, error summaries, a component design system, uptime monitoring, and its own audit trail. All twenty-one tools are strictly observation-only, with no shell, file browser, SQL console, or Docker socket, so nothing can be started, stopped, deployed, or deleted.-
- AlicenseNot gradedqualityAmaintenanceEnables MCP clients such as Claude Code, Claude Desktop, and Cursor to list hosts, read metrics, inspect containers, follow logs, and, when permitted, run commands, restart containers, manage authorized_keys, and edit host lists under per-host policy, Touch ID-backed credentials, deny-lists, rate limits, and an audit log.MIT