npm.io
0.9.21 • Published 13h agoCLI

@skilder-ai/runtime

Licence
See license in LICENSE
Version
0.9.21
Deps
12
Size
16.2 MB
Vulns
0
Weekly
0

Skilder - Runtime

Runtime process for Skilder instances. Typically used to consume Skilder as MCP Server from an agent or to execute tool calls on the edge.

Run as MCP Server

Add the following configuration in your MCP Client. This will run an "agent" on Skilder where you'll be able to add any tools from your instance.

{
  "mcpServers": {
    "skilder": {
      "command": "npx",
      "args": ["@skilder-ai/runtime"],
      "env": {
        "USER_KEY": "<YOUR_USER_API_KEY>"
      }
    }
  }
}

Run as a tool executor

Execute the following command in your terminal:

Recommended: Using a runtime key

RUNTIME_KEY=<RUNTIME_API_KEY> npx @skilder-ai/runtime

Using a system key

SYSTEM_KEY=<SYSTEM_API_KEY> RUNTIME_NAME=<NAME_OF_RUNTIME> npx @skilder-ai/runtime

This will start a long-living node process with the ability to host MCP Servers and execute their tools from this runtime.

## Running in Docker / Health check

### Health endpoint

When `REMOTE_PORT` is set, the runtime exposes `GET /health`:

- **`200 { status: 'ok' }`** — NATS connected, an active round-trip probe (`flush`, 2s timeout) succeeded, and the runtime is authenticated
- **`503 { status: 'error', message: '...' }`** — NATS disconnected, NATS unreachable (flush timed out), not authenticated, or an unexpected error occurred

> **Note:** The health endpoint is only available when `REMOTE_PORT` is set. CLI/standalone mode (no `REMOTE_PORT`) does not start an HTTP server — this is intentional.

### Docker Compose setup

```yaml
services:
  runtime:
    image: your-runtime-image
    environment:
      REMOTE_PORT: "3001"
      RUNTIME_KEY: "<RUNTIME_API_KEY>"
      NATS_SERVERS: "nats:4222"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 60s  # Allow time for NATS connect + auth
    restart: unless-stopped

start_period: Set this to at least 60s to allow enough time for the initial NATS connection and authentication handshake before Docker starts counting health check failures.

Keywords