Skip to content

Connect your agent

Your agent needs one entry in its configuration: how to start the Turf™ MCP server. One command writes it for every agent on this machine. The line depends on how you installed Turf.

Terminal window
npx -y @turfbuild/turf-mcp-server license accept # downloads Turf, about a minute, and accepts the terms
npx add-mcp@2 @turfbuild/turf-mcp-server --name turf -g

These are the install lines themselves. If you ran them on Install locally, your agent is already connected. Read the terms at turf.build/license/v1 before the first line, which downloads Turf in your terminal and records your acceptance once, in ~/.turf/license.json. The second registers the server with your agents. It needs Node 18 or later, on macOS or Linux, arm64 or x64.

The command runs add-mcp, Neon’s open-source installer. It finds the agents you have installed, asks which ones to add Turf to, and writes each one’s config. Running it again replaces the entry. Restart Claude Desktop or Cursor after the config changes.

In Claude Code and Claude Desktop, Turf runs on your Claude subscription. No model API key is needed.

Each client can also add the server itself. With the npx install, run the first install line in a terminal before it, so the download happens there.

Terminal window
claude mcp add turf --scope user -- npx -y @turfbuild/turf-mcp-server

With a Homebrew or script install, turf-mcp-server takes the place of npx -y @turfbuild/turf-mcp-server in each command, and no Node is needed: claude mcp add turf --scope user -- turf-mcp-server. In a config file, the command is the path command -v turf-mcp-server prints, with no args.

The server starts the engine when a tool first needs it, so there is nothing to start by hand. With the npx install, the first install line has already downloaded Turf, so that start is quick. If your agent’s first start fails, turn Turf off in your agent, run the first line in a terminal and let it finish, then reconnect. Later starts take several seconds.

Providers run in that engine, not in your agent’s session: they get the engine’s environment and the variables you name for them (Give providers a variable). Before a run that needs cloud credentials, read Where credentials are read.

Once connected, the agent sees Turf’s tools (init, open, up, plan, apply, …), four prompts and five resources. In Claude Code the prompts are slash commands: /turf:guide, /turf:up <dir>, /turf:destroy <dir>, /turf:watch <dir>. In any other client you ask in words: “deploy the configuration in ./infra with Turf”. The server also hands the agent a page of instructions and three skills at connection, so it knows the loop and the safety rules before its first call. The details are in the MCP reference.

The server starts whether or not the license terms are accepted: it completes the handshake and lists its tools, prompts and resources. Until they are accepted, every tool call, prompt and resource read returns an error instead of running, and the agent sees this:

Turf is proprietary software. To accept the Turf license terms (version 1.0,
https://turf.build/license/v1/), run `turf license accept` or set TURF_ACCEPT_EULA=yes.
Free for individuals, education and small businesses within the Community limits.
Government and larger organizations need a commercial license.
Turf's license terms have not been accepted, so this did not run. Ask your user to read
https://turf.build/license/v1/ and confirm they accept. Only then run `turf license accept`,
or set TURF_ACCEPT_EULA=yes in this server's environment, and retry. No restart is needed
after `turf license accept`. Without the `turf` CLI, `turf-mcp-server license accept` does
the same (through npx: `npx -y @turfbuild/turf-mcp-server license accept`).

Read the terms, then accept them in a terminal, or tell your agent that you accept and let it run the command:

Terminal window
npx -y @turfbuild/turf-mcp-server license accept

Both write the same record, ~/.turf/license.json. The server reads it on the next call, so there is nothing to restart; it starts no engine before that. A Homebrew engine service that was waiting starts within seconds.

A server your client starts with npx, from Homebrew or from the script reads that record, so its entry needs nothing more. Where no one will run the command, TURF_ACCEPT_EULA in the entry’s env accepts instead, for that server and an engine it starts. Setting it to yes accepts the terms at https://turf.build/license/v1/:

{
"mcpServers": {
"turf": {
"command": "npx",
"args": ["-y", "@turfbuild/turf-mcp-server"],
"env": { "TURF_ACCEPT_EULA": "yes" }
}
}
}

Restart the client’s MCP connection after editing its configuration. The variable does not reach the Homebrew engine service, which reads the record, or ~/.homebrew/services/turf.env.

A server in a container cannot read the record: it reads only the container’s environment. An entry’s env reaches the process your client starts, which for a container is docker, not the container, unless the entry’s args pass the variable in with -e. Each case is in Accept the license.

Credentials in their usual files (the default AWS profile, ~/.kube/config) work with nothing set. When a provider needs a variable, put it in the env of Turf’s entry and name it in TURF_PROVIDER_ENV:

"env": {
"AWS_PROFILE": "prod",
"TURF_PROVIDER_ENV": "AWS_PROFILE"
}

Then restart the agent: the list is read when the server starts. The server sends the variables you named to the engine with each run, and status shows their names, never a value. PATH and the engine’s own variables are never sent.

add-mcp writes the same two lines:

Terminal window
npx add-mcp@2 @turfbuild/turf-mcp-server --name turf -g --env AWS_PROFILE=prod --env TURF_PROVIDER_ENV=AWS_PROFILE

More in Send a variable to providers.

The server speaks MCP over stdio by default. turf-mcp-server --transport http (with the npx install, npx -y @turfbuild/turf-mcp-server --transport http) serves HTTP on loopback instead, for a client that connects over the network. Bound to any other address it is unauthenticated unless TURF_MCP_AUTH_TOKEN sets a bearer token, so set one. That is how an agent in a cluster connects: see Connecting clients.

Your first run.

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