AI Agents, MCP, and Skills
gflow can run as a local stdio MCP server, allowing agent CLIs such as Claude Code, Codex, and OpenCode to treat scheduler operations as tool calls instead of rewriting shell commands every time.
Use this as the MCP server command in your agent configuration:
gflow mcp servegflow mcp serve is a local stdio server command. MCP clients typically launch stdio servers as local child processes using the configured command and arguments.
Before connecting any agent CLI, first make sure the local scheduler is healthy:
gflowd up
gflowd status
ginfogflowdmust be started first.- If
gflowis not onPATH, use an absolute path instead. - To confirm the MCP subcommand is available, run
gflow mcp serve --help.
Claude Code
User-scope configuration is recommended:
claude mcp add --scope user gflow -- gflow mcp serveCommon check commands:
claude mcp list
claude mcp get gflowNotes:
- If you want the configuration to apply only to the current project, change
--scope userto--scope project. - If
gflowis not onPATH, switch to an absolute path, for example-- /home/you/.local/bin/gflow mcp serve.
Example CLAUDE.md:
# gflow workflow
- Use the `gflow` MCP server for queue, job, and log operations.
- Prefer read operations before mutating scheduler state.
- Ask before submit, cancel, hold, release, or update unless the user already asked for it.
- When a job fails, summarize the key log lines before proposing a retry.Codex
Minimal configuration:
codex mcp add gflow -- gflow mcp serveView the current configuration:
codex mcp list
codex mcp get gflowYou can also write it directly to ~/.codex/config.toml:
[mcp_servers.gflow]
command = "gflow"
args = ["mcp", "serve"]Notes:
- If
gflowis not onPATH, changecommandto an absolute path.
Example AGENTS.md:
## gflow
- Use the `gflow` MCP server for scheduler actions when available.
- Prefer read tools before writes.
- Confirm destructive job actions unless the user explicitly asked for them.
- Include job id, requested GPUs, and recent log evidence when reporting failures.OpenCode
OpenCode usually declares MCP directly in its config file. The global config is typically at ~/.config/opencode/opencode.json, and a project-level config can be placed at opencode.json in the repository root. Both also support JSONC.
Minimal example:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"gflow": {
"type": "local",
"command": ["gflow", "mcp", "serve"],
"enabled": true
}
}
}Check connection status:
opencode mcp listNotes:
- OpenCode local MCP uses
type: "local"and a command array. - If
gflowis not onPATH, changecommandto an absolute-path array.
FAQ
MCP is already added, but the agent cannot see the gflow tools
Check these first:
gflowd status
ginfo
gflow mcp serve --helpCommon causes:
gflowdis not running.gflowis not on thePATHseen by the agent process.- The local config points to the wrong daemon address or port.
- If you start
gflow mcp servedirectly in a shell, it will wait for stdio traffic from an MCP client.