Skip to content
d3uceYPublic

About

lets an AI agent perform stdin operations and read stdout/stderr on a host computer

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Wraith

Wraith

A terminal for AI agents: commands, scripts, files and background jobs over MCP streamable HTTP, with separate stdout/stderr.

Plain-text or JSON results, persistent shells, absolute read cursors, and an optional tray. Windows, macOS and Linux.

Install

Homebrew (macOS/Linux):

brew install --cask d3uceY/wraith-homebrew-cask/wraith

npm:

npm install -g @deuce/wraith

npm 11.4+ blocks postinstall scripts. Allow it with --allow-scripts=@deuce/wraith, or let the shim download on first run. Prebuilt binaries: releases. Build with Go 1.25.5+:

go build -o wraith .

Run

wraith serve                    # MCP: http://127.0.0.1:7799/mcp
wraith serve --token "secret"   # require Authorization: Bearer secret
wraith tray                     # serve with a tray icon
wraith run -- go test ./...     # local command, same terminal
wraith info                     # OS, shell, workdir
Flag Does Example
--listen Bind address; default 127.0.0.1:7799. wraith serve --listen 127.0.0.1:9000
--path MCP endpoint path; default /mcp. wraith serve --path /ghost
--token Require Authorization: Bearer; default $WRAITH_TOKEN. wraith serve --token secret
--workdir Default session directory; default current. wraith serve --workdir ~/code/app
--tray Show a tray icon; off for serve, on for tray. wraith serve --tray
--stateless No MCP session IDs; default off. wraith serve --stateless
--allow-remote Permit a non-loopback bind without a token; default off (prefer --token). wraith serve --listen 0.0.0.0:7799 --allow-remote
--log-level debug, info, warn or error; default info. wraith serve --log-level debug

Other limits: --max-sessions, --buffer-bytes, --exec-timeout, --session-ttl, --exited-ttl. Full list: wraith serve --help.

Connect

Streamable HTTP client config (field names vary):

{
  "mcpServers": {
    "wraith": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:7799/mcp",
      "headers": { "Authorization": "Bearer secret" }
    }
  }
}

Omit headers when no token is set. Health: GET /healthz.

Tools

Tool Does
terminal_info OS, arch, host, shells, workdir, limits.
terminal_exec One command or script; stdout, stderr, exit code.
file_read Host file as text or base64, paged.
file_write Host file from text or base64.
job_start Background command; returns a job id.
job_status Running state, exit code, last lines.
job_list Background jobs.
job_cancel Stop a job; output stays readable.
terminal_open Persistent shell or direct process.
terminal_write stdin; newline: true submits a line.
terminal_read Long-poll stdout/stderr; pass the returned cursors back.
terminal_close Terminate a session or job.
terminal_list Live and exited sessions and jobs.

Non-zero exits are results, not tool errors. Read exited sessions before closing. Shells: pwsh/PowerShell/cmd on Windows; $SHELL, then bash/zsh/fish/sh elsewhere. stdout/stderr are pipes, not a PTY: full-screen TUI apps need a non-interactive mode.

Large output, files and jobs

  • format: "text" returns plain stdout, not JSON. Trailers only for stderr, failure or prompt.
  • output_file writes full stdout to the host; read it back with file_read.
  • script runs a multi-line body verbatim, with no quoting layer.
  • input_idle_ms (default 3000) stops a command waiting at a prompt and returns waiting_for_input with the prompt.
  • A job id works as a session id: job_status gives a tail, terminal_read gives full output, job_cancel stops the job, terminal_close removes it.
  • file_read returns 512 KiB per call (max 4 MiB); pass next_offset to continue. Binary output is base64.

Sessions and jobs share --max-sessions.

Security

Commands run as the user. There is no sandbox.

  • Loopback by default.
  • Non-loopback binds require --token unless --allow-remote.
  • /sse is a 404. Health and / carry no secrets.
  • Report vulnerabilities via SECURITY.md.

Docs

Agent workflow · Publishing · Logo source

Develop

go test ./...
go vet ./...
goreleaser check

MIT.

About

lets an AI agent perform stdin operations and read stdout/stderr on a host computer

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages