diff --git a/.github/mcp-ci-tests.mcp.json b/.github/mcp-ci-tests.mcp.json new file mode 100644 index 000000000..c78bd6e71 --- /dev/null +++ b/.github/mcp-ci-tests.mcp.json @@ -0,0 +1,16 @@ +{ + "mcpServers": { + "airbyte-mcp": { + "type": "stdio", + "command": "poetry", + "args": [ + "run", + "airbyte-mcp" + ], + "env": { + "GCP_GSM_CREDENTIALS": "${GCP_GSM_CREDENTIALS}", + "AIRBYTE_CLOUD_MCP_SAFE_MODE": "1" + } + } + } +} diff --git a/.github/workflows/poe-command.yml b/.github/workflows/poe-command.yml new file mode 100644 index 000000000..ac8e044bf --- /dev/null +++ b/.github/workflows/poe-command.yml @@ -0,0 +1,35 @@ +name: On-Demand Poe Task + +on: + workflow_dispatch: + inputs: + comment-id: + description: "Optional comment-id of the slash command. Ignore if not applicable." + required: false + pr: + description: "PR Number" + required: false + +permissions: + contents: write + pull-requests: write + +jobs: + run-poe-command: + runs-on: ubuntu-latest + steps: + - name: Authenticate as GitHub App + uses: actions/create-github-app-token@v2 + id: get-app-token + with: + owner: "airbytehq" + repositories: "PyAirbyte" + app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }} + private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }} + + - name: Run Poe Slash Command Processor + uses: aaronsteers/poe-command-processor@v1.3.3 + with: + pr: ${{ github.event.inputs.pr }} + comment-id: ${{ github.event.inputs.comment-id }} + github-token: ${{ steps.get-app-token.outputs.token }} diff --git a/.github/workflows/slash_command_dispatch.yml b/.github/workflows/slash_command_dispatch.yml index 402cbff57..3180704b1 100644 --- a/.github/workflows/slash_command_dispatch.yml +++ b/.github/workflows/slash_command_dispatch.yml @@ -34,6 +34,7 @@ jobs: fix-pr test-pr poetry-lock + poe prerelease static-args: | pr=${{ github.event.issue.number }} diff --git a/pyproject.toml b/pyproject.toml index c786c035f..7b3e43173 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -158,6 +158,18 @@ mcp-serve-sse = { cmd = "poetry run python -c \"from airbyte.mcp.server import a mcp-inspect = { cmd = "poetry run fastmcp inspect airbyte/mcp/server.py:app", help = "Inspect MCP tools and resources (supports --tools, --health, etc.)" } mcp-tool-test = { cmd = "poetry run python bin/test_mcp_tool.py", help = "Test MCP tools directly with JSON arguments: poe mcp-tool-test ''" } +# Claude Code MCP Testing Tasks +[tool.poe.tasks.test-my-tools] +help = "Run Claude Code in headless mode with the test-my-tools MCP prompt" +shell = """ +npx @anthropic-ai/claude-code --print "/mcp__airbyte-mcp__test-my-tools ${scope:+ $scope}" \ + --mcp-config=.github/mcp-ci-tests.mcp.json \ + --dangerously-skip-permissions \ + --verbose --output-format=stream-json | \ + jq -r '.message.content[]? | if .type == "text" then "💬 " + .text elif .type == "tool_use" then "🔧 " + .name + "(" + (.input | tojson) + ")" else empty end' 2>/dev/null +""" +args = [{ name = "scope", default = "", help = "Optional scope/context to focus testing (e.g., 'focus on areas of the code changed versus main')" }] + [tool.airbyte_ci] extra_poetry_groups = ["dev"] poe_tasks = ["test"]