Claude Desktop MCP Integration¶
agentwatch includes an MCP (Model Context Protocol) server that allows Claude Desktop to manage coding sessions in tmux.
Quick Setup¶
-
Make sure agentwatch is installed and accessible in your PATH:
-
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
- 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¶
- "Command not found": Ensure agentwatch is in your PATH
- "No sessions found": The daemon may not be running. Start it with
agentwatch start - "Failed to create session": Check if tmux is installed and running
Enable debug logging by adding to your agentwatch config: