NPCterm: Full PTY Terminal Emulator for AI Agents via MCP

✍️ OpenClawRadar📅 Published: April 15, 2026🔗 Source
NPCterm: Full PTY Terminal Emulator for AI Agents via MCP
Ad

NPCterm is a headless, in-memory full PTY terminal emulator for AI agents, exposed via MCP (Model Context Protocol). It gives AI agents full terminal access, not just bash, allowing them to spawn shells, run arbitrary commands, read screen output, send keystrokes, and interact with TUI applications.

Key Features

  • Full ANSI/VT100 terminal emulation with PTY spawning via portable-pty
  • 15 MCP tools for complete terminal control over JSON-RPC stdio
  • Process state detection – knows when a command is running, idle, waiting for input, or exited
  • Event system – ring buffer of terminal events (CommandFinished, WaitingForInput, Bell, etc.)
  • AI-friendly coordinate overlay for precise screen navigation
  • Mouse, selection, and scroll support for interacting with TUI applications
  • Multiple concurrent terminals with short 2-character IDs
Ad

Example MCP Flow

The source provides a concrete example of using NPCterm to open and quit Vim:

// 1. Create a terminal
// -> terminal_create {}
// <- {"id": "a0", "cols": 80, "rows": 24}

// 2. Open vim // -> terminal_send_keys {"id": "a0", "input": [{"text": "vim"}, {"key": "Enter"}]} // <- {"success": true}

// 3. Read the screen to confirm vim is open // -> terminal_show_screen {"id": "a0"} // <- ~ VIM - Vi IMproved // <- ~ version 9.2.250 // <- ~ by Bram Moolenaar et al. // <- ~ type :q<Enter> to exit // <- ...

// 4. Quit vim // -> terminal_send_keys {"id": "a0", "input": [{"text": ":q"}, {"key": "Enter"}]} // <- {"success": true}

The source includes a warning: "Use with precautions. A terminal is an unrestricted execution environment." This tool is effectively equivalent to giving an AI agent access to a computer.

The project is available on GitHub at github.com/alejandroqh/npcterm.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also

Claude Octopus v8.48: Multi-AI Orchestration Plugin for Development Workflows
Tools

Claude Octopus v8.48: Multi-AI Orchestration Plugin for Development Workflows

Claude Octopus v8.48 is an open-source plugin that orchestrates Claude, Codex, and Gemini AI models in parallel with distinct roles across development phases. It includes a 75% consensus gate between phases, fresh context windows for complex tasks, and specific commands like /octo:embrace for full lifecycle development.

OpenClawRadar
Wisepanel MCP Server Enables Multi-LLM Deliberation in Claude Code and Cursor
Tools

Wisepanel MCP Server Enables Multi-LLM Deliberation in Claude Code and Cursor

Wisepanel released an MCP server that runs multi-agent deliberations directly from Claude Code, Cursor, or any MCP client, using a divergent context enhancement system with ChatGPT, Claude, Gemini, and Perplexity models.

OpenClawRadar
AgentHandover: Mac menu bar app that creates agent skills by watching your screen
Tools

AgentHandover: Mac menu bar app that creates agent skills by watching your screen

AgentHandover is an open-source Mac menu bar app that uses Gemma 4 running locally via Ollama to watch your screen and turn repeated workflows into structured Skill files that any agent can follow. It offers both Focus Record for specific tasks and Passive Discovery that picks up patterns from background observation.

OpenClawRadar
AI Subroutines: Deterministic Browser Automation with Zero Token Cost
Tools

AI Subroutines: Deterministic Browser Automation with Zero Token Cost

rtrvr.ai's AI Subroutines let you record browser tasks once as callable tools that replay inside the webpage context with auth propagated for free, eliminating LLM inference costs and non-determinism for repetitive tasks.

OpenClawRadar