terminal-pilot-mcp
v0.0.52
Published
MCP server that exposes terminal pilot automation as tools.
Maintainers
Readme
terminal-pilot-mcp
MCP server that wraps terminal-pilot and exposes terminal automation as MCP tools.
To install the companion CLI skill that teaches agents how to use these tools, see the terminal-pilot CLI skill installer.
Install
npm install -g terminal-pilot-mcpRun it
Development:
npx tsx packages/terminal-pilot-mcp/src/cli.tsBuilt / installed package:
terminal-pilot-mcpProgrammatic:
import { main } from "terminal-pilot-mcp";
await main();Connect to an MCP client
Claude Code (~/.claude.json or project .mcp.json):
{
"mcpServers": {
"terminal-pilot": {
"command": "terminal-pilot-mcp"
}
}
}Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"terminal-pilot": {
"command": "terminal-pilot-mcp"
}
}
}Cursor (.cursor/mcp.json):
{
"mcpServers": {
"terminal-pilot": {
"command": "terminal-pilot-mcp"
}
}
}Without a global install — use npx in any of the configs above:
{
"mcpServers": {
"terminal-pilot": {
"command": "npx",
"args": ["terminal-pilot-mcp"]
}
}
}Tools
void means the tool returns no payload.
| Tool | Input | Output |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| terminal_create_session | { command: string, args?: string[], session?: string, cwd?: string, cols?: number, rows?: number, observe?: boolean } | { session: string, pid: number } |
| terminal_fill | { session?: string, text: string } | void |
| terminal_type | { session?: string, text: string } | void |
| terminal_press_key | { session?: string, key: TerminalKey } | void |
| terminal_send_signal | { session?: string, signal: string } | void |
| terminal_wait_for | { session?: string, pattern: string, timeout?: number, literal?: boolean } | { matched: true, line: string } |
| terminal_wait_for_exit | { session?: string, timeout?: number } | { exitCode: number } |
| terminal_read_screen | { session?: string } | { lines: string[], cursor: { row: number, col: number }, size: { rows: number, cols: number }, exitCode: number \| null } |
| terminal_read_history | { session?: string, last?: number } | { lines: string[], exitCode: number \| null } |
| terminal_resize | { session?: string, cols: number, rows: number } | void |
| terminal_close_session | { session?: string } | { exitCode: number } |
| terminal_get_session | { session?: string } | { session: string, pid: number, command: string, exitCode: number \| null } |
| terminal_list_sessions | {} | { sessions: Array<{ session: string, command: string, pid: number }> } |
Practical notes:
terminal_fillsends text all at once (\n→\r). Use for bulk text entry.terminal_typesends text character-by-character with a small delay between keystrokes. Use for TUI apps that react to each keystroke (vim insert mode, readline, etc.).terminal_wait_for.patternis compiled as a JavaScriptRegExpby default. Setliteral: trueto match the string exactly (no regex interpretation — safe for file names, dots, etc.).terminal_wait_for_exitblocks until the process exits and returns its exit code. Throws on timeout.terminal_read_screenandterminal_read_historyincludeexitCode: number | nullso you can check whether the session is still running without a separate call.terminal_get_sessionreads session metadata without any side effects — useful for checkingexitCodebefore deciding whether to wait or close.terminal_close_sessionkills the process (if still running) and removes the session from the server's session map. After this call, the session name is invalid.terminal_read_screenreturns the current visible screen, not scrollback.terminal_read_historyreturns ANSI-stripped output since session start.terminal_list_sessionsreturns running sessions only (sessions whose process has exited are excluded from the list but remain accessible viaterminal_get_sessionuntilterminal_close_sessionis called).observe: truemirrors PTY output tostderr, useful when debugging MCP-driven runs.
Minimal MCP flow:
{"tool":"terminal_create_session","arguments":{"command":"poe-code","args":["configure"]}}
{"tool":"terminal_wait_for","arguments":{"session":"<session>","pattern":"Pick an agent to configure:"}}
{"tool":"terminal_press_key","arguments":{"session":"<session>","key":"Enter"}}
{"tool":"terminal_read_screen","arguments":{"session":"<session>"}}
{"tool":"terminal_close_session","arguments":{"session":"<session>"}}Environment Variables
There are no environment variables specific to this package. The MCP server inherits the process environment; spawned terminal sessions inherit from that unless overridden per session.
Configuration Options
Configure the server through the MCP client entry: command and optional args. Runtime session behavior is configured per tool call with fields such as command, args, cwd, cols, rows, observe, timeout, and last.
