Skip to content

Claude Desktop MCP Integration

agentwatch includes an MCP (Model Context Protocol) server that allows Claude Desktop to manage coding sessions in tmux.

Quick Setup

  1. Make sure agentwatch is installed and accessible in your PATH:

    which agentwatch
    

  2. Add the MCP server to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "agentwatch": {
      "command": "agentwatch",
      "args": ["--mcp"]
    }
  }
}
  1. Restart Claude Desktop

Available Tools

Once connected, Claude will have access to these session management tools:

Tool Description
session_start Create a new coding session with Claude Code
session_respond Send keystrokes to the session (e.g., "y", "1", "Enter")
session_capture Capture terminal content
session_exit Send /exit to Claude Code
session_terminate Kill the tmux session
session_status Get current session status
list_sessions List all active coding sessions
task_run Run a one-shot task in the background
task_status Check status of a background task

Available Resources

The MCP server also exposes resources for reading session data:

Resource URI Description
agentwatch://sessions JSON list of all sessions
agentwatch://session/{name} Single session state as JSON
agentwatch://session/{name}/terminal Terminal content (ANSI stripped)
agentwatch://session/{name}/terminal/raw Terminal content with ANSI codes

Example Usage

Ask Claude to: - "Start a coding session to fix the bug in src/api.py" - "Check the terminal output of my coding session" - "Send 'y' to approve the changes" - "Exit Claude Code and terminate the session"

Configuration

You can pass additional arguments to customize behavior:

{
  "mcpServers": {
    "agentwatch": {
      "command": "agentwatch",
      "args": [
        "--mcp",
        "--config", "/path/to/config.yaml",
        "--mcp-socket", "/custom/tmux/socket"
      ]
    }
  }
}

Troubleshooting

  1. "Command not found": Ensure agentwatch is in your PATH
  2. "No sessions found": The daemon may not be running. Start it with agentwatch start
  3. "Failed to create session": Check if tmux is installed and running

Enable debug logging by adding to your agentwatch config:

service:
  log_level: DEBUG