Skip to content
Documentation
Contents

Building tools

Setting up your workspace

One command clones the tool repository and registers your instance with the agent.

The workspace is a directory on your machine: a clone of the repository that holds the tools of your instance, and next to it the sign-in for your agent. You need git, curl and an access token.

Setting up with one command

After issuing a token, the Access tokens page shows the box Visible once. Under Set up a working copy it holds a ready-made command that already contains your token:

 FLOW_TOKEN=flowpac_pat_... sh -c 'curl -fsSL https://<instance>/setup.sh | sh'

Copy it and run it in the directory where the workspace should be created. The token is passed in the environment of the command, never in an address. Whatever is in an address ends up in the logs of every server along the way.

The script contains no secret. You can read it before running it:

curl -fsSL https://<instance>/setup.sh -o setup.sh && less setup.sh && sh setup.sh

Without FLOW_TOKEN the script asks for the token in the terminal.

What it creates

The script creates the directory flow-tools. Pass another name as an argument if you want one (sh setup.sh <directory>).

FileWhat it is for
tools/example/a tool that runs, as a template
new-tool.pyturns a collection into a tool
dev-proxy.pyshows a tool in the browser on your machine
.envthe address of the instance and your token, for your own shell. The two scripts do not need the file, they read both from the address of the clone.
.mcp.jsonregisters the instance with your agent as the MCP server flow-backend

The clone is on the branch draft. A git push therefore goes to the draft.

Restarting the agent

Restart Claude Code in the new directory. A running session does not re-read .mcp.json. After that the agent reaches the instance. How to work with it is described under Working with the agent.

Setting up by hand

If you set up your directory yourself, you only clone. The same box shows the command with your token under Or just clone:

git clone https://flow:<token>@<instance>/git/tools
cd tools
git switch draft || git switch -c draft

The username can be anything, the password is the token. If the branch draft does not exist yet, the second command creates it.

For the agent you create .mcp.json yourself. The box shows the entry in two versions: Entry for .mcp.json reads the token from the environment variable FLOW_TOKEN, … or with the token in it contains it directly.

{
  "mcpServers": {
    "flow-backend": {
      "type": "http",
      "url": "https://<instance>/mcp",
      "headers": { "Authorization": "Bearer ${FLOW_TOKEN}" }
    }
  }
}

With the environment variable the token is in no project file. Even so, never put .mcp.json into a repository while the token is in it.

When the token expires

Issue a new token and replace it in .env, in .mcp.json and in the address of the clone (git remote set-url origin ...). Revoke the old token in the list Your tokens.