Library Reference

Knot provides several libraries in the knot.* namespace for interacting with the platform from scripts.


Available Libraries

Library Description
knot.apiclient Transport configuration for standalone use
knot.space Space management operations
knot.ai AI completion functions
knot.mcp MCP tool interaction
knot.skill Skills management
knot.stack Stack definition and instance management
knot.template Template management
knot.volume Volume management
knot.user User management
knot.group Group management
knot.role Role management
knot.vars Variables management
knot.permission Permission checking
knot.healthcheck Space health monitoring (agent-side only)
knot.audit Audit log search and filtering

Usage

Import libraries using standard Python import syntax:

import knot.space as space
import knot.ai as ai
import knot.mcp as mcp

# Use the libraries
spaces = space.list()
client = ai.Client()
tools = mcp.Client().tools()

Environment Compatibility

All knot.* libraries are available in all embedded environments (local, MCP, remote), except knot.healthcheck which is only available in agent-side health check scripts. knot.ai and knot.mcp are only available in embedded contexts — external scripts should use scriptling.ai and scriptling.mcp directly.


Authentication

Scripts automatically authenticate using the context they’re running in — no explicit token handling is needed. The knot.apiclient transport is pre-configured by the runtime.