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 --printWhen 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:
| Category | Maps to | Examples |
|---|---|---|
sandbox | SandboxFactory | Daytona, E2B, Modal, Vercel Sandbox |
mcp | connectMcpServer | GitHub, Linear, Mintlify, Slack |
kb | FilesystemSource | Fumadocs (also localDirectorySource, r2FilesystemSource, s3FilesystemSource, azureBlobFilesystemSource, httpFilesystemSource in the SDK) |
data | Command / ToolDef | Postgres, Notion REST |
Auto-detected coding agents
fh add detects the agent you're running under and shows the matching pipe hint:
| Detected | Pipe 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 | codexThe receiving agent gets:
- The docs URL.
- The category (so it knows whether to produce a
SandboxFactory,connectMcpServercall,FilesystemSource, orCommand/ToolDef). - 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:
- The user's current project (walking up to find
./connectors/<file>.md) - The CLI's own bundled copy (when developing this repo locally)
- Remote fallback —
https://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
- Create
connectors/<category>--<name>.md. Use the existing recipes as templates — short, agent-friendly, no secrets. - Add an entry to
CONNECTOR_RECIPESinpackages/cli/bin/fabric-harness.ts. - Open a PR. Once merged,
fh add <name>works for everyone immediately (the remote fallback fetchesmain).
See also
- Filesystem sources — the
kbcategory primitives - MCP — the
mcpcategory primitives - Capability matrix — what each connector type lets the agent do
Context Compaction
Automatic, event-emitting context compaction for long sessions. Default import enables it; /strict opts in explicitly. Threshold and overflow modes.
HTTP Server
REST + SSE conventions for invoking, reading, and streaming agent sessions over HTTP. Identical surface across the Node and Cloudflare server targets.