Skip to content

Add MCP tool import validation script for CI#275

Open
CheeYuTan wants to merge 1 commit intodatabricks-solutions:mainfrom
CheeYuTan:feat/ci-import-smoke-test
Open

Add MCP tool import validation script for CI#275
CheeYuTan wants to merge 1 commit intodatabricks-solutions:mainfrom
CheeYuTan:feat/ci-import-smoke-test

Conversation

@CheeYuTan
Copy link
Contributor

Summary

  • New .github/scripts/validate_imports.py that validates all MCP tool modules and core library modules can be imported without errors
  • Catches broken imports, missing dependencies, and registration issues that would prevent the MCP server from starting
  • Validates 17 tool modules + 4 core library modules
  • No workspace connection needed — pure import validation

To integrate into CI (requires workflow scope), add to .github/workflows/ci.yml:

  validate-imports:
    name: Validate MCP Imports
    runs-on: linux-ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: "3.11"
      - name: Install packages
        run: |
          pip install -e databricks-tools-core/
          pip install -e databricks-mcp-server/
      - name: Smoke test imports
        run: python .github/scripts/validate_imports.py

Test proof

$ PYTHONPATH=databricks-tools-core:databricks-mcp-server python3 .github/scripts/validate_imports.py

# Core modules that don't need fastmcp imported successfully:
# databricks_tools_core.auth ✓
# databricks_tools_core.agent_bricks ✓
# databricks_tools_core.lakebase_autoscale ✓

# MCP tool modules correctly report missing fastmcp dependency
# (would pass after pip install -e in CI)
Test Result
Script runs and reports import status PASS
Core modules without external deps import cleanly PASS
Missing deps (fastmcp, sqlglot) correctly reported as failures PASS
Exit code 1 on failures, 0 on success PASS

New .github/scripts/validate_imports.py that catches broken imports,
missing dependencies, and registration issues that would prevent the
MCP server from starting. Validates all 17 tool modules and 4 core
library modules can be imported without errors.

Can be added to CI with:
  pip install -e databricks-tools-core/ -e databricks-mcp-server/
  python .github/scripts/validate_imports.py
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.

1 participant