FabricFabricHarness
Reference

Connector Recipes (`fh add`)

Pipe Markdown connector recipes into Claude / Codex / Cursor / Aider / OpenCode and have them scaffold a Fabric Harness sandbox, MCP, knowledge-base, or data adapter into your project.

fabric-harness add (alias fh add) is a TTY-aware command that prints a Markdown implementation guide for an external provider. Pipe it to your coding agent and it writes a connectors/<name>.ts adapter into your project, wired to the matching @fabric-harness/connectors (or platform package) helper.

Recipes today are thin wiring on top of the package helpers — the package owns the tested implementation, the recipe wires it into your specific project layout, env vars, and lifecycle. For most providers you can also import the helper directly without scaffolding (see Connector catalog).

Common usage

# List all available recipes (and the agent the CLI auto-detected for you)
fh add

# Pipe a known recipe to your coding agent
fh add daytona | claude
fh add github-mcp | codex
fh add mintlify-mcp | cursor-agent
fh add fumadocs | aider

# Build a brand-new connector from a provider's docs URL
fh add https://e2b.dev --category sandbox | claude

# Print the markdown without piping (for inspection)
fh add daytona --print

When stdout is a terminal, fh add <name> prints a hint with the detected coding agent. When stdout is piped or redirected, it prints the Markdown body itself, ready for the receiving agent to consume.

Categories

The Markdown recipes are grouped into four categories that map to Fabric Harness primitives:

CategoryMaps toExamples
sandboxSandboxFactoryDaytona, E2B, Modal, Vercel Sandbox
mcpconnectMcpServerGitHub, Linear, Mintlify, Slack
kbFilesystemSourceFumadocs (also localDirectorySource, r2FilesystemSource, s3FilesystemSource, azureBlobFilesystemSource, httpFilesystemSource in the SDK)
dataCommand / ToolDefPostgres, Notion REST

Auto-detected coding agents

fh add detects the agent you're running under and shows the matching pipe hint:

DetectedPipe hint
Claude Code (CLAUDE_CODE, CLAUDE_PROJECT_DIR)| claude
OpenAI Codex (CODEX_AGENT, CODEX_HOME)| codex
Cursor Agent (CURSOR_AGENT, CURSOR_TRACE_ID)| cursor-agent
Aider (AIDER_RUNNING)| aider
OpenCode (OPENCODE)| opencode
(none detected)| claude (canonical default)

Override by passing --print and piping yourself.

URL-form recipes

When you pass a URL instead of a known recipe name, fh add emits a generic "scaffold a connector from these docs" prompt. The agent then fetches the URL and writes the adapter:

fh add https://docs.modal.com --category sandbox | claude
fh add https://api.intercom.io --category data | codex

The receiving agent gets:

  1. The docs URL.
  2. The category (so it knows whether to produce a SandboxFactory, connectMcpServer call, FilesystemSource, or Command/ToolDef).
  3. A short template showing the file shape and the secret(<env-var>) pattern for credentials.

Where the recipes live

Recipes are Markdown files in connectors/ at the repo root. The CLI looks for them in:

  1. The user's current project (walking up to find ./connectors/<file>.md)
  2. The CLI's own bundled copy (when developing this repo locally)
  3. Remote fallbackhttps://raw.githubusercontent.com/Fabric-Pro/fabric-harness/main/connectors/<file>.md

So fh add works in any project that has @fabric-harness/cli installed, even without cloning fabric-harness.

Authoring a new recipe

  1. Create connectors/<category>--<name>.md. Use the existing recipes as templates — short, agent-friendly, no secrets.
  2. Add an entry to CONNECTOR_RECIPES in packages/cli/bin/fabric-harness.ts.
  3. Open a PR. Once merged, fh add <name> works for everyone immediately (the remote fallback fetches main).

See also