feat: add cortex_mcp_server materialization and mcp_servers agent config (closes #18) - #23
Merged
Merged
Conversation
…fig (closes #18) 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
Implements both pieces requested in #18:
cortex_mcp_servermaterialization — registers a Snowflake External MCP Server object as a first-class dbt model, following the same pattern ascortex_skill. Config-only model body; required configs aredisplay_name,url, andapi_integration.mcp_serversstring-list config oncortex_agent— appends amcp_servers:block to the agent spec, mirroring the existingweb_search_toolinjection pattern. Omitting the config (or passing an empty list) leaves the generated DDL unchanged.cortex_mcp_server_name(ref(...))helper macro — returns the fully-qualified dotted name for acortex_mcp_servermodel and registers the DAG dependency, mirroringcortex_skill_path(). Use this in the agent spec body for proper lineage when the MCP server is managed by dbt.Usage
Or via config for servers not managed by dbt:
{{ config( materialized = 'cortex_agent', mcp_servers = ['db.schema.external_server'] ) }}Caveats
CREATE EXTERNAL MCP SERVERandDROP EXTERNAL MCP SERVER IF EXISTSsyntax is taken directly from the Snowflake docs linked in Support MCP servers as agent tools (CREATE EXTERNAL MCP SERVER + mcp_servers config) #18 but is marked with!! SYNTAX NEEDS VERIFICATIONcomments (same convention used in the existing versioning macros) — please verify against a live Snowflake account before merging.DROPmacro may need to drop theIF EXISTSclause if Snowflake doesn't support it for this object type.Test plan
dbt compile --target duckdbpasses for all 14 models (includingatlassian_mcp_serverandagent_with_mcp_server)CREATE EXTERNAL MCP SERVERDDL syntax against a live Snowflake accountdbt run --select atlassian_mcp_server agent_with_mcp_serveron a live Snowflake connectiondbt ls --select atlassian_mcp_server+shows the agent as downstream (DAG wiring)🤖 Generated with Claude Code