@learning-with-court/cli
v0.12.0
Published
CLI for learning-with-court — proxies MCP and bootstraps workshop projects.
Readme
@learning-with-court/cli
CLI for the learning-with-court platform. Two modes:
- Stdio MCP proxy (default): forwards tool calls from a local agent to
the hosted MCP server at
mcp.workshop.institute. Auth resolves via env var (LWC_TOKEN) → cached~/.lwc/token.json→ browser sign-in. - Subcommands for one-shot operations:
setup <workshop-id> [--dir <path>]— clone a workshop project repo (default:~/learning-with-court/<workshop-id>/). Pass--dirto install somewhere else; the CLI auto-creates parent directories.refresh <workshop-id>— refresh the clone token andgit pull.auth login/auth logout— manual control of the cached token.
Usage
# Bootstrap a workshop project (default: ~/learning-with-court/<workshop-id>/)
npx -y @learning-with-court/cli@latest setup mcp-workshop
# Install into a folder of your choice instead
npx -y @learning-with-court/cli@latest setup mcp-workshop --dir ~/workshops/mcp-workshop
# Run as MCP proxy (configured by an agent's .mcp.json)
npx -y @learning-with-court/cli@latestAuth flow
lwc auth login (and any subcommand that needs a token) runs an
authorization-code + PKCE flow against workshop.institute:
- The CLI starts a loopback server on an ephemeral localhost port and
opens
https://workshop.institute/cli-auth?...with a PKCE challenge and random state. - You sign in (if needed) and click Authorize.
- The browser redirects to
http://localhost:<port>/callback?code=..., the CLI exchanges the code atmcp.workshop.institute/cli/token, and caches the resulting JWT.
Tokens are RS256 JWTs signed by an AWS KMS key; the public key is
published at https://mcp.workshop.institute/.well-known/jwks.json.
Lifetime: 90 days. After expiry, re-run lwc auth login.
Environment overrides
LWC_TOKEN— bypass the cache and use this token directly.LWC_API_URL— point at a different MCP API origin (defaulthttps://mcp.workshop.institute).LWC_LANDING_URL— override the browser-side landing origin (default is derived fromLWC_API_URL:mcp.andmcp-prefixes are stripped, somcp-dev.workshop.institute→dev.workshop.institute).
Token storage
~/.lwc/token.json, mode 0600. Contains the JWT, expiry, and the
opaque user identifier. Delete the file or run lwc auth logout to
revoke locally.
