ai-dev-kit
ai-dev-kit copied to clipboard
feat: allow DATABRICKS_MCP_CLIENT env var to override product name in user-agent
Problem
PRODUCT_NAME is hardcoded to "databricks-ai-dev-kit". Organisations running the MCP server from multiple AI clients (Claude Code, Codex, Cursor, etc.) cannot distinguish which client generated a query in Databricks audit logs (system.access.audit) or SQL warehouse query history — all traffic appears under the same product name.
Solution
Read PRODUCT_NAME from the DATABRICKS_MCP_CLIENT environment variable, falling back to "databricks-ai-dev-kit" if not set. This preserves existing behaviour for everyone who doesn't set the variable.
Each client sets the env var in its MCP server config:
Claude Code (~/.claude.json):
"env": { "DATABRICKS_MCP_CLIENT": "my-org-claude-code" }
Codex (~/.codex/config.toml):
[mcp_servers.databricks.env]
DATABRICKS_MCP_CLIENT = "my-org-codex"
Changes
databricks_tools_core/identity.py— one line change, env var with original default as fallback; docstring updated with examples and configuration instructions for Claude Code and Codex