AI Agents
Agents provision worktrees,
not just query them.
MCP tools let agents create worktrees, allocate resources, wire up cross-repo dependencies, and control the dev server. AI agents work with real allocations instead of guessing.
Agents don't know about your environment
Your AI agent creates a worktree and tries to start the server. It doesn't know about port allocation, database cloning, or env files.
agent $ git worktree add ../fix-bug fix-bug
agent $ cd ../fix-bug && npm start
Error: EADDRINUSE :::3000
# Agent tries a random port...
agent $ PORT=4567 npm start
Warning: DATABASE_URL not set
# Agent guesses at database names...
agent $ createdb fix_bug_dev
# Works sometimes. Breaks often.
One MCP call provisions everything
The new tool creates the worktree, allocates ports, clones the database, writes the env file, and returns structured JSON with everything the agent needs.
tool: new args: branch: fix-auth-bug base: main
{
"worktree": "/code/myapp-fix-auth",
"branch": "fix-auth-bug",
"ports": [3010],
"database": "myapp_dev_fix_auth",
"url": "https://myapp-fix-auth-bug.prt.dev"
} What this makes possible
The declarative config and a git hook (installed by gtl install) do the heavy lifting. The MCP server is how agents execute provisioning and stay informed about what's running.
Agents provision full environments
The new and setup tools create worktrees with allocated ports, cloned databases, and resolved env files. One tool call, complete environment.
Agents wire cross-repo dependencies
The link tool overrides resolution so {resolve:api} points to a specific branch. env_sync and restart apply the change.
Multiple agents, no collisions
Each worktree stays isolated: its own ports, database name, and supervisor socket. An orchestrator running three agents in parallel reads deterministic state via status or list.
Three lines in your editor config
{
"mcpServers": {
"gtl": {
"command": "gtl",
"args": ["mcp"]
}
}
}
The agent can call new, setup, link, start, and status as structured tool calls. No shell commands, no output parsing.
Full toolset
Query allocations, provision worktrees, manage cross-repo links, and control dev servers through structured MCP tools.
Provisioning tools
Create worktrees, allocate resources, and manage configuration. These are the heavy lifters.
Query tools
Read allocation state, configuration, routing URLs, and cross-service resolution.
Supervisor control
Start, stop, and restart the dev server. Restart re-evaluates env including resolve links.
Structured output for non-MCP agents
For agents that can run shell commands but don't support MCP, use --json on any read command:
gtl status --jsongtl routes --jsongtl doctor --jsongtl env --jsongtl resolve <project> --json
MCP is the preferred interface (native tool calls, no parsing), but --json works for any agent that can run commands.
Connect your agent
Add the MCP config to your editor. Agents can then provision worktrees, manage links, and control the dev server.
{
"mcpServers": {
"gtl": {
"command": "gtl",
"args": ["mcp"]
}
}
}