feat: add create_mcp_api_integration bootstrap macro and preflight check (closes #24) - #25
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create_mcp_api_integrationrun-operation that generatesCREATE API INTEGRATIONDDL for external MCP servers. Supports bothOAUTH_DYNAMIC_CLIENT(Dynamic Client Registration, recommended) andOAUTH2(client credentials) auth modes, plus adry_run=trueflag to preview DDL without executing. Requires ACCOUNTADMIN or CREATE INTEGRATION privilege.snowflake__create_or_replace_cortex_mcp_servernow checks viaSHOW INTEGRATIONS LIKE+RESULT_SCANbefore 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 exactdbt run-operationcommand to fix it.assert_create_mcp_api_integration_ddlrun-operation macro that validates DDL output for DCR, OAUTH2, andIF NOT EXISTSmodes usingdry_run=true— no elevated Snowflake privileges required to run this assertion.cortex_mcp_serversection to the README covering the bootstrap workflow, config reference, and completecreate_mcp_api_integrationparameter table. Updatesintegration_tests/README.mdwith 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 executingdbt run-operation assert_create_mcp_api_integration_ddlpasses — validates DCR, OAUTH2, and IF NOT EXISTS DDL forms (no admin privileges needed)dbt buildon anatlassian_mcp_servermodel fails with the new preflight error (not a raw Snowflake ORA/SQL error)create_mcp_api_integrationwith an admin role:dbt buildsucceeds end-to-end includingatlassian_mcp_serverandagent_with_mcp_serverCloses #24
🤖 Generated with Claude Code