ktxby Kaelio
Docs
CLI Reference

ktx mcp

Run the ktx MCP HTTP server for agent clients.

ktx mcp starts, stops, inspects, and tails the local ktx MCP server for a ktx project. Use it when an agent client connects through MCP instead of generated CLI instructions.

Command signature

ktx mcp <subcommand> [options]

Subcommands

SubcommandDescription
startStart the ktx MCP HTTP server
stopStop the ktx MCP daemon
statusShow daemon status, URL, PID, token mode, and project path
logsPrint the daemon log

mcp start Options

FlagDescriptionDefault
--host <host>Host to bind127.0.0.1
--port <n>Port to bind7878
--token <token>Bearer token for non-loopback bindingKTX_MCP_TOKEN
--foregroundRun the server in the foregroundfalse
--allowed-host <host>Additional allowed Host header; repeatable-
--allowed-origin <origin>Allowed browser Origin header; repeatable-

mcp logs Options

FlagDescriptionDefault
--followFollow log outputfalse

Examples

# Start the daemon on localhost
ktx mcp start

# Check status
ktx mcp status

# Tail logs
ktx mcp logs --follow

# Run in the foreground on a custom port
ktx mcp start --port 8787 --foreground

Security notes

The default host is loopback-only. If you bind to a non-loopback host, configure a bearer token with --token <token> or KTX_MCP_TOKEN and restrict allowed hosts and origins for browser clients.

Common errors

ErrorCauseRecovery
No ktx project foundCurrent directory has no ktx.yaml and KTX_PROJECT_DIR is unsetRun from a ktx project or pass --project-dir <path>
Non-loopback host rejectedThe server needs token auth before binding beyond localhostPass --token <token> or set KTX_MCP_TOKEN
Client cannot connectHost, port, token, allowed host, or allowed origin does not match the clientCheck ktx mcp status, then restart with explicit --host, --port, --allowed-host, and --allowed-origin values