Forge

The terminal your
AI agents deserve

Persistent PTY sessions, multi-agent orchestration, and a real-time dashboard for AI coding agents — via the Model Context Protocol.

$ npx forge-terminal-mcp
23 MCP Tools
MIT License

See It In Action

forge — terminal orchestration

The Problem

Your agents are flying blind

AI coding agents run commands, but can't keep processes alive, monitor long-running services, or check back on what changed.

Lost Output

Agent runs npm start, output vanishes after the command. Next turn? Gone. Scrollback? Gone.

With Forge:

Ring buffer persists output. Incremental reads return only what's new. Nothing lost.

No Persistent Processes

Start a dev server, it blocks the agent. Kill it to do something else, now you can't check if it's still healthy. No way to keep services running and come back later.

With Forge:

10 persistent PTY sessions. Services stay alive. Batch read all of them in one call.

Blind Agents

Agents poll for results, re-read entire outputs, waste context tokens guessing whether a process is ready.

With Forge:

Event subscriptions. Pattern matching. Agents get notified, not poll.

Core Capabilities

Built for agent workflows

Persistent Sessions

Real PTY via node-pty — same library as VS Code's terminal. Sessions survive across agent turns. Interactive programs, colors, TUI apps all work.

// Each read returns only NEW output
read_terminal(sessionId) // → { data, droppedBytes }
// Up to 90% context token savings

Multi-Agent Orchestration

Spawn Claude and Codex as sub-agents with git worktree isolation. Agents can talk to each other — an orchestrator sends follow-up messages, sub-agents report back, enabling multi-turn conversations between agents.

delegate_task({
prompt: "Fix the auth bug",
mode: "interactive", // multi-turn
worktree: true
})

Event-Driven

subscribe_events and wait_for replace polling. Pattern matching on terminal output. Async MCP notifications.

wait_for({
sessionId,
pattern: "ready on port \\d+"
}) // blocks until matched

Real-Time Dashboard

Browser-based UI to watch what your agents are doing. Live terminal output, chat history browser, code review panel, memory monitoring. Zero build step.

$ npx forge-terminal-mcp --dashboard
// Dashboard at http://localhost:3141

Setup

Three commands. That's it.

1

Install

No global install needed. Runs via npx.

$ npx forge-terminal-mcp
2

Connect your agent

Add Forge as an MCP server to your agent of choice.

$ claude mcp add forge -- npx forge-terminal-mcp
3

Use it

Ask your agent to do full-stack work. Forge handles the terminals.

> "Start the React dev server and the API server,
run the test suite, and fix any failures."
Your Agent
(Claude Code / Codex / Custom)
|
MCP Protocol
|
FORGE
23 tools · ring buffer · event bus
/ | \
PTY 1
frontend
PTY 2
backend
PTY 3
tests

MCP Tools

23 tools, 7 categories

Every tool your agent needs to manage real terminal sessions.

Lifecycle

  • create_terminal
  • close_terminal
  • close_group
  • list_terminals
  • create_from_template

I/O

  • write_terminal
  • send_control
  • read_terminal
  • read_screen
  • read_multiple
  • resize_terminal

Search

  • grep_terminal

Execution

  • run_command

Events

  • wait_for
  • subscribe_events

Delegation

  • spawn_claude
  • spawn_codex
  • delegate_task

Ops

  • get_session_history
  • clear_history
  • get_terminal_info
  • get_dashboard_url
  • get_dashboard_sessions

Quickstart

Works with your agent

# Add Forge as an MCP server (stdio)

$ claude mcp add forge -- npx forge-terminal-mcp

# With web dashboard

$ claude mcp add forge -- npx forge-terminal-mcp --dashboard --port 3141

# Or add to ~/.claude/settings.json

{
  "mcpServers": {
    "forge": {
      "command": "npx",
      "args": ["forge-terminal-mcp"]
    }
  }
}

# Start Forge in HTTP mode first

$ npx forge-terminal-mcp start -d --dashboard --port 3141

# Add Forge as HTTP MCP server

$ codex mcp add forge --url http://127.0.0.1:3141/mcp

# Stdio transport (MCP standard)

$ npx forge-terminal-mcp # JSON-RPC over stdin/stdout

# HTTP transport

$ npx forge-terminal-mcp start -d --port 3141
# MCP endpoint: http://127.0.0.1:3141/mcp
# Dashboard: http://127.0.0.1:3141

Context Window Efficiency

Up to 90% fewer tokens

Per-consumer ring buffer cursors mean each read_terminal returns only new output since the last read. Your agent's context window stays lean.