airbyte-agent-connectors

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Airbyte Agent Connectors

Airbyte Agent Connectors

Airbyte Agent Connectors let AI agents call third-party APIs through strongly typed, well-documented tools. Each connector is a standalone Python package.
Terminology: Platform Mode = Airbyte Cloud at app.airbyte.ai (managed credentials, UI visibility). OSS Mode = local Python SDK (self-managed credentials, no cloud dependency). Definition ID = UUID that identifies a connector type in the Airbyte API (used in
definition_id
fields, not
connector_type
or
connector_definition_id
).
Important: This skill provides documentation and setup guidance. When helping users set up connectors, follow the documented workflows below. Do NOT attempt to import Python modules, verify package installations, or run code to check configurations -- simply guide users through the steps using the code examples provided.
Airbyte Agent Connectors允许AI Agent通过强类型、文档完善的工具调用第三方API。每个连接器都是独立的Python包。
术语说明: 平台模式 = Airbyte Cloud(地址为app.airbyte.ai,托管凭证,支持UI可视化)。开源模式(OSS Mode) = 本地Python SDK(自行管理凭证,无云依赖)。Definition ID = 在Airbyte API中标识连接器类型的UUID(用于
definition_id
字段,而非
connector_type
connector_definition_id
)。
重要提示: 本技能提供文档和设置指导。在帮助用户设置连接器时,请遵循以下记录的工作流程。请勿尝试导入Python模块、验证包安装或运行代码检查配置——只需使用提供的代码示例引导用户完成步骤。

Mode Detection

模式检测

First, determine which mode the user needs:
首先,确定用户需要使用哪种模式:

Platform Mode (Airbyte Cloud)

平台模式(Airbyte Cloud)

Use when:
  • Environment has
    AIRBYTE_CLIENT_ID
    +
    AIRBYTE_CLIENT_SECRET
  • User wants connectors visible in the Airbyte UI at app.airbyte.ai
  • User needs managed credential storage, context store, or multi-tenant deployments
适用场景:
  • 环境中配置了
    AIRBYTE_CLIENT_ID
    AIRBYTE_CLIENT_SECRET
  • 用户希望连接器在Airbyte UI(app.airbyte.ai)中可见
  • 用户需要托管凭证存储、上下文存储或多租户部署

OSS Mode (Open Source / Local SDK)

开源模式(OSS Mode / 本地SDK)

Use when:
  • User wants to run connectors directly without platform integration
  • User is doing quick development or prototyping
  • User wants Claude Code/Desktop integration via MCP only
Ask if unclear: "Are you using Airbyte Platform (app.airbyte.ai) or open source connectors?"

适用场景:
  • 用户希望直接运行连接器,无需平台集成
  • 用户正在进行快速开发或原型设计
  • 用户仅需通过MCP与Claude Code/Desktop集成
若不确定请询问: “您使用的是Airbyte平台(app.airbyte.ai)还是开源连接器?”

Supported Connectors

支持的连接器

51 connectors available. All connectors follow the same entity-action pattern:
connector.execute(entity, action, params)
ConnectorPackageAuth TypeKey Entities
Stripe
airbyte-agent-stripe
TokenCustomers, Invoices, Charges, Subscri...
HubSpot
airbyte-agent-hubspot
OAuth, TokenContacts, Companies, Deals, Tickets, ...
GitHub
airbyte-agent-github
OAuth, TokenRepositories, Org Repositories, Branc...
Salesforce
airbyte-agent-salesforce
OAuthSobjects, Accounts, Contacts, Leads, ...
Gong
airbyte-agent-gong
OAuth, TokenUsers, Calls, Calls Extensive, Call A...
Full table: See references/connector-index.md for all 51 connectors with auth types, key entities, and documentation status.
If the connector is NOT in the index: Inform the user that this connector isn't available yet. Point them to GitHub issues.

目前支持51个连接器。所有连接器均遵循相同的实体-操作模式:
connector.execute(entity, action, params)
连接器包名认证类型核心实体
Stripe
airbyte-agent-stripe
Token客户、发票、收费、订阅...
HubSpot
airbyte-agent-hubspot
OAuth、Token联系人、公司、交易、工单...
GitHub
airbyte-agent-github
OAuth、Token仓库、组织仓库、分支...
Salesforce
airbyte-agent-salesforce
OAuthSobjects、账户、联系人、线索...
Gong
airbyte-agent-gong
OAuth、Token用户、通话、详细通话记录、通话分析...
完整列表: 请参阅references/connector-index.md获取所有51个连接器的认证类型、核心实体和文档状态。
若连接器不在索引中: 告知用户该连接器目前不可用,并引导他们查看GitHub Issues

