Docs

Create a disposable service with the msaas command line tool, the REST API or the MCP server. All three use the same API.

How do I use the command line tool?

Configure it with MSAAS_API_URL and MSAAS_API_KEY, or run msaas login. Add --json for machine-readable output.

$ msaas create redb-kv --ttl 4h --wait
created   <id> (redb-kv)
state     running
endpoint  https://<generated-name>.example
expires   <timestamp> (in 3h59m)
credentials (shown once by msaas; store them now):
  API_KEY=<generated>
$ printf %s "$KEY" | msaas login --api-url https://api.microsaas.app
$ msaas catalogue
$ msaas list
$ msaas get <id>
$ msaas usage
$ msaas delete <id> --yes
msaas commands
CommandWhat it does
loginStore an API key (read from stdin, checked against the API, saved with mode 0600).
whoamiShow the tenant and the scope of the key.
catalogueList the services that can be created.
create <service> [--ttl 1h..] [--memory MB] [--wait]Create a service. The TTL is whole hours, from 1h up to the plan maximum. Credentials are printed once.
list, get <id> [--show-secrets]Inspect services. Credentials are hidden unless --show-secrets is given.
start, stop, delete <id> [--yes]Control a service. Delete is irreversible.
usage [--from --to], creditsUsage records and the credit balance.
keys create --scope read|deploy|admin --label L, keys revoke <id>Manage API keys.
extend <id> --ttl 1h..24hAdd whole hours to a service lifetime, up to the plan maximum.
logs <id> [--tail N], metrics <id>, metrics --allRecent log lines and runtime counters.
tokens list|create|revoke|rotateManage account access tokens (needs an admin-tenant token).
org members|invites|invite|revokeList and manage the members and invites of your organisation.
webhook [set|test|deliveries|rotate|rm]Manage the outbound webhook endpoint.
runtime [set|remove]Use your own runtime account (the token is read from a private file).
profile [set]Show or edit your profile.
devRun catalogue services locally as native processes.

Exit codes:

msaas exit codes
CodeMeaning
0ok
1error (server, validation, network, timeout)
2usage error
3authentication or scope
4not found
5quota, plan limit, insufficient credit, rate limit, no plan or suspended account
6create --wait-ready: the endpoint did not answer in time (the service was created and is billed)

How do I use the REST API?

Send a bearer API key. Keys have a scope: read, deploy or admin; creating and deleting services needs deploy. The OpenAPI document is at https://api.microsaas.app/openapi.json. The full API reference lists every operation.

curl -X POST https://api.microsaas.app/v1/services \
  -H "Authorization: Bearer $MSAAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"service": "redb-kv", "ttl_s": 14400}'
HTTP 202
{
  "id": "<id>", "service": "redb-kv", "state": "<state>",
  "url": "https://<generated-name>.example",
  "ttl_s": 14400, "expires_at": <unix-seconds>, "created": <unix-seconds>,
  "memory_mb": <int>, "vcpus": <int>, "volume_mb": <int>,
  "secrets": { "API_KEY": "<generated>" }
}

The create call is the only one that returns credentials. Other endpoints:

REST API endpoints
EndpointWhat it does
GET /v1/catalogueList deployable services
POST /v1/servicesCreate a service (asynchronous, 202)
GET /v1/services, GET /v1/services/{id}List and inspect services
POST /v1/services/{id}/start, /stopStart or stop a service
DELETE /v1/services/{id}Delete a service and its storage
GET /v1/usageUsage records and balance (query: from, to as unix seconds)
POST /v1/keys, DELETE /v1/keys/{id}Create and revoke API keys
GET /v1/accountTenant, plan and caller scope
GET /v1/auditAudit trail for the tenant

How long does a service live?

Stateful services have a time to live of at least 1 hour, set in whole-hour steps; the default is 1 hour. The maximum depends on the plan: 4 hours on Free, 24 hours on Developer and up to 30 days on Pro. At expiry the service and its data are deleted and cannot be recovered. In the API, ttl_s is the time to live in seconds: 3600, 7200 and so on up to the plan maximum.

How do I use the MCP server?

msaas-mcp speaks MCP over stdio and calls the same API. Add it to your MCP client configuration:

{
  "mcpServers": {
    "MicroSaaS": {
      "command": "msaas-mcp",
      "env": {
        "MSAAS_API_URL": "https://api.microsaas.app",
        "MSAAS_API_KEY": "<a deploy-scope key>"
      }
    }
  }
}

Hosted alternative (Claude Code, browser sign-in with GitHub, no key to copy): claude mcp add --transport http MicroSaaS https://api.microsaas.app/mcp, then run /mcp, choose MicroSaaS and authenticate.

Tools: list_catalogue, describe_service, create_service, list_services, get_service, get_logs, get_metrics, get_metrics_all, extend_service, start_service, stop_service, delete_service, get_usage, get_credits, get_account, org_members. Use a deploy key to let the agent create and delete, or a read key for inspection only. delete_service is marked destructive, and credentials are returned only by create_service.

Where do I sign in and get a token?

The console at console.microsaas.app handles sign-in and API tokens: sign in. Create and manage services with the command line tool, the REST API or the MCP server.

Last updated