Skip to content

MCP Module

Slug: mcp

Overview

Tower exposes an MCP (Model Context Protocol) Server that allows external AI agents to interact with the platform programmatically. The server runs via stdio transport. Any MCP-compatible client — such as Claude CLI, OpenClaw, or Paperclip — can connect and manage workspaces, projects, and tasks, identify projects, answer project-knowledge questions, manage notes and assets, start and monitor task executions, send input to running terminals, search, pull daily reports, and route durable gateway conversations, all without touching the Tower UI. Tool groups and profile membership are derived from src/mcp/tool-capabilities.ts; this document intentionally does not maintain a separate tool total.

Details

  • Stdio transport: The MCP server communicates over standard input/output, making it easy to integrate with any process-based MCP client.
  • Capability-scoped catalogs: Workspace, project, task, label, search, knowledge, notes/assets, terminal, reporting, messaging, bounded CapabilityRequest, Workbench, and gateway capabilities are composed per runtime (see the Harness module).
  • Internal HTTP bridge: Since MCP runs as a separate stdio process, it cannot access in-memory PTY sessions directly. Localhost-only HTTP routes (/api/internal/terminal/[taskId]/buffer, /input, /start, /stop, and /resume) bridge this gap.
  • External orchestration workflow: Create a task, start execution, monitor via terminal output polling, send interactive input, and check completion status — all through MCP tools.

Startup Configuration

json
{
  "mcpServers": {
    "tower": {
      "command": "npx",
      "args": ["tsx", "<project-root>/src/mcp/index.ts"]
    }
  }
}

The default full profile preserves existing MCP configurations. Set TOWER_MCP_PROFILE to select a narrower runtime surface; unknown values fail startup instead of falling back to full.

ProfileRuntimeCapability surface
fullBackward compatibilityComplete catalog
assistantTower's in-process Assistantcore + terminal
taskTower task terminalscore + terminal + messaging + workbench
gatewayOpenClaw/Hermes gateway processread-only core/terminal + gateway + operations
gateway-querySeparate read-only bridgebounded project query and discussion delivery

Profiles reduce discovery and availability as defense in depth. They do not replace OWNER/NON_OWNER sender policies or authorization and binding checks in tool handlers.

File Reference

Core (src/mcp/)

FileDescription
server.tsMCP Server initialization and configuration
db.tsMCP-dedicated database connection
index.tsEntry point and exports
tool-capabilities.tsSingle source for capability groups, profiles, and gateway allowlists
tool-catalog.tsMaps capability profiles to concrete schemas and handlers

Tool Modules (src/mcp/tools/)

FileDescription
workspace-tools.tsWorkspace CRUD
project-tools.tsProject CRUD + product groups
task-tools.tsTask CRUD + move + defaults + versions
unattended-goal-tools.tsOptional unattended Goal runtime (outside Core; grants no external authorization)
gateway-capability-tools.tsCapability discovery, bounded Direct requests, minimal Tower result reads, and read-only external Job reconciliation
label-tools.tsLabel CRUD + set_task_labels
search-tools.tsGlobal search
knowledge-tools.tsidentify_project
knowledge-base-tools.tsask_project_knowledge / manage_project_facts
note-asset-tools.tsmanage_notes / manage_assets
terminal-tools.tsstart execution + terminal output/input/status + close terminal + resume/launch terminal
report-tools.tsdaily_summary / daily_todo
harness/messaging, gateway query/owner, Workbench, and operations adapters (see the Harness module)

Internal HTTP Bridge

MCP stdio processes cannot access in-memory PTY sessions, so internal HTTP routes provide a bridge:

  • GET /api/internal/terminal/[taskId]/buffer
  • POST /api/internal/terminal/[taskId]/input
  • POST /api/internal/terminal/[taskId]/start
  • POST /api/internal/terminal/[taskId]/stop (reuses the Stop button logic)
  • POST /api/internal/terminal/[taskId]/resume (defaults to the Continue/Retry button logic; fresh start when no history)
  • POST/PATCH/PUT /api/internal/harness/gateway (durable inbound routing, completion acknowledgement, and retryable project replies)
  • GET/POST /api/internal/harness/capabilities (discovery, minimal request status, and deterministic Direct submission)
  • POST /api/internal/harness/capabilities/completions (scoped OpenClaw Job callback followed by authoritative read-only reconciliation and a Workbench wakeup)
  • Restricted to localhost