MCP and integrations
The master's MCP tool surface, worker tools, and project-local role overrides.


In this guide
AgentGrid is wired together through MCP — the master's surface for driving the canvas, the worker-spawned tools, and any third-party MCP servers a role configures.
The master's tool surface
Every harness with master-MCP support gets a scoped MCP configuration at launch. AgentGrid passes that configuration to the selected harness using its native integration. Per master, the surface is roughly ~40 tools grouped into four areas:
Canvas awareness
The master is blind to other panes until it opts in.
list_canvas_panes— list every pane on the current canvas.associate_pane({ paneId })/disassociate_pane({ paneId })— opt in / out of seeing a pane's content.read_pane({ paneId })— read an associated pane's content (image/video paths, note text, terminal scrollback, worker transcript).send_to_pane({ paneId, message })— deliver a message into an associated agent session pane (another master's live session), so two masters can collaborate. Same association gate asread_pane, cannot target your own pane. The delivered payload is wrapped in a fresh random-nonce fence —[message from master <sender paneId> · begin <nonce>]\n<body>\n[end <nonce>]— so the receiver can trust the outer attribution and treat the fenced body as untrusted content (the nonce is unforgeable per delivery). Only agent session panes accept messages.
Listing a pane does not expose its content. The master associates the target pane before reading it.
Diagram by AgentGridWorker lifecycle
spawn_worker,spawn_role,list_roles— spawn a worker, by raw prompt or by a named role.list_rolesentries includesource: "builtin" | "custom".create_role— define a project custom role in.agent-grid/roles.jsonsospawn_rolecan use it. Built-in role names are immutable and always hard-reject, even withoverwrite: true; that flag only replaces an existing custom role of the same name.send_to_worker— follow-up prompt to an existing worker (session is preserved via--resume).wait_for_worker,wait_for_any,read_worker_output— block on completion or peek mid-flight.list_workers,list_my_team— discover the workers / terminals / browsers this master owns.kill_worker,close_worker— interrupt a turn, with or without removing the pane.list_recoverable_sessions,resume_worker— re-attach orphan worker sessions after a master--resume.
See Orchestrating agents for the full review-loop pattern that uses these.
Terminals
spawn_terminal({ command?, args?, initialCommand?, customTitle?, cwd? })— open a long-running terminal pane.read_terminal_output({ paneId, sinceLine? })— poll ANSI-stripped output with cursor-based pagination.wait_for_terminal_pattern({ paneId, pattern, flags?, timeoutMs })— gate on a regex hit (great for dev-server readiness banners).read_dev_server_url({ terminalPaneId, timeoutMs })— convenience layer that recognises Vite / Next / Astro / SvelteKit / Express / Fastify startup banners.send_terminal_input,kill_terminal— write raw bytes, or shut down.
Browsers
spawn_browser({ url, customTitle?, cwd? })— open an observable Chromium pane.read_browser,navigate_browser,wait_for_browser_navigation— read content, push the same pane forward, gate on navigation events.screenshot_browser,kill_browser— capture viewport, or shut down.browser_navigate,browser_back,browser_forward,browser_reload,browser_read_page,browser_scroll,browser_screenshot— drive a pane you spawned or that the user attached.
Auth
Every master gets a per-pane control token written into its MCP config (AGENT_GRID_CONTROL_TOKEN). The MCP stdio child uses that token to authenticate against the localhost HTTP control server the Electron main process runs. Tokens are scoped per master pane.
Use your own MCP servers
Team leads load the MCP servers you already set up for their coding agent, such as an Azure DevOps, Jira or database server. There's no AgentGrid step: add the server the way that tool expects, then start a new lead. AgentGrid adds its own tools next to yours. GUI leads run them without asking unless you give them a lower access level; terminal leads follow Settings → Agents → Default permissions.
- Codex: add an
[mcp_servers.<name>]table to~/.codex/config.toml, or runcodex mcp add. - Claude Code: run
claude mcp add --scope user …, or commit a.mcp.jsonto the repo and approve it once in Claude Code. - Other agents: use that agent's normal MCP configuration. Hermes leads don't load your servers yet.
Workers are different:
- Codex workers load the same servers as a Codex lead.
- Claude workers on the Agent SDK, and workers on other agents, only get AgentGrid's tools for now. We're working on passing your servers through. Until then, give a Claude worker a server through a role's
mcpServersin.agent-grid/roles.json, and spawn it with that role:
{
"ado_builder": {
"systemPrompt": "You are a Builder with Azure DevOps access.",
"mcpServers": {
"azure-devops": { "command": "npx", "args": ["-y", "@azure-devops/mcp", "your-org"] }
}
}
}A role's mcpServers only reaches Claude workers. Edit the file by hand: create_role can't set it. If Settings → Agents → Agent execution is Interactive CLI, Claude workers load your Claude Code servers but ignore a role's mcpServers; add "backend": "sdk" to a role that needs them. The default, Agent SDK (default), uses the role's servers.
The Coordinator depends on its agent:
- On Claude, it loads your Claude Code servers the same way a lead does. Their tools run without asking at the Full access level or, with no level chosen, when Default permissions is Bypass Permissions. At a lower level, it asks before calls that need approval. With no level chosen and a stricter default, a call may ask for permission or be refused.
- On Codex or any other agent, it doesn't load your servers. It only gets AgentGrid's tools.
The Coordinator's job is to plan and hand work to leads, so the dependable route is giving the job to a lead that has your servers.
Keep secrets out of config files
AgentGrid doesn't store MCP secrets, and .agent-grid/roles.json usually lives in your repo. Don't put a token in its env.
- Prefer the server's own sign-in. Many servers can use a browser login or a CLI you're already signed in to (for example
az login), so there's no token at all. - Otherwise, start the server from a small script that reads the token from your OS credential store. The token then lives only in that server's process: not in a config file, not in a global environment variable. If the token can't be read, the script stops instead of starting the server without it.
In these scripts, ADO_TOKEN is a placeholder: use the variable or option your server reads its token from.
macOS: save the token in Keychain with security add-generic-password -a "$USER" -s azure-devops-pat -w, which prompts for it. Then save this script:
#!/bin/sh
# start-ado-mcp.sh
set -eu
ADO_TOKEN="$(security find-generic-password -s azure-devops-pat -w)"
export ADO_TOKEN
exec npx -y @azure-devops/mcp your-orgMake it executable with chmod +x /path/to/start-ado-mcp.sh, and point the server at it. In .mcp.json:
{
"mcpServers": {
"azure-devops": { "command": "/path/to/start-ado-mcp.sh" }
}
}In .agent-grid/roles.json, the same mcpServers block goes inside a role, like the ado_builder example above.
In Codex's config.toml, that's command = "/path/to/start-ado-mcp.sh" under [mcp_servers.azure-devops].
Windows: save the token in Credential Manager (Control Panel → Credential Manager → Windows Credentials → Add a generic credential, with the address azure-devops-pat, any user name and the token as the Password). Or run cmdkey /generic:azure-devops-pat /user:token /pass, which prompts for the token so it isn't on the command line. Then, in Windows PowerShell, run Install-Module CredentialManager -Scope CurrentUser once and accept its prompts.
# start-ado-mcp.ps1
$ErrorActionPreference = 'Stop'
$cred = Get-StoredCredential -Target azure-devops-pat
if (-not $cred) { throw 'No Windows credential named azure-devops-pat' }
$env:ADO_TOKEN = $cred.GetNetworkCredential().Password
npx -y @azure-devops/mcp your-org
exit $LASTEXITCODEPoint the server at the script. In .mcp.json:
{
"mcpServers": {
"azure-devops": {
"command": "powershell",
"args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "C:\\path\\start-ado-mcp.ps1"]
}
}
}In .agent-grid/roles.json, put it inside a role:
{
"ado_builder": {
"systemPrompt": "You are a Builder with Azure DevOps access.",
"mcpServers": {
"azure-devops": {
"command": "powershell",
"args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "C:\\path\\start-ado-mcp.ps1"]
}
}
}
}In Codex's config.toml:
[mcp_servers.azure-devops]
command = "powershell"
args = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", 'C:\path\start-ado-mcp.ps1']Project-local .agent-grid/roles.json
Custom roles live in <projectDir>/.agent-grid/roles.json. The file is a Record<string, RoleConfig> that merges over the built-in roles at runtime — you can add new roles or override fields on existing ones.
{
"design_reviewer": {
"systemPrompt": "You are a Design Reviewer. Audit the diff against the design system. Report findings only — no code changes.",
"disallowedTools": ["Write", "Edit"]
},
"qa": {
"models": {
"claude": "claude-opus-4-5",
"codex": "gpt-5.6-sol"
}
}
}Available fields: systemPrompt, allowedTools, disallowedTools, models, maxTurns, maxBudgetUsd, mcpServers, permissionMode, terminalAccess, writePathPrefixes, backend ('pty' or 'sdk'). The legacy singular model field remains supported for Claude-only roles.
A role that can run commands may spawn and control visible terminal panes unless it sets terminalAccess: false. AgentGrid enforces that role gate before terminal actions are dispatched, including when workers run through the background daemon.
See Reference → Roles for the field-by-field reference and the full built-in role table.
Related
-
Connect Hermes to AgentGrid and Discord — external MCP setup and a trusted Discord channel walkthrough.
-
Orchestrating agents — the spawn / wait pattern using the worker lifecycle tools.
-
Browsers — the observable browser surface.
-
The
.agent-grid/folder — all project-local conventions in one place. -
Observability with Langfuse — opt-in OpenTelemetry export from agent harnesses.