Docs/Guides/Setting up tools
Runtime4 min read

Setting up tools

Running Frags Locally describes what tools.json is — mcpServers and collections, and how token.json stores OAuth credentials. This guide is the other half: the concrete, repeatable steps for adding one new connection to your local setup before you ever reference it from a plan.

We'll walk through setting up an OAuth MCP server (Slack) end-to-end, then show the same steps for a collection (Postgres).

Prerequisites

  • The Frags CLI installed and .env configured — see Running Frags Locally.
  • Credentials for whatever you're connecting: an MCP server URL (plus OAuth client id/secret if it requires auth), or a database connection string.

Add an MCP server (worked example: Slack)

Open tools.json in your working directory (create it if it doesn't exist yet) and add an entry under mcpServers:

JSON
{
  "mcpServers": {
    "slack": {
      "url": "https://<tenant>.platform.barndoor.ai/mcp/slack-user",
      "disabled": false,
      "client_id": "<client-id>",
      "client_secret": "<client-secret>"
    }
  }
}

Set disabled: false. Include client_id/client_secret if the server requires OAuth — most hosted MCP servers do; a few (like a local filesystem server) don't need either.

Trigger the authorization flow. The first time a plan calls this server, Frags walks you through OAuth and, once you approve it, stores the resulting tokens in token.json under a hash of the connection:

JSON
{
  "items": {
    "1883918e…": {
      "host": "https://<tenant>.platform.barndoor.ai/mcp/slack-user",
      "client_id": "<oauth-client-id>",
      "access_token": "eyJ0eXAi…redacted",
      "refresh_token": "eyJhbG…redacted",
      "expiry": "2026-06-02T18:17:15-04:00"
    }
  }
}

Add a collection (worked example: Postgres)

Collections are the built-in connector types — fs, http, postgres — declared under collections instead of mcpServers.

JSON
{
  "collections": {
    "postgres": {
      "disabled": false,
      "params": {
        "postgres_url": "postgresql://<user>:<password>@<host>.neon.tech/neondb?sslmode=require&channel_binding=require"
      }
    }
  }
}

There's no OAuth step here — a collection authenticates with whatever you put in params directly (a connection string for postgres; nothing at all for fs or http).

Using the connection in a plan

Everything above only makes a tool reachable. Pulling it into a plan is its own topic. See Connect Frags to your data.

Next steps

← All guides

Add a new connection to tools.json end-to-end — OAuth for an MCP server, a Postgres collection, and where apicp fits in — then verify it before wiring it into a plan.