airbyte-agent-connectors
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAirbyte 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 infields, notdefinition_idorconnector_type).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_IDAIRBYTE_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
See Agent Engine Platform docs and the hosted quickstart tutorial for full details.
适用场景:
- 环境中配置了和
AIRBYTE_CLIENT_IDAIRBYTE_CLIENT_SECRET - 用户希望连接器在Airbyte UI(app.airbyte.ai)中可见
- 用户需要托管凭证存储、上下文存储或多租户部署
详情请参阅Agent Engine平台文档和托管快速入门教程。
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)| Connector | Package | Auth Type | Key Entities |
|---|---|---|---|
| Stripe | | Token | Customers, Invoices, Charges, Subscri... |
| HubSpot | | OAuth, Token | Contacts, Companies, Deals, Tickets, ... |
| GitHub | | OAuth, Token | Repositories, Org Repositories, Branc... |
| Salesforce | | OAuth | Sobjects, Accounts, Contacts, Leads, ... |
| Gong | | OAuth, Token | Users, 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 | | Token | 客户、发票、收费、订阅... |
| HubSpot | | OAuth、Token | 联系人、公司、交易、工单... |
| GitHub | | OAuth、Token | 仓库、组织仓库、分支... |
| Salesforce | | OAuth | Sobjects、账户、联系人、线索... |
| 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_IDAIRBYTE_CLIENT_SECRET
从app.airbyte.ai > 设置 > API密钥获取凭证:
AIRBYTE_CLIENT_IDAIRBYTE_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
undefinedbash
undefinedUsing 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
undefinedpython3 -m venv .venv && source .venv/bin/activate
pip install airbyte-agent-github
undefinedUse 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 projectbash
claude mcp add airbyte-agent-mcp --scope projectEntity-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
操作类型
| Action | Description | |
|---|---|---|
| Get multiple records | |
| Get single record by ID | |
| Create new record | |
| Modify existing record | |
| Remove record | |
| Native API search syntax | |
| 操作 | 描述 | |
|---|---|---|
| 获取多条记录 | |
| 通过ID获取单条记录 | |
| 创建新记录 | |
| 修改现有记录 | |
| 删除记录 | |
| 原生API搜索语法 | |
Quick Examples
快速示例
python
undefinedpython
undefinedList
列表查询
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"
})
undefinedawait connector.execute("repositories", "api_search", {
"query": "language:python stars:>1000"
})
undefinedPagination
分页处理
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_recordspython
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_recordsAuthentication Quick Reference
认证快速参考
API Key Connectors
API密钥连接器
python
undefinedpython
undefinedStripe
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="..."
)
undefinedfrom airbyte_agent_hubspot.models import HubspotOauth2AuthConfig
auth_config=HubspotOauth2AuthConfig(
client_id="...", client_secret="...", refresh_token="..."
)
undefinedPersonal Access Token
个人访问令牌
python
undefinedpython
undefinedGitHub
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-...")
undefinedfrom airbyte_agent_slack.models import SlackAuthConfig
auth_config=SlackAuthConfig(token="xoxb-...")
undefinedOAuth (requires refresh token)
OAuth(需要刷新令牌)
python
undefinedpython
undefinedSalesforce
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 files.
.env - Use pattern:
.envfrom 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 - 使用模式:
.envfrom 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
参考文档生成方式
| Topic | Reference |
|---|---|
| Getting Started | references/getting-started.md |
| Platform Setup | references/platform-setup.md |
| OSS Setup | references/oss-setup.md |
| Entity-Action API | references/entity-action-api.md |
| Authentication | references/authentication.md |
| Programmatic Setup | references/programmatic-setup.md |
| MCP Integration | references/mcp-integration.md |
| Troubleshooting | references/troubleshooting.md |
参考文档由自动生成。运行可重新生成所有参考文档,或使用生成特定连接器的文档。
scripts/generate_skill_references.pypython scripts/generate_skill_references.py --all--connector <name>External Documentation
技能元数据
| Topic | Link |
|---|---|
| Agent Engine Platform | docs.airbyte.com/ai-agents/platform |
| Context Store | docs.airbyte.com/ai-agents/platform/context-store |
| Hosted Quickstart | docs.airbyte.com/ai-agents/tutorials/quickstarts/tutorial-hosted |
- 作者: Airbyte
- 版本: 1.2.0
- 许可证: Elastic-2.0
- 兼容性: 需要Python 3.11+。推荐使用uv进行包管理。
- 代码仓库: https://github.com/airbytehq/airbyte-agent-connectors
- MCP服务器: airbyte-agent-mcp
How References Are Generated
支持
Reference docs are auto-generated by .
Run to regenerate all
references, or for a specific connector.
scripts/generate_skill_references.pypython scripts/generate_skill_references.py --all--connector <name>- Slack社区:slack.airbyte.com
- GitHub Issues:airbytehq/airbyte-agent-connectors
- 官方文档:docs.airbyte.com/ai-agents
Skill Metadata
—
- Author: Airbyte
- Version: 1.2.0
- License: Elastic-2.0
- Compatibility: Requires Python 3.11+. Recommends uv for package management.
- Repository: https://github.com/airbytehq/airbyte-agent-connectors
- MCP Server: airbyte-agent-mcp
—
Support
—
- Slack Community: slack.airbyte.com
- GitHub Issues: airbytehq/airbyte-agent-connectors
- Documentation: docs.airbyte.com/ai-agents
—