How to Build a Connector with Claude Code
This tutorial explains how to build a custom data connector using Claude Code with the Fivetran Connector SDK plugin. The example data connector built in this tutorial fetches data from the FDA Tobacco Problem Reports API.
This tutorial is based on the FDA Tobacco API Connector example in the Connector SDK repository.
Prerequisites
- Connector SDK installed locally
- A supported Python version
- A Fivetran account with a configured destination
FIVETRAN_API_KEYset as an environment variable. The value must be your base64-encoded Fivetran API key in{key}:{secret}format with manage connections, read destinations permissions.- Claude Code (
claude) installed and available on your PATH
Initialize the project
Use fivetran init to create the project structure and install the Connector SDK plugin for Claude Code:
fivetran init FDA_Tobacco_Claude
cd FDA_Tobacco_Claude
After creating the project files, fivetran init checks your PATH for installed AI coding agents. When prompted, select Claude Code to install the Connector SDK plugin.
If Claude Code isn't detected, make sure the claude binary is installed and available on your PATH. You can also install the plugin manually. For more information, see Connector SDK tools.
Build the connector
Start Claude Code in the project directory and invoke the build-connector skill. Include the following context about your data source in the prompt: the API documentation URL, authentication details, what to extract, and a sample response:
/fivetran-connector-sdk:build-connector
Build a connector for the FDA Tobacco Problem Reports API.
API docs: https://open.fda.gov/apis/tobacco/
The API accepts an optional api_key query parameter for higher rate limits.
Replicate the tobacco problem reports endpoint with incremental sync.
Limit to 10 results per request during testing.
Define only the primary key (report_id) and let Fivetran infer the rest.
Sample response:
{"results": [{"report_id": "1234", "date_submitted": "2020-01-01", "product_name": "Example Tobacco Product"}], "meta": {"total": 500}}
The agent first checks whether Fivetran already has a managed or Lite Connector for your source. If not, it scaffolds the project, generates connector.py, configuration.json, requirements.txt, and README.md, then runs a local test automatically.
Before the local test runs, the agent prompts you to enter your credentials in a separate terminal. Run the command it provides. Don't paste credentials directly into the agent chat.
If the local test fails, describe the error in the same session and the agent fixes and reruns it.
Evaluate the connector
Before deploying, run the evaluate-connector skill to check for SDK compliance, security, and reliability issues:
/fivetran-connector-sdk:evaluate-connector
The skill produces a scored report. required issues must be fixed before deploying and include memory problems, missing checkpoints, SDK violations, and security issues. good-to-have items are recommended improvements such as retry logic, timeout handling, and code quality.
Fix all required issues before proceeding. For more information, see Building Custom Connectors with AI Agents.
Deploy the connector
Once the connector passes evaluation, invoke the deploy-connector skill:
/fivetran-connector-sdk:deploy-connector
The agent validates the connector, runs a final local test, and deploys it to your Fivetran account. The new connection starts paused.
The agent asks for confirmation before starting the initial sync because it consumes monthly active rows (MAR).
Start and verify the initial sync
Open the connection using the URL returned by the agent, or find it on the Connections page in your Fivetran dashboard. Start the initial sync by clicking Start Initial Sync.
After the sync completes, verify that a schema and tables are created in the destination and records have loaded from the FDA Tobacco API.