Platform Mode Quick Start

平台模式快速入门

For users with Airbyte Platform credentials.
适用于拥有Airbyte平台凭证的用户。

Prerequisites

前提条件

Get credentials from app.airbyte.ai > Settings > API Keys:
  • AIRBYTE_CLIENT_ID
  • AIRBYTE_CLIENT_SECRET
app.airbyte.ai > 设置 > API密钥获取凭证:
  • AIRBYTE_CLIENT_ID
  • AIRBYTE_CLIENT_SECRET

Create a Connector

创建连接器

python
from airbyte_agent_stripe import StripeConnector
from airbyte_agent_stripe.models import StripeAuthConfig

connector = await StripeConnector.create_hosted(
    external_user_id="user_123",
    airbyte_client_id="...",
    airbyte_client_secret="...",
    auth_config=StripeAuthConfig(api_key="sk_live_...")
)
python
from airbyte_agent_stripe import StripeConnector
from airbyte_agent_stripe.models import StripeAuthConfig

connector = await StripeConnector.create_hosted(
    external_user_id="user_123",
    airbyte_client_id="...",
    airbyte_client_secret="...",
    auth_config=StripeAuthConfig(api_key="sk_live_...")
)

Use Existing Connector

使用现有连接器

python
connector = StripeConnector(
    external_user_id="user_123",
    airbyte_client_id="...",
    airbyte_client_secret="...",
)
result = await connector.execute("customers", "list", {"limit": 10})

python
connector = StripeConnector(
    external_user_id="user_123",
    airbyte_client_id="...",
    airbyte_client_secret="...",
)
result = await connector.execute("customers", "list", {"limit": 10})

OSS Mode Quick Start

开源模式快速入门

Install

安装

bash
undefined
bash
undefined

Using uv (recommended)

使用uv(推荐)

uv add airbyte-agent-github
uv add airbyte-agent-github

Or using pip in a virtual environment

或在虚拟环境中使用pip

python3 -m venv .venv && source .venv/bin/activate pip install airbyte-agent-github
undefined
python3 -m venv .venv && source .venv/bin/activate pip install airbyte-agent-github
undefined

Use Directly

直接使用

python
from airbyte_agent_github import GithubConnector
from airbyte_agent_github.models import GithubPersonalAccessTokenAuthConfig

connector = GithubConnector(
    auth_config=GithubPersonalAccessTokenAuthConfig(token="ghp_your_token")
)

result = await connector.execute("issues", "list", {
    "owner": "airbytehq",
    "repo": "airbyte",
    "states": ["OPEN"],
    "per_page": 10
})
python
from airbyte_agent_github import GithubConnector
from airbyte_agent_github.models import GithubPersonalAccessTokenAuthConfig

connector = GithubConnector(
    auth_config=GithubPersonalAccessTokenAuthConfig(token="ghp_your_token")
)

result = await connector.execute("issues", "list", {
    "owner": "airbytehq",
    "repo": "airbyte",
    "states": ["OPEN"],
    "per_page": 10
})

Add to Claude via MCP

通过MCP添加到Claude

bash
claude mcp add airbyte-agent-mcp --scope project

bash
claude mcp add airbyte-agent-mcp --scope project

Entity-Action API Pattern

实体-操作API模式

All connectors use the same interface:
python
result = await connector.execute(entity, action, params)
所有连接器均使用相同的接口:
python
result = await connector.execute(entity, action, params)

For list actions: returns an envelope with result.data (list) and result.meta (pagination dict)

对于列表操作:返回包含result.data(列表)和result.meta(分页字典)的封装对象

For get/create/update actions: returns a raw dict (use dict access like result['name'])

对于获取/创建/更新操作:返回原始字典(可通过result['name']这样的方式访问)

Raises exceptions on failure (RuntimeError, TypeError, ValueError, etc.)

执行失败时会抛出异常(RuntimeError、TypeError、ValueError等)


> **Important: Error handling in agent tools.** When registering `execute()` as a tool for an AI agent (PydanticAI, LangChain, etc.), **always wrap the call in try/except** and return the error message as a string. This prevents unhandled exceptions from crashing the agent and lets the LLM recover gracefully:
>
> ```python
> @agent.tool_plain
> async def execute(entity: str, action: str, params: dict | None = None) -> str:
>     try:
>         return await connector.execute(entity, action, params or {})
>     except Exception as e:
>         return f"Error: {type(e).__name__}: {e}"
> ```

