airbyte.mcp
PyAirbyte MCP Server - Model Context Protocol Integration
NOTE: This MCP server implementation is experimental and may change without notice between minor versions of PyAirbyte. The API may be modified or entirely refactored in future versions.
The PyAirbyte MCP (Model Context Protocol) server provides a standardized interface for managing Airbyte connectors through MCP-compatible clients. This experimental feature allows you to list connectors, validate configurations, and run sync operations using the MCP protocol.
Getting Started with PyAirbyte MCP
To get started with the PyAirbyte MCP server, follow these steps:
- Create a Dotenv secrets file.
- Register the MCP server with your MCP client.
- Test the MCP server connection using your MCP client.
Step 1: Generate a Dotenv Secrets File
To get started with the PyAirbyte MCP server, you will need to create a dotenv file containing your Airbyte Cloud credentials, as well as credentials for any third-party services you wish to connect to via Airbyte.
Create a file named ~/.mcp/airbyte_mcp.env
with the following content:
# Airbyte Project Artifacts Directory
AIRBYTE_PROJECT_DIR=/path/to/any/writeable/project-dir
# Airbyte Cloud Credentials (Required for Airbyte Cloud Operations)
AIRBYTE_CLOUD_CLIENT_ID=your_api_key
AIRBYTE_CLOUD_CLIENT_SECRET=your_api_secret
AIRBYTE_CLOUD_WORKSPACE_ID=your_workspace_id
# API-Specific Credentials (Optional, depending on your connectors)
# For example, for a PostgreSQL source connector:
# POSTGRES_HOST=your_postgres_host
# POSTGRES_PORT=5432
# POSTGRES_DB=your_database_name
# POSTGRES_USER=your_database_user
# POSTGRES_PASSWORD=your_database_password
# For example, for a Stripe source connector:
# STRIPE_API_KEY=your_stripe_api_key
# STRIPE_API_SECRET=your_stripe_api_secret
# STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
Note:
- You can add more environment variables to this file as needed for different connectors. To start, you only need to create the file and pass it to the MCP server.
- Ensure that this file is kept secure, as it contains sensitive information. Your LLM should never be given direct access to this file or its contents.
- The MCP tools will give your LLM the ability to view which variables are available, but it does not give access to their values.
- The
AIRBYTE_PROJECT_DIR
variable specifies a directory where the MCP server can store temporary project files. Ensure this directory is writable by the user running the MCP server.
Step 2: Registering the MCP Server
First install uv
(brew install uv
).
Then, create a file named server_config.json
(or the file name required by your MCP client)
with the following content:
{
"mcpServers": {
"airbyte": {
"command": "uvx",
"args": ["--from=airbyte", "airbyte-mcp"],
"env": {
"AIRBYTE_MCP_ENV_FILE": "/path/to/my/.mcp/airbyte_mcp.env"
}
}
}
}
If you prefer to pre-install, first run uv install airbyte
or pipx install airbyte
,
and then create the configuration file as follows:
{
"mcpServers": {
"airbyte": {
"command": "airbyte-mcp",
"args": [],
"env": {
"AIRBYTE_MCP_ENV_FILE": "/path/to/my/.mcp/airbyte_mcp.env"
}
}
}
}
Note:
- Replace
/path/to/my/.mcp/airbyte_mcp.env
with the absolute path to your dotenv file created in Step 1.
Step 3: Testing the MCP Server Connection
You can test the MCP server connection using your MCP client.
Helpful prompts to try:
- "Use your MCP tools to list all available Airbyte connectors."
- "Use your MCP tools to get information about the Airbyte Stripe connector."
- "Use your MCP tools to list all variables you have access to in the dotenv secrets file."
- "Use your MCP tools to check your connection to your Airbyte Cloud workspace."
- "Use your MCP tools to list all available destinations in my Airbyte Cloud workspace."
Contributing to the Airbyte MCP Server
Additional resources
For issues and questions:
1# Copyright (c) 2024 Airbyte, Inc., all rights reserved. 2 3r"""***PyAirbyte MCP Server - Model Context Protocol Integration*** 4 5> **NOTE:** 6> This MCP server implementation is experimental and may change without notice between minor 7> versions of PyAirbyte. The API may be modified or entirely refactored in future versions. 8 9The PyAirbyte MCP (Model Context Protocol) server provides a standardized interface for 10managing Airbyte connectors through MCP-compatible clients. This experimental feature 11allows you to list connectors, validate configurations, and run sync operations using 12the MCP protocol. 13 14## Getting Started with PyAirbyte MCP 15 16To get started with the PyAirbyte MCP server, follow these steps: 17 181. Create a Dotenv secrets file. 192. Register the MCP server with your MCP client. 203. Test the MCP server connection using your MCP client. 21 22### Step 1: Generate a Dotenv Secrets File 23 24To get started with the PyAirbyte MCP server, you will need to create a dotenv 25file containing your Airbyte Cloud credentials, as well as credentials for any 26third-party services you wish to connect to via Airbyte. 27 28Create a file named `~/.mcp/airbyte_mcp.env` with the following content: 29 30```ini 31# Airbyte Project Artifacts Directory 32AIRBYTE_PROJECT_DIR=/path/to/any/writeable/project-dir 33 34# Airbyte Cloud Credentials (Required for Airbyte Cloud Operations) 35AIRBYTE_CLOUD_CLIENT_ID=your_api_key 36AIRBYTE_CLOUD_CLIENT_SECRET=your_api_secret 37AIRBYTE_CLOUD_WORKSPACE_ID=your_workspace_id 38 39# API-Specific Credentials (Optional, depending on your connectors) 40 41# For example, for a PostgreSQL source connector: 42# POSTGRES_HOST=your_postgres_host 43# POSTGRES_PORT=5432 44# POSTGRES_DB=your_database_name 45# POSTGRES_USER=your_database_user 46# POSTGRES_PASSWORD=your_database_password 47 48# For example, for a Stripe source connector: 49# STRIPE_API_KEY=your_stripe_api_key 50# STRIPE_API_SECRET=your_stripe_api_secret 51# STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret 52``` 53 54Note: 551. You can add more environment variables to this file as needed for different connectors. To start, 56 you only need to create the file and pass it to the MCP server. 572. Ensure that this file is kept secure, as it contains sensitive information. Your LLM 58 *should never* be given direct access to this file or its contents. 593. The MCP tools will give your LLM the ability to view *which* variables are available, but it 60 does not give access to their values. 614. The `AIRBYTE_PROJECT_DIR` variable specifies a directory where the MCP server can 62 store temporary project files. Ensure this directory is writable by the user running 63 the MCP server. 64 65### Step 2: Registering the MCP Server 66 67First install `uv` (`brew install uv`). 68 69Then, create a file named `server_config.json` (or the file name required by your MCP client) 70with the following content: 71 72```json 73{ 74 "mcpServers": { 75 "airbyte": { 76 "command": "uvx", 77 "args": ["--from=airbyte", "airbyte-mcp"], 78 "env": { 79 "AIRBYTE_MCP_ENV_FILE": "/path/to/my/.mcp/airbyte_mcp.env" 80 } 81 } 82 } 83} 84``` 85 86If you prefer to pre-install, first run `uv install airbyte` or `pipx install airbyte`, 87and then create the configuration file as follows: 88 89```json 90{ 91 "mcpServers": { 92 "airbyte": { 93 "command": "airbyte-mcp", 94 "args": [], 95 "env": { 96 "AIRBYTE_MCP_ENV_FILE": "/path/to/my/.mcp/airbyte_mcp.env" 97 } 98 } 99 } 100} 101``` 102 103Note: 104- Replace `/path/to/my/.mcp/airbyte_mcp.env` with the absolute path to your dotenv file created in 105 Step 1. 106 107### Step 3: Testing the MCP Server Connection 108 109You can test the MCP server connection using your MCP client. 110 111Helpful prompts to try: 112 1131. "Use your MCP tools to list all available Airbyte connectors." 1142. "Use your MCP tools to get information about the Airbyte Stripe connector." 1153. "Use your MCP tools to list all variables you have access to in the dotenv secrets 116 file." 1174. "Use your MCP tools to check your connection to your Airbyte Cloud workspace." 1185. "Use your MCP tools to list all available destinations in my Airbyte Cloud workspace." 119 120## Contributing to the Airbyte MCP Server 121 122- [PyAirbyte Contributing Guide](https://github.com/airbytehq/PyAirbyte/blob/main/docs/CONTRIBUTING.md) 123 124### Additional resources 125 126- [Model Context Protocol Documentation](https://modelcontextprotocol.io/) 127- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) 128 129For issues and questions: 130- [PyAirbyte GitHub Issues](https://github.com/airbytehq/pyairbyte/issues) 131- [PyAirbyte Discussions](https://github.com/airbytehq/pyairbyte/discussions) 132 133""" # noqa: D415 134 135from airbyte.mcp import cloud_ops, connector_registry, local_ops, server 136 137 138__all__: list[str] = [ 139 "cloud_ops", 140 "connector_registry", 141 "local_ops", 142 "server", 143] 144 145__docformat__ = "google"