Skip to main content

Using the CLI from an Agent

Agents can run the GameFlow CLI to create and update games, matchmakers and rating models, edit and publish a matchmaker's flow, upload and promote builds, launch, inspect and stop servers, and read usage and events.

Sign in​

Where the agent runsHow it signs in
Your machineRun gameflow login once. It opens your browser, you approve, and every agent session on that machine uses the stored login. No API key needed.
CI, a machine without a browser, a container or the cloudSet GAMEFLOW_API_KEY. A container or cloud agent can't see the login stored on your machine.

The key takes priority over a stored login, so unset it on your own machine if gameflow whoami shows the wrong account. See Authentication.

Built for agents​

  • Machine-readable output. Every command prints JSON, and gameflow schema describes every command, flag and exit code. See Scripting and CI.
  • Small output. --fields trims results to the fields the agent needs. See Output and Pagination.
  • Preview before changing anything. Commands that change something take --dry-run, which prints the request without sending it.
  • Errors it can branch on. Every failure has a stable code and exit code. See Errors and exit codes.

Use the CLI as an MCP server​

gameflow mcp serves every command as a tool over the Model Context Protocol, on standard input and output. An agent that speaks MCP can then call games_list, servers_launch and the rest directly, with the same flags as the CLI, instead of building shell commands.

claude mcp add gameflow-cli -- gameflow mcp

It uses the same credential as the CLI, so sign in first with gameflow login or set GAMEFLOW_API_KEY. Every tool returns the command's JSON, including errors. A few limits keep it safe for an agent to drive:

  • --from-file and --stdin are not available as tool arguments. Pass the fields directly.
  • builds create --file only accepts a file inside the directory the server was started in.
  • A call is stopped after 10 minutes.

This is separate from the docs MCP server, which searches these docs and can't change anything.