Skip to content

feat: add create_mcp_api_integration bootstrap macro and preflight check (closes #24) - #25

Merged
Matts52 merged 1 commit into
mainfrom
fix-issue-24-test-fixtures
Aug 19, 2026
Merged

feat: add create_mcp_api_integration bootstrap macro and preflight check (closes #24)#25
Matts52 merged 1 commit into
mainfrom
fix-issue-24-test-fixtures

Conversation

@Matts52

@Matts52 Matts52 commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bootstrap macro: Adds create_mcp_api_integration run-operation that generates CREATE API INTEGRATION DDL for external MCP servers. Supports both OAUTH_DYNAMIC_CLIENT (Dynamic Client Registration, recommended) and OAUTH2 (client credentials) auth modes, plus a dry_run=true flag to preview DDL without executing. Requires ACCOUNTADMIN or CREATE INTEGRATION privilege.
  • Preflight existence check: snowflake__create_or_replace_cortex_mcp_server now checks via SHOW INTEGRATIONS LIKE + RESULT_SCAN before issuing DDL. If the named API integration is missing, dbt fails immediately with a clear, actionable error message naming the missing object and showing the exact dbt run-operation command to fix it.
  • Test fixture: Adds assert_create_mcp_api_integration_ddl run-operation macro that validates DDL output for DCR, OAUTH2, and IF NOT EXISTS modes using dry_run=true — no elevated Snowflake privileges required to run this assertion.
  • Documentation: Adds a full cortex_mcp_server section to the README covering the bootstrap workflow, config reference, and complete create_mcp_api_integration parameter table. Updates integration_tests/README.md with the API integration prerequisite and bootstrap command.

Test plan

  • dbt run-operation create_mcp_api_integration --args '{integration_name: ..., ..., dry_run: true}' logs expected DDL without executing
  • dbt run-operation assert_create_mcp_api_integration_ddl passes — validates DCR, OAUTH2, and IF NOT EXISTS DDL forms (no admin privileges needed)
  • On Snowflake with a missing API integration: dbt build on an atlassian_mcp_server model fails with the new preflight error (not a raw Snowflake ORA/SQL error)
  • After running create_mcp_api_integration with an admin role: dbt build succeeds end-to-end including atlassian_mcp_server and agent_with_mcp_server

Closes #24

🤖 Generated with Claude Code

…eck (closes #24)

- Add `create_mcp_api_integration` run-operation macro that generates
  `CREATE API INTEGRATION` DDL for external MCP servers, supporting both
  OAUTH_DYNAMIC_CLIENT (DCR) and OAUTH2 (client credentials) auth types,
  with a `dry_run` flag to preview DDL without executing.

- Add `_mcp_api_integration_exists` helper (SHOW INTEGRATIONS + RESULT_SCAN)
  and a preflight existence check in `snowflake__create_or_replace_cortex_mcp_server`
  that fails with a clear, actionable error pointing to the bootstrap step if
  the referenced API integration does not exist.

- Add `assert_create_mcp_api_integration_ddl` integration test macro that
  validates DDL correctness for DCR, OAUTH2, and IF NOT EXISTS modes using
  dry_run (no elevated privileges required).

- Document the full `cortex_mcp_server` section in README including bootstrap
  workflow, config reference, and `create_mcp_api_integration` parameter table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Matts52
Matts52 merged commit 862d7b3 into main Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cortex_mcp_server materialization requires API INTEGRATION to pre-exist; nothing creates it

1 participant