The server
turf-mcp-server is the Turf™ MCP server: the binary your agent starts. This page shows how to choose
how it is reached, which tools it lists and which engine it drives. Every flag, with its environment
variable, is in the table at the end.
turf-mcp-server # MCP over stdio: every tool, the local engineturf-mcp-server --transport http # MCP over HTTP on 127.0.0.1:3000turf-mcp-server --tier plan # list only what a plan-tier server may callturf-mcp-server --version # the version, then the license linesAn agent’s MCP configuration starts it with no arguments: see Connect your agent.
With the npx install the binary is not on your PATH: npx -y @turfbuild/turf-mcp-server stands for
turf-mcp-server in every command on this page. Where a flag has an environment variable, the variable sets the flag’s default and a flag given on the
command line wins.
Transports
Section titled “Transports”stdio is the default. The client starts the server as a child process and speaks MCP over its standard input and output.
HTTP is --transport http. The server serves MCP’s Streamable HTTP transport at /mcp on
--addr, 127.0.0.1:3000 by default, so a client connects to http://127.0.0.1:3000/mcp. The default
binds loopback only. Over HTTP the server also offers subscriptions to its
resources; over stdio it does not.
The HTTP endpoint is open to whoever can reach it. To require a bearer token, set
TURF_MCP_AUTH_TOKEN in the server’s environment:
- Every request must then send
Authorization: Bearer <token>. Any other request gets401. - The token is read only from the environment, so it stays out of the process list. It must be printable ASCII with no whitespace, or the server refuses to start.
- Set it whenever anything you do not trust can reach the port: a CI runner where the agent’s container shares the network with the server, or a bind other than loopback.
- The endpoint has no TLS. The token crosses the network in cleartext, so keep the path to the server private.
- The stdio transport ignores it.
A non-loopback --addr without a token is served, with a warning in the log.
--tier (TURF_TIER) decides which tools the server lists and what their arguments may do. A
credential handed to a server buys its tier’s calls and no other. The default is full.
| Tier | Tools it lists | What it may do |
|---|---|---|
read |
init, open, close, status, list, watch, show, output, state_list, provider_search, provider_describe, skill_deployment, skill_authoring, skill_guide, read_skill_file |
Read workspaces, states, plans, outputs and the provider registry, and wait for drift. Nothing runs: init, open and close only bind the workspace a read needs. |
plan |
the read tools, plus up, destroy, refresh, import, invoke, plan, cancel |
Start runs, every one plan_only: it ends planned, with a planfile for an applier. cancel stops a convergence before its apply begins. |
apply |
the read tools, plus apply, cancel |
Apply a planfile, or approve a plan waiting at its approval point. It starts no run of its own. |
full |
every tool: the above, plus taint, untaint, delete, drift |
Everything, open’s force_unlock included. drift changes what the engine reads unattended, so no other tier lists it, and up takes drift: { … } only here. |
The read tier lists 15 tools, plan 22, apply 17 and full 27. Each tool’s page says which tiers
list it: Tools.
Tiers split planning from applying. A plan-tier server plans and keeps each plan as a planfile; an
apply-tier server, run with its own credentials, applies it: apply with workspace_alias, planfile
and plan_digest. See Planfiles.
The tier also shows in what the agent is offered:
- The
up,destroyandwatchprompts are listed at theplanandfulltiers only.guideis listed at every tier. - The
readandapplytiers list noup. There,watchandstatusreport drift and name no next call, and their note says theupstarts from a server at theplanorfulltier. - At the
read,planandapplytiers the server instructions gain a section that names the tier and what it can do.
The engine
Section titled “The engine”Plans and applies run in the Turf engine, a separate process the server drives. --restate-url
(TURF_RESTATE_URL) names its restate-server ingress: an http(s) URL such as
http://127.0.0.1:8080, or unix:<socket path>.
Left empty, the server uses this user’s local engine: a restate-server, turf-engine and the console
(turf-ui) in $TURF_HOME/engine, by default ~/.turf/engine. Every server on the machine shares it,
and a convergence waits in it between sessions.
- The server starts the engine on demand. The first tool call that needs the engine starts it when
none is running, and waits up to 90 seconds. A call that outlasts that is told the engine is still
starting, and to call again. The engine then runs in the background, outliving the server and the
client, until
engine stop. - The Homebrew service starts it at login instead.
brew services start turfruns the same engine and takes over one a server started.turf-mcp-server engine runruns it in a terminal. - The server starts none when
TURF_ENGINE_AUTOSTART=off, in a container (TURF_DEPLOYMENT=container), when it cannot findrestate-serverorturf-engine, or until the license terms are accepted. The error says which. A start that fails explains itself in$TURF_HOME/engine/supervisor.log. init, the provider tools and the skills work without an engine. At startup an engine that cannot be reached is only a warning in the log. An engine the server cannot drive stops it.- Providers run in the engine, with the engine’s environment and, over it, the provider
environment: the variables this server sends by name.
--provider-envandTURF_PROVIDER_ENVname them when the server starts, and their values go to the engine when a run starts. Nothing else of the server’s environment reaches a provider. Never sent, even when named:PATH, the home and shell variables (HOME,USER,LOGNAME,SHELL,TMPDIR,PWD), the dynamic loader’s (LD_*,DYLD_*), Turf’s and Restate’s own (TURF_*,RESTATE_*), CI markers, the plugin handshake andTF_LOG*. An entry that names one, or a bare*, stops the server at start. An engine the server started has a small fixed environment of its own. See Send a variable to providers and The engine’s environment.
--scopes (TURF_ENGINE_SCOPES, on or off, default on) sets flow-control scopes. It must match
the engine’s own --scopes, which the server checks when it connects. The local engine runs with
scopes on, so --scopes off needs --restate-url.
engine subcommands
Section titled “engine subcommands”turf-mcp-server engine manages the local engine:
| Command | What it does |
|---|---|
engine run |
Runs the local engine in the foreground until interrupted. The Homebrew service runs this. Until the license terms are accepted it starts nothing and waits. |
engine stop |
Stops the local engine, and anything a killed one left running. The next tool call that needs it starts it again. |
engine status |
The license terms, where the engine listens, how it was started, whether it answers, its version, the console’s address and its logs. After a minor upgrade it also shows the previous line’s engine while that drains. |
engine console [--print] [url] |
Signs this browser in to the console, once, so only you can open it. url is a console link to land on. --print prints the sign-in link instead of opening it. turf console runs this. |
With the npx install:
npx -y @turfbuild/turf-mcp-server engine statusnpx -y @turfbuild/turf-mcp-server engine stoplicense subcommands
Section titled “license subcommands”turf-mcp-server license accepts the license terms without the turf CLI:
| Command | What it does |
|---|---|
license accept |
Accepts the terms at https://turf.build/license/v1/ and records it in $TURF_HOME/license.json, as turf license accept does. Running it is the acceptance. A running server answers at its next call, with no restart. |
license status |
Whether the terms are accepted, and how. |
With the npx install:
npx -y @turfbuild/turf-mcp-server license acceptLicense acceptance
Section titled “License acceptance”Every Turf binary checks that the license terms at https://turf.build/license/v1/ are accepted
before it does its work. The server takes acceptance from three places, in this order:
- the
--accept-eulaflag; TURF_ACCEPT_EULAset toyes, in any letter case. No other value accepts:true,1andydo not, and the server names a wrong value on stderr;- the record
turf license acceptorturf-mcp-server license acceptwrites,$TURF_HOME/license.json.
Giving the flag or setting the variable accepts the terms. An engine the server starts is accepted as
the server is. turf-engine and turf-ui read the flag and the environment only, never the record.
Without acceptance:
| Process | What it does |
|---|---|
turf-mcp-server, serving MCP over stdio or HTTP |
Starts, completes the handshake, and lists its tools, prompts and resources. Every tool call, prompt and resource read returns the license notice as an error, and its instructions lead with a “License not accepted” section. It starts no engine. It checks again on each call, so turf license accept or turf-mcp-server license accept needs no restart. |
turf-mcp-server engine run |
Outside a container it stays up and starts nothing. engine status says awaiting license. It checks for the record every 2 seconds and continues when it finds one. In a container it prints the notice and exits with status 77. |
turf-mcp-server engine console |
Prints the notice and exits with status 77. |
turf-engine, turf-ui |
Print the notice and exit with status 77. |
--version, --help, engine status and license always run. --version prints the version, then:
License: Turf Community Edition License 1.0 — proprietary; free within the Community limitshttps://turf.build/license/v1/How to accept in each place Turf runs: Accept the license.
Working directory: –workdir
Section titled “Working directory: –workdir”The engine reads each configuration itself. The local engine, and any engine that mounts the configuration at the same path as the server, needs nothing set: it reads the path the server names.
When an engine of your own mounts the configuration elsewhere, such as in a pod, set the server’s
--workdir (TURF_WORKDIR) and turf-engine --workdir. Set both or neither, each to the directory
holding the same layout. The engine is told each configuration’s path below the server’s directory and
reads it below its own.
- Mount the configuration, and everything it reaches by a relative path, the same way under both.
- Every configuration must then be under
--workdir:initrefuses one outside it, and a relativeinitpath resolves against it. - The server refuses
--workdiragainst the local engine: it needs--restate-url.
The deadline
Section titled “The deadline”--deadline (TURF_DEADLINE, default 55s) caps how long a convergence call (up, destroy,
refresh, import, invoke, plan, apply, cancel) runs. At the deadline the call returns the stage
the convergence is at, planning or applying, with ended: false and next naming the call that
follows. The convergence goes on in the engine. See Result shape.
The default sits under the MCP TypeScript SDK’s 60-second request timeout. A client with no cap of its
own can set it longer. 0 disables it. A TURF_DEADLINE that does not read as a duration (55s, 5m
or 0) stops the server before it serves.
The watch deadline
Section titled “The watch deadline”--watch-deadline (TURF_WATCH_DEADLINE) is how long one watch call waits for drift before it
returns waiting, with a cursor and next naming the same watch. Left unset, watch takes
--deadline.
Each waiting return costs the agent a turn: about 65 an hour at 55 seconds, 2 an hour at 30m. For
a client that allows long tool calls, set it under the client’s own limit; in Claude Code that is
MCP_TOOL_TIMEOUT, in milliseconds. While a call waits, the server sends a progress notification
every 15 seconds if the call carried a progress token. See
What an idle watch costs.
Logging
Section titled “Logging”| Flag | Default |
|---|---|
--log-file |
stderr, or $TF_LOG_PATH |
--log-level |
trace, debug, info, warn, error or off: $TF_LOG_CORE or $TF_LOG, else info |
--log-format |
text or json: text, or JSON when $TF_LOG ends in -JSON |
Provider plugin cache
Section titled “Provider plugin cache”--plugin-cache-dir (TF_PLUGIN_CACHE_DIR) is the shared provider plugin cache, kept across runs and
reusable by tofu. It is the same directory the engine’s --plugin-cache-dir names. init installs a
configuration’s providers into it, and provider_describe installs and runs one from it. The default
is <user cache>/turf/plugins, under your user cache directory; off disables it.
--tmp-dir is the server’s own scratch directory, for scratch configurations and the local
provider-plugin target. By default it is a new system temp directory, removed on exit.
The console
Section titled “The console”The Turf console is a read-only web view of every workspace’s runs, rounds and approvals.
Every up, plan, apply, status and open result carries a console_url link
into it when the server knows a console. The server finds the local engine’s console by itself.
| Variable | Read by | Meaning |
|---|---|---|
TURF_CONSOLE_URL (--console-url) |
the server | Where a browser opens the console for the engine --restate-url names, such as http://localhost:8873 through a port-forward. Empty: no links, except for the local engine. |
TURF_CONSOLE_ADDR |
engine run |
Where the local console listens: http://127.0.0.1:8873 by default, another loopback address, or off. An engine the server starts takes it from the server’s environment; for the Homebrew service, set it in turf.env. |
TURF_CONSOLE_AUTH_TOKEN |
the console | The console’s token. Locally it is kept in console.token in the engine’s directory, and this overrides it. Off loopback, as in a cluster, the console requires it: a browser signs in once at /login?token=… and keeps a cookie, and a program sends it as a bearer header. |
See The engine and the console.
Flags and environment variables
Section titled “Flags and environment variables”| Flag | Environment | Default | Meaning |
|---|---|---|---|
--transport |
stdio |
stdio or http. |
|
--addr |
127.0.0.1:3000 |
HTTP listen address, with --transport http. |
|
TURF_MCP_AUTH_TOKEN |
unset | Bearer token every HTTP request must send. Environment only. | |
--tier |
TURF_TIER |
full |
read, plan, apply or full: which tools the server lists and what their arguments may do. |
--restate-url |
TURF_RESTATE_URL |
empty: the local engine | The engine’s restate-server ingress: an http(s) URL or unix:<socket path>. |
TURF_HOME |
~/.turf |
The local engine lives in $TURF_HOME/engine. |
|
TURF_ENGINE_AUTOSTART |
unset | off keeps the server from starting the local engine. |
|
--accept-eula |
TURF_ACCEPT_EULA |
unset | Accepts the license terms at https://turf.build/license/v1/: the flag, or the variable set to yes. See License acceptance. |
--provider-env |
TURF_PROVIDER_ENV |
unset: nothing is sent | The provider environment: the variables the server sends to the engine by name, for providers. An entry is NAME (the server’s own value), NAME=VALUE or PREFIX_*. Both are read: the variable’s entries, comma-separated, then the flag’s, which repeats, and a later entry for a name wins. At most 64 variables and 16 KiB. A secret goes in the server’s environment by name: NAME=VALUE on the flag shows in the process list. See Send a variable to providers. |
--scopes |
TURF_ENGINE_SCOPES |
on |
Flow-control scopes, on or off; must match the engine’s. |
--workdir |
TURF_WORKDIR |
empty: no mapping | Maps this server’s working directory to an engine’s own --workdir. Needs --restate-url. |
--deadline |
TURF_DEADLINE |
55s |
How long a convergence call runs before it returns the stage; 0 disables. |
--watch-deadline |
TURF_WATCH_DEADLINE |
unset: --deadline |
How long a watch call waits for drift before it returns waiting. |
--console-url |
TURF_CONSOLE_URL |
empty | Where a browser opens the console for an engine of your own. |
TURF_OFFLINE |
unset | The air-gap switch: provider_search makes no call to the public registry, and engine run starts the engine with telemetry off. See Air-gapped installation. |
|
TURF_REGISTRY_API_URL |
https://api.opentofu.org |
The registry search service provider_search asks. Naming one keeps the search on under TURF_OFFLINE. |
|
--plugin-cache-dir |
TF_PLUGIN_CACHE_DIR |
<user cache>/turf/plugins |
Shared provider plugin cache; off disables. |
--tmp-dir |
a system temp directory | Per-process scratch directory, removed on exit when defaulted. | |
--log-file |
TF_LOG_PATH |
stderr | Where logs go. |
--log-level |
TF_LOG_CORE, TF_LOG |
info |
trace, debug, info, warn, error or off. |
--log-format |
TF_LOG |
text |
text or json; JSON when TF_LOG ends in -JSON. |
--lease-ttl |
60s |
How long the server’s hold on a convergence it follows lasts. A server that dies holding one is taken over after this. | |
--drain-interval |
2s |
Minimum gap between statefile writes while a convergence applies. | |
--cpu-profile |
Write a CPU profile to this file, flushed on shutdown. | ||
--mem-profile |
Write a heap profile to this file on shutdown. | ||
--goroutine-profile |
Write a goroutine dump to this file on shutdown. | ||
--trace |
Write an execution trace to this file, flushed on shutdown; read it with go tool trace. |
||
--pprof-addr |
empty: off | Serve Go’s pprof endpoints on this address, such as localhost:6060. |
|
--version |
Print the version and the license lines, and exit. | ||
TURF_CONSOLE_ADDR |
127.0.0.1:8873 |
Where the local console listens, or off. Read by engine run. |
|
TURF_CONSOLE_AUTH_TOKEN |
console.token |
The console’s token. |
Turf™ is a trademark of Turf LLC. Terraform® is a trademark of HashiCorp. Ansible® is a trademark of Red Hat, LLC, registered in the United States and other countries. Helm®, Kubernetes®, Prometheus® and OpenTelemetry® are registered trademarks, and Jaeger™ is a trademark, of the Linux Foundation. OpenTofu® and Model Context Protocol® are registered trademarks of LF Projects, LLC. All other trademarks are the property of their respective owners. Turf is not affiliated with, endorsed by, or sponsored by HashiCorp, IBM, Red Hat, the Linux Foundation, LF Projects or the OpenTofu project.
© 2026 Turf LLC. Free for individuals, education and small businesses within the Community limits, under the Turf Community Edition License 1.0. Government and larger organizations need a commerciallicense.turf.build · Discord ·GitHub