From 9d714555b82c895eb852393fd0c063426e2f5d1a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 22:58:15 +0000 Subject: [PATCH] feat(mcp): proxy Kapa knowledge MCP server for inline Airbyte doc search Mount Kapa's hosted MCP server as a proxy when KAPA_API_KEY is set, giving agents inline access to Airbyte documentation search alongside native PyAirbyte MCP tools. - Mount Kapa proxy with 'kapa' prefix to namespace tools - Gracefully skip mounting if KAPA_API_KEY is not configured - Configurable via KAPA_MCP_SERVER_URL and KAPA_API_KEY env vars Refs: https://github.com/airbytehq/airbyte-internal-issues/issues/15904 Co-Authored-By: AJ Steers --- airbyte/mcp/server.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/airbyte/mcp/server.py b/airbyte/mcp/server.py index 5464e060b..a7ca8b417 100644 --- a/airbyte/mcp/server.py +++ b/airbyte/mcp/server.py @@ -4,8 +4,10 @@ from __future__ import annotations import asyncio +import os import sys +from fastmcp import FastMCP from fastmcp_extensions import mcp_server from airbyte._util.meta import set_mcp_mode @@ -94,6 +96,47 @@ register_prompts(app) +def _mount_kapa_proxy(app: FastMCP) -> None: + """Mount the Kapa knowledge MCP proxy if credentials are configured. + + When KAPA_API_KEY is set, this creates a proxy to Kapa's hosted MCP server + and mounts it into the main server, giving agents inline access to Airbyte + documentation search alongside native PyAirbyte tools. + + If KAPA_API_KEY is not set, this is a no-op. + """ + kapa_api_key = os.environ.get("KAPA_API_KEY") + if not kapa_api_key: + print( + "Kapa knowledge proxy not mounted (KAPA_API_KEY not set).", + file=sys.stderr, + ) + return + + kapa_url = os.environ.get("KAPA_MCP_SERVER_URL", "https://airbyte.mcp.kapa.ai") + kapa_proxy = FastMCP.as_proxy( + { + "mcpServers": { + "kapa": { + "url": kapa_url, + "transport": "http", + "headers": { + "Authorization": f"Bearer {kapa_api_key}", + }, + } + } + } + ) + app.mount(kapa_proxy, prefix="kapa") + print( + f"Kapa knowledge proxy mounted from {kapa_url}.", + file=sys.stderr, + ) + + +_mount_kapa_proxy(app) + + def main() -> None: """@private Main entry point for the MCP server.