feat: add multi-project SQL and admin API tools#661
Draft
DevonFulcher wants to merge 34 commits intomainfrom
Draft
feat: add multi-project SQL and admin API tools#661DevonFulcher wants to merge 34 commits intomainfrom
DevonFulcher wants to merge 34 commits intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This will be introduced in the first phase where it has non-empty content. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove get_config_for_project() from all config providers. Each multiproject semantic layer tool now calls _resolve_sl_config_for_project() which fetches credentials, builds the platform URL/headers, calls get_environments_for_project() directly, and returns the config via DefaultSemanticLayerConfigProvider._build_config(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add multi_project_only_toolsets set to toolsets.py and update generate_docs.py to skip those toolsets when generating README and diagram documentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
diagram.d2 is already correct (multi-project toolset excluded). Restoring d2.png to match the unchanged diagram source. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8415707 to
37f8127
Compare
…ools Multi-project server cannot run alongside single-project server, so tools share the same names (list_metrics, not list_metrics_for_project) and are controlled by the same env vars (DISABLE_SEMANTIC_LAYER). Remove MULTI_PROJECT_SEMANTIC_LAYER toolset, multi_project_only_toolsets, and multi_project_tools variables. Remove disable/enable_multi_project_semantic_layer settings fields. Remove multi_project_only_toolsets filtering from generate_docs.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37f8127 to
90165f8
Compare
…erConfigProvider Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
00bf2a4 to
a6796c2
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nticLayerFetcher Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add config_override parameter to all discovery client methods (MetadataAPIClient, PaginatedResourceFetcher, ModelsFetcher, ExposuresFetcher, SourcesFetcher, MacrosFetcher, ResourceDetailsFetcher, LineageFetcher, ModelPerformanceFetcher) to support per-call config overrides for multi-project mode. Create tools_multiproject.py with all 18 discovery tools mirroring Server A, each taking project_id as a required first parameter. Add get_config_for_project() to ConfigProvider ABC for multi-project config resolution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add config_override parameter to all discovery client methods (MetadataAPIClient, PaginatedResourceFetcher, ModelsFetcher, ExposuresFetcher, SourcesFetcher, MacrosFetcher, ResourceDetailsFetcher, LineageFetcher, ModelPerformanceFetcher) to support per-call config overrides for multi-project mode. Create tools_multiproject.py with all 18 discovery tools mirroring Server A, each taking project_id as a required first parameter. Add get_config_for_project() to ConfigProvider ABC for multi-project config resolution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… tools Multi-project server cannot run alongside single-project server, so tools share the same names (text_to_sql, not text_to_sql_for_project) and are controlled by the same env vars (DISABLE_SQL, DISABLE_ADMIN_API). Remove _FOR_PROJECT ToolName entries, remove from toolsets dict. Rename multi-project tool functions and MCP names to match single-project. Separate MULTIPROJECT_ADMIN_API_TOOLS from ADMIN_TOOLS. Add register_multiproject_admin_api_tools function. Remove unused _for_project prompt files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a6796c2 to
b3d5fe9
Compare
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.
Why
Part of the multi-project feature (Phases 5 & 6). Adds project-aware SQL and admin API tools that accept
project_idas a required parameter, enabling agents to work across multiple dbt projects.What
SQL tools (Phase 5) - New local tool definitions that proxy to remote SQL tools with project-specific configuration:
text_to_sql_for_project(project_id, query)- Generates SQL from natural language using the specified project's production environmentexecute_sql_for_project(project_id, sql_query, limit)- Executes SQL against the specified project's development environmentBoth validate that the required environment exists and raise clear
ValueErrorif not.Admin API tools (Phase 6) - New tools that filter admin API results by project:
list_jobs_for_project(project_id, limit, offset)- Lists jobs filtered by project IDlist_jobs_runs_for_project(project_id, job_id, status, limit)- Lists job runs filtered by project IDInfrastructure:
get_config_for_project()default method toConfigProviderbase class (raisesNotImplementedError- concrete implementations come from Phase 1 PR feat: extract project/environment helpers for multi-project support #657)src/dbt_mcp/sql/module for multi-project SQL tool definitionsNotes
get_config_for_project()concrete implementations on the config providersDrafted by Claude Opus 4.6 under the direction of @DevonFulcher