> **`tool_utils` and `enable_hosted_mode_features`:** The `@Connector.tool_utils` decorator auto-generates the tool's docstring from the connector schema, including available entities, actions, parameters, and usage guidelines. In **Platform Mode** (default), the docstring includes `search` actions that query the [context store](https://docs.airbyte.com/ai-agents/platform/context-store) and guidance to prefer cached search over direct API calls. In **OSS Mode**, pass `enable_hosted_mode_features=False` to exclude these — the context store is not available locally, so advertising search actions would cause errors:
>
> ```python
> # OSS Mode — excludes context store search actions from the tool docstring
> @Connector.tool_utils(enable_hosted_mode_features=False)
>
> # Platform Mode (default) — includes search actions and context store guidance
> @Connector.tool_utils
> ```

> **重要提示:Agent工具中的错误处理**。当将`execute()`注册为AI Agent(PydanticAI、LangChain等)的工具时,**务必将调用包裹在try/except块中**,并将错误消息作为字符串返回。这可以防止未处理的异常导致Agent崩溃,并让LLM能够优雅地恢复:
>
> ```python
> @agent.tool_plain
> async def execute(entity: str, action: str, params: dict | None = None) -> str:
>     try:
>         return await connector.execute(entity, action, params or {})
>     except Exception as e:
>         return f"Error: {type(e).__name__}: {e}"
> ```

> **`tool_utils`与`enable_hosted_mode_features`:** `@Connector.tool_utils`装饰器会从连接器架构自动生成工具的文档字符串,包括可用的实体、操作、参数和使用指南。在**平台模式**(默认)下,文档字符串包含查询[上下文存储](https://docs.airbyte.com/ai-agents/platform/context-store)的`search`操作,以及优先使用缓存搜索而非直接API调用的指导。在**开源模式**下,传递`enable_hosted_mode_features=False`以排除这些内容——因为本地环境不支持上下文存储,所以宣传搜索操作会导致错误:
>
> ```python
> # 开源模式——从工具文档字符串中排除上下文存储搜索操作
> @Connector.tool_utils(enable_hosted_mode_features=False)
>
> # 平台模式(默认)——包含搜索操作和上下文存储指导
> @Connector.tool_utils
> ```

Actions

操作类型

ActionDescription
result.data
Type
list
Get multiple records
list[dict]
get
Get single record by ID
dict
create
Create new record
dict
update
Modify existing record
dict
delete
Remove record
dict
api_search
Native API search syntax
list[dict]
操作描述
result.data
类型
list
获取多条记录
list[dict]
get
通过ID获取单条记录
dict
create
创建新记录
dict
update
修改现有记录
dict
delete
删除记录
dict
api_search
原生API搜索语法
list[dict]

Quick Examples

快速示例

python
undefined
python
undefined

List

列表查询

await connector.execute("customers", "list", {"limit": 10})
await connector.execute("customers", "list", {"limit": 10})

Get

单条获取

await connector.execute("customers", "get", {"id": "cus_xxx"})
await connector.execute("customers", "get", {"id": "cus_xxx"})

Search

搜索

await connector.execute("repositories", "api_search", { "query": "language:python stars:>1000" })
undefined
await connector.execute("repositories", "api_search", { "query": "language:python stars:>1000" })
undefined

Pagination

分页处理

python
async def fetch_all(connector, entity, params=None):
    all_records = []
    cursor = None
    params = params or {}

    while True:
        if cursor:
            params["after"] = cursor
        result = await connector.execute(entity, "list", params)
        all_records.extend(result.data)

        if result.meta and hasattr(result.meta, 'pagination'):
            cursor = getattr(result.meta.pagination, 'cursor', None)
            if not cursor:
                break
        else:
            break

    return all_records

python
async def fetch_all(connector, entity, params=None):
    all_records = []
    cursor = None
    params = params or {}

    while True:
        if cursor:
            params["after"] = cursor
        result = await connector.execute(entity, "list", params)
        all_records.extend(result.data)

        if result.meta and hasattr(result.meta, 'pagination'):
            cursor = getattr(result.meta.pagination, 'cursor', None)
            if not cursor:
                break
        else:
            break

    return all_records

Authentication Quick Reference

认证快速参考

API Key Connectors

API密钥连接器

python
undefined
python
undefined

Stripe

Stripe

from airbyte_agent_stripe.models import StripeAuthConfig auth_config=StripeAuthConfig(api_key="sk_live_...")
from airbyte_agent_stripe.models import StripeAuthConfig auth_config=StripeAuthConfig(api_key="sk_live_...")

Gong

Gong

from airbyte_agent_gong.models import GongAccessKeyAuthenticationAuthConfig auth_config=GongAccessKeyAuthenticationAuthConfig( access_key="...", access_key_secret="..." )
from airbyte_agent_gong.models import GongAccessKeyAuthenticationAuthConfig auth_config=GongAccessKeyAuthenticationAuthConfig( access_key="...", access_key_secret="..." )

HubSpot (Private App)

HubSpot(私有应用)

from airbyte_agent_hubspot.models import HubspotPrivateAppAuthConfig auth_config=HubspotPrivateAppAuthConfig(private_app_token="pat-na1-...")
from airbyte_agent_hubspot.models import HubspotPrivateAppAuthConfig auth_config=HubspotPrivateAppAuthConfig(private_app_token="pat-na1-...")

HubSpot (OAuth)

HubSpot(OAuth)

from airbyte_agent_hubspot.models import HubspotOauth2AuthConfig auth_config=HubspotOauth2AuthConfig( client_id="...", client_secret="...", refresh_token="..." )
undefined
from airbyte_agent_hubspot.models import HubspotOauth2AuthConfig auth_config=HubspotOauth2AuthConfig( client_id="...", client_secret="...", refresh_token="..." )
undefined

Personal Access Token

个人访问令牌

python
undefined
python
undefined

GitHub

GitHub

from airbyte_agent_github.models import GithubPersonalAccessTokenAuthConfig auth_config=GithubPersonalAccessTokenAuthConfig(token="ghp_...")
from airbyte_agent_github.models import GithubPersonalAccessTokenAuthConfig auth_config=GithubPersonalAccessTokenAuthConfig(token="ghp_...")

Slack

Slack

from airbyte_agent_slack.models import SlackAuthConfig auth_config=SlackAuthConfig(token="xoxb-...")
undefined
from airbyte_agent_slack.models import SlackAuthConfig auth_config=SlackAuthConfig(token="xoxb-...")
undefined

OAuth (requires refresh token)

OAuth(需要刷新令牌)

python
undefined
python
undefined

Salesforce

Salesforce

from airbyte_agent_salesforce.models import SalesforceAuthConfig auth_config=SalesforceAuthConfig( client_id="...", client_secret="...", refresh_token="..." )

> **Per-connector auth details:** Each connector reference in [references/connectors/](references/connectors/) includes the specific auth class name and fields.

---
from airbyte_agent_salesforce.models import SalesforceAuthConfig auth_config=SalesforceAuthConfig( client_id="...", client_secret="...", refresh_token="..." )

> **各连接器认证详情:** 每个连接器的参考文档(位于[references/connectors/](references/connectors/))包含具体的认证类名称和字段。

---

Security Best Practices

安全最佳实践

  • Never hard-code credentials in source files. Use environment variables or
    .env
    files.
  • Use
    .env
    pattern:
    from dotenv import load_dotenv; load_dotenv()
  • Rotate tokens regularly. Use short-lived tokens where possible.
  • For production, use Platform Mode for managed credential storage.

  • 切勿在源文件中硬编码凭证。请使用环境变量或
    .env
    文件。
  • 使用
    .env
    模式:
    from dotenv import load_dotenv; load_dotenv()
  • 定期轮换令牌。尽可能使用短期令牌。
  • 生产环境中,请使用平台模式进行托管凭证存储。

Per-Connector Reference Documentation

连接器参考文档

  • Connector Index -- full table of all connectors
  • Per-connector references: references/connectors/
Each per-connector reference includes: package name and version, authentication details, available entities and actions, quick-start code snippets, and links to full GitHub documentation.
  • 连接器索引 —— 所有连接器的完整列表
  • 各连接器参考:references/connectors/
每个连接器的参考文档包含:包名和版本、认证详情、可用实体和操作、快速入门代码片段,以及指向完整GitHub文档的链接。

Reference Documentation

参考文档生成方式

TopicReference
Getting Startedreferences/getting-started.md
Platform Setupreferences/platform-setup.md
OSS Setupreferences/oss-setup.md
Entity-Action APIreferences/entity-action-api.md
Authenticationreferences/authentication.md
Programmatic Setupreferences/programmatic-setup.md
MCP Integrationreferences/mcp-integration.md
Troubleshootingreferences/troubleshooting.md
参考文档由
scripts/generate_skill_references.py
自动生成。运行
python scripts/generate_skill_references.py --all
可重新生成所有参考文档,或使用
--connector <name>
生成特定连接器的文档。

External Documentation

技能元数据

How References Are Generated

支持

Reference docs are auto-generated by
scripts/generate_skill_references.py
. Run
python scripts/generate_skill_references.py --all
to regenerate all references, or
--connector <name>
for a specific connector.

Skill Metadata

Support