### Install server requirements Source: https://github.com/databrickslabs/mcp/blob/master/CONTRIBUTING.md Install all necessary dependencies within the specific server directory before development. ```bash uv sync ``` -------------------------------- ### Deploy and Start Databricks App Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Commands to deploy and start the application on Databricks. ```bash databricks apps deploy my-app-name -p profile-name databricks apps start my-app-name -p profile-name ``` -------------------------------- ### Schema Format Examples Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Examples of valid and invalid schema naming conventions. ```text catalog.schema my_catalog.my_schema ecommerce.customer_data ``` ```text schema # Missing catalog catalog.schema.extra # Too many parts catalog..schema # Double dot ``` -------------------------------- ### Run with Schema Only Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Example of configuring the tool using only the schema argument. ```bash unitycatalog-mcp -s ecommerce.products ``` -------------------------------- ### Server Startup Log Format Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md Example of the information logged by the server upon initialization. ```text [timestamp] [INFO] databricks.labs.mcp.servers.unity_catalog.tools: Starting MCP Unity Catalog server version {VERSION} with settings: {SETTINGS} [timestamp] [INFO] databricks.labs.mcp.servers.unity_catalog.tools: Registered {N} tools: tool1, tool2, ... ``` -------------------------------- ### start() Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md Programmatic function to start the MCP server using stdio transport. It blocks until the server process exits. ```APIDOC ## Function: start() ### Description Starts the MCP server using stdio transport, listening for JSON-RPC messages on stdin and writing responses to stdout. ### Signature `def start() -> None` ### Prerequisites - Databricks credentials must be configured (environment variables, CLI config, or ~/.databrickscfg). - Command-line arguments must be parsed (e.g., --schema-full-name). ### Usage ```python from databricks.labs.mcp.servers.unity_catalog.server import start # Start the MCP server (blocks until exit) start() ``` ``` -------------------------------- ### Example .env File Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md A sample .env file demonstrating catalog, schema, and vector search settings. ```bash # Catalog and Schema SCHEMA_FULL_NAME=ecommerce_catalog.customer_data # Genie Spaces GENIE_SPACE_IDS=analytics-space,reporting-space # Vector Search Results VECTOR_SEARCH_NUM_RESULTS=20 ``` -------------------------------- ### Combined Configuration Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Example of running the tool with both schema and Genie space configurations. ```bash unitycatalog-mcp \ -s ecommerce.products \ -g analytics-space,reporting-space \ -vn 20 ``` -------------------------------- ### Programmatic Usage Example Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/cli-settings.md Demonstrates how to initialize and access settings programmatically alongside CLI usage context. ```python # Command-line usage # unitycatalog-mcp -s my_catalog.my_schema -g space1,space2 -vn 10 # Programmatic usage from databricks.labs.mcp.servers.unity_catalog.cli import get_settings settings = get_settings() print(f"Catalog: {settings.get_catalog_name()}") print(f"Schema: {settings.get_schema_name()}") print(f"Spaces: {settings.genie_space_ids}") print(f"Vector results: {settings.vector_search_num_results}") ``` -------------------------------- ### Run with Uvicorn Locally Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Start the server locally for development purposes. ```bash uvicorn databricks.labs.mcp.servers.unity_catalog.app:app --host 0.0.0.0 --port 8000 ``` -------------------------------- ### Start MCP server programmatically Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md Import and execute the start function to run the MCP server, which blocks until exit. ```python from databricks.labs.mcp.servers.unity_catalog.server import start # Start the MCP server (blocks until exit) start() ``` -------------------------------- ### Configuration Precedence Example Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Demonstrates that command-line arguments take precedence over environment variables and .env files. ```bash # In .env SCHEMA_FULL_NAME=from_env_file VECTOR_SEARCH_NUM_RESULTS=5 # Environment variable export SCHEMA_FULL_NAME=from_env_var # Command-line unitycatalog-mcp -s from_cli -vn 10 ``` -------------------------------- ### Define start function signature Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md The start function signature for initializing the MCP server. ```python def start() -> None ``` -------------------------------- ### Local Development Commands Source: https://github.com/databrickslabs/mcp/blob/master/examples/custom-server/README.md Commands to synchronize dependencies and start the server locally with hot-reloading. ```bash uv sync ``` ```bash uvicorn custom_server.app:app --reload ``` -------------------------------- ### Configure app.yml for databricks apps CLI Source: https://github.com/databrickslabs/mcp/blob/master/README.md Example configuration for the app.yml file. ```yaml command: ["uvicorn", "databricks.labs.mcp.servers.unity_catalog.app:app"] env: - name: SCHEMA_FULL_NAME value: catalog.schema - name: GENIE_SPACE_IDS value: '["space1","space2"]' ``` -------------------------------- ### List Available Tools Response Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Example response containing tool definitions including names, descriptions, and input schemas. ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "name": "vector_search_my_index", "description": "Searches the vector index `catalog.schema.my_index`.", "inputSchema": { "type": "object", "properties": { "query": { "type": "string", "description": "The search query text" } }, "required": ["query"] } }, { "name": "genie_start_conversation", "description": "Start a new conversation in a Genie space.", "inputSchema": { "type": "object", "properties": { "space_id": { "type": "string", "description": "The ID of the Genie space." }, "content": { "type": "string", "description": "The text to start the conversation." } }, "required": ["space_id", "content"] } } ] } ``` -------------------------------- ### Run with Genie Spaces Only Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Example of configuring the tool using only Genie space identifiers. ```bash unitycatalog-mcp -g analytics-space,reporting-space ``` -------------------------------- ### Install Databricks MCP package Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Install the required Python package via pip. ```bash pip install databricks-labs-mcp ``` -------------------------------- ### Execute Server via CLI Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md Run the installed server using the defined console script name and required arguments. ```bash uv run unitycatalog-mcp -s my_catalog.my_schema -g space1,space2 ``` -------------------------------- ### Implement a Custom Tool Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-tool.md Example of inheriting from BaseTool and implementing the required execute method. ```python from databricks.labs.mcp.servers.unity_catalog.tools.base_tool import BaseTool from mcp.types import Tool as ToolSpec class MyCustomTool(BaseTool): def __init__(self, name: str, description: str): tool_spec = ToolSpec( name=name, description=description, inputSchema={"type": "object", "properties": {}} ) super().__init__(tool_spec) def execute(self, **kwargs): # Implement tool logic here return [TextContent(type="text", text="result")] ``` -------------------------------- ### GET / Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Endpoint for serving static files, including HTML, CSS, and JavaScript for the UI dashboard. ```APIDOC ## GET / ### Description Serves static files from the application's static directory. This supports the UI/dashboard and provides fallback routing for single-page application functionality. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **File Content** (binary/text) - The requested static asset or the fallback HTML file. ``` -------------------------------- ### Discover UC Function Tools Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/uc-function-tool.md Example of discovering and listing all available UC functions within a specified schema. ```python from databricks.labs.mcp.servers.unity_catalog.tools.functions import list_uc_function_tools from databricks.labs.mcp.servers.unity_catalog.cli import get_settings settings = get_settings() tools = list_uc_function_tools(settings) print(f"Found {len(tools)} UC functions") ``` -------------------------------- ### Get Space Details Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Retrieves metadata for a specific space. ```json { "jsonrpc": "2.0", "id": 8, "method": "tools/call", "params": { "name": "genie_get_space", "arguments": { "space_id": "space-123" } } } ``` ```json { "jsonrpc": "2.0", "id": 8, "result": [ { "type": "text", "text": "{\"space_id\":\"space-123\",\"title\":\"Sales Analytics\",\"description\":\"Analyze sales data and metrics\"}" } ] } ``` -------------------------------- ### Execute a UC Function Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/uc-function-tool.md Example of executing a Unity Catalog function using the UCFunctionTool instance. ```python from databricks.labs.mcp.servers.unity_catalog.tools.functions import UCFunctionTool from unitycatalog.ai.core.databricks import DatabricksFunctionClient client = DatabricksFunctionClient() tool = UCFunctionTool(tool_obj, client, "my_catalog.my_schema.my_function") # Execute the function results = tool.execute(param1="value1", param2="value2") result_text = results[0].text # Access the result ``` -------------------------------- ### Vector Search Tool Execution Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Example request and response for performing a vector search using the vector_search_* tool naming convention. ```json { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "vector_search_products", "arguments": { "query": "laptop" } } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "text", "text": "[{\"product_id\":123,\"name\":\"XPS Laptop\",\"price\":1299.99},{\"product_id\":456,\"name\":\"ThinkPad\",\"price\":899.99}]" } ] } ``` -------------------------------- ### Full Configuration Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Demonstrates full configuration using command-line flags or a .env file. ```bash # Combine all features unitycatalog-mcp \ -s ecommerce.products \ -g analytics-space \ -vn 20 # Or use .env cat > .env << EOF SCHEMA_FULL_NAME=ecommerce.products GENIE_SPACE_IDS=analytics-space VECTOR_SEARCH_NUM_RESULTS=20 EOF unitycatalog-mcp ``` -------------------------------- ### Build Application Wheel Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Build the project wheel using uv before deployment. ```bash uv build --wheel ``` -------------------------------- ### Build the project wheel Source: https://github.com/databrickslabs/mcp/blob/master/README.md Builds the project into a wheel file before deployment. ```bash cd /path/to/this/repo uv build --wheel ``` -------------------------------- ### genie_start_conversation Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/genie-tool.md Starts a new conversation in a specified Genie space. ```APIDOC ## genie_start_conversation ### Description Starts a new conversation in a Genie space. ### Parameters - **space_id** (str) - Required - The ID of the Genie space - **content** (str) - Required - The text to start the conversation ### Returns - **conversation_id** (str) - ID of the new conversation - **message_id** (str) - ID of the initial message - **content** (str) - The response content - **status** (str) - Message status - **attachments** (list) - Any attached query results ``` -------------------------------- ### Configure Schema and Query Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Sets up the schema for Unity Catalog functions via command-line arguments. ```bash # Set up schema with UC functions unitycatalog-mcp -s ecommerce.products # Then use with Claude Desktop config ``` -------------------------------- ### Get Query Result Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Fetches the result of a query associated with an attachment. ```json { "jsonrpc": "2.0", "id": 6, "method": "tools/call", "params": { "name": "genie_get_query_result", "arguments": { "space_id": "space-123", "conversation_id": "conv-456", "message_id": "msg-789", "attachment_id": "att-123" } } } ``` ```json { "jsonrpc": "2.0", "id": 6, "result": [ { "type": "text", "text": "{\"data\":{\"rows\":[{\"product_id\":1,\"name\":\"Laptop\"},{\"product_id\":2,\"name\":\"Mouse\"}]}" } ] } ``` -------------------------------- ### Get a Genie Message Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Retrieves details of a specific message by ID. ```json { "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "genie_get_message", "arguments": { "space_id": "space-123", "conversation_id": "conv-456", "message_id": "msg-789" } } } ``` ```json { "jsonrpc": "2.0", "id": 5, "result": [ { "type": "text", "text": "{\"message_id\":\"msg-789\",\"content\":\"Here are the top products...\",\"status\":\"COMPLETED\",\"conversation_id\":\"conv-456\",\"space_id\":\"space-123\",\"attachments\":null,\"error\":null}" } ] } ``` -------------------------------- ### Start a Genie Conversation Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Initiates a new conversation within a specific space. ```json { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "genie_start_conversation", "arguments": { "space_id": "space-123", "content": "What are our top products?" } } } ``` ```json { "jsonrpc": "2.0", "id": 3, "result": [ { "type": "text", "text": "{\"conversation_id\":\"conv-456\",\"message_id\":\"msg-789\",\"content\":\"Here are the top products...\",\"status\":\"COMPLETED\",\"attachments\":null}" } ] } ``` -------------------------------- ### Configure Local Development Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Use CLI arguments or a .env file to define server settings. ```bash # With CLI arguments unitycatalog-mcp -s catalog.schema -g space-1 -vn 5 # Or with .env cat > .env << EOF SCHEMA_FULL_NAME=catalog.schema GENIE_SPACE_IDS=space-1 VECTOR_SEARCH_NUM_RESULTS=5 EOF unitycatalog-mcp ``` -------------------------------- ### get_prepared_mcp_app() -> FastMCP Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/tools-module.md Creates and configures a FastMCP server instance with all discovered tools registered. ```APIDOC ## get_prepared_mcp_app() -> FastMCP ### Description Creates and configures a FastMCP server instance named "mcp-unitycatalog". It automatically discovers all tools, registers the necessary handlers for tool listing and execution, and returns the configured server. ### Returns - **FastMCP** - A configured FastMCP server instance ready to run. ### Example ```python from databricks.labs.mcp.servers.unity_catalog.tools import get_prepared_mcp_app mcp = get_prepared_mcp_app() mcp.run(transport="stdio") ``` ``` -------------------------------- ### main() Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md The main entry point for the Unity Catalog MCP server, typically invoked via the console script or Python module. It configures the Databricks SDK user agent and initiates the server startup process. ```APIDOC ## Function: main() ### Description The main entry point for the Unity Catalog MCP server. It sets the user agent headers for the Databricks SDK and triggers the server initialization. ### Signature `def main() -> None` ### Usage ```bash # Via console script unitycatalog-mcp -s my_catalog.my_schema # Via Python module python -m databricks.labs.mcp.servers.unity_catalog -s my_catalog.my_schema ``` ``` -------------------------------- ### Initialize MCP Instance Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Creates a FastMCP instance pre-configured with Unity Catalog tools, vector search, and Genie spaces. ```python mcp = get_prepared_mcp_app() ``` -------------------------------- ### UC Function Tool Execution Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Example request and response for executing a UC function by name. ```json { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "get_customer_details", "arguments": { "customer_id": "12345" } } } ``` ```json { "jsonrpc": "2.0", "id": 2, "result": [ { "type": "text", "text": "{\"id\":\"12345\",\"name\":\"John Doe\",\"email\":\"john@example.com\"}" } ] } ``` -------------------------------- ### MCP HTTP Response Example Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-utilities.md Standard JSON-RPC response format returned by the MCP endpoint. ```http HTTP/1.1 200 OK Content-Type: application/json { "jsonrpc": "2.0", "id": 1, "result": [...] } ``` -------------------------------- ### Run Unity Catalog MCP server locally Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Execute the server locally using various configurations for schemas and Genie spaces. ```bash # Configure Databricks credentials first databricks configure --token # Run with schema only unitycatalog-mcp -s my_catalog.my_schema # Run with Genie spaces unitycatalog-mcp -g space-1,space-2 # Run with both unitycatalog-mcp -s my_catalog.my_schema -g space-1,space-2 -vn 10 ``` -------------------------------- ### Configure via Environment Variables Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Set configuration options using environment variables before executing the server command. ```bash # Set and run export SCHEMA_FULL_NAME=my_catalog.my_schema export GENIE_SPACE_IDS=space-123,space-456 export VECTOR_SEARCH_NUM_RESULTS=10 unitycatalog-mcp # Or inline SCHEMA_FULL_NAME=catalog.schema unitycatalog-mcp ``` -------------------------------- ### Configure FastMCP Server Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/tools-module.md Initializes and configures a FastMCP server instance with all discovered tools registered. ```python from databricks.labs.mcp.servers.unity_catalog.tools import get_prepared_mcp_app mcp = get_prepared_mcp_app() mcp.run(transport="stdio") # Run with stdio transport ``` -------------------------------- ### MCP HTTP Request Example Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-utilities.md Standard JSON-RPC request format sent via POST to the MCP endpoint. ```http POST /mcp/ HTTP/1.1 Content-Type: application/json { "jsonrpc": "2.0", "id": 1, "method": "tools/list" } ``` -------------------------------- ### Run tests Source: https://github.com/databrickslabs/mcp/blob/master/CONTRIBUTING.md Execute the test suite for the server using the configured environment. ```bash uv run pytest tests ``` -------------------------------- ### Deploying with FastAPI Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-utilities.md Mounts the streamable application to a FastAPI instance. ```python # In app.py streamable_app = mcp.streamable_http_app() app = FastAPI() app.mount("/api", streamable_app) ``` -------------------------------- ### Configure Console Script Entry Point Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md Define the entry point in pyproject.toml to enable the server as a command-line tool. ```toml [project.scripts] unitycatalog-mcp = "databricks.labs.mcp.servers.unity_catalog:main" ``` -------------------------------- ### Replay events after a specific ID Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/in-memory-event-store.md Replays events from a stream starting after the provided event ID using a callback function. ```python store = InMemoryEventStore() # Store some events event_id_1 = await store.store_event("session-123", msg1) event_id_2 = await store.store_event("session-123", msg2) event_id_3 = await store.store_event("session-123", msg3) # Replay events after event_id_1 async def on_event(event_msg): print(f"Replaying: {event_msg.message}") stream_id = await store.replay_events_after(event_id_1, on_event) # This will call on_event for msg2 and msg3, but not msg1 ``` -------------------------------- ### Execute GenieTool Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/genie-tool.md Demonstrates how to instantiate and execute a GenieTool with a custom function. ```python from databricks.labs.mcp.servers.unity_catalog.tools.genie import GenieTool tool = GenieTool( name="my_tool", description="My custom tool", input_schema={"type": "object", "properties": {}}, func=lambda client, args: [TextContent(type="text", text="result")] ) results = tool.execute() ``` -------------------------------- ### Duplicate Tool Name Conflict Example Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/errors.md Illustrates the configuration conflict when a UC function and a vector search index share the same name. ```yaml schema: - function: my_tool (UC function) - index: my_tool (vector search index) Result: Only one 'my_tool' registered ``` -------------------------------- ### Configure Application Logging Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Initialize the logger using the databricks.labs.mcp.utils module. ```python logger = logging.getLogger("databricks.labs.mcp") ``` -------------------------------- ### Configuration via .env File Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Using a .env file to define configuration variables. ```ini SCHEMA_FULL_NAME=ecommerce.products GENIE_SPACE_IDS=analytics-space,reporting-space VECTOR_SEARCH_NUM_RESULTS=20 ``` ```bash unitycatalog-mcp ``` -------------------------------- ### Configure Schema via Command-Line Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Sets the Unity Catalog schema to expose functions and vector search indexes. ```bash unitycatalog-mcp -s my_catalog.my_schema unitycatalog-mcp --schema-full-name my_catalog.my_schema ``` -------------------------------- ### List All Available Tools Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/tools-module.md Retrieves a combined list of all discovered tools using provided CLI settings. ```python from databricks.labs.mcp.servers.unity_catalog.tools import list_all_tools from databricks.labs.mcp.servers.unity_catalog.cli import get_settings settings = get_settings() all_tools = list_all_tools(settings) print(f"Total tools available: {len(all_tools)}") ``` -------------------------------- ### Initialize MCP Server Programmatically Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Use the Python API to prepare and run the MCP application using stdio transport. ```python from databricks.labs.mcp.servers.unity_catalog.tools import get_prepared_mcp_app mcp = get_prepared_mcp_app() mcp.run(transport="stdio") ``` -------------------------------- ### Run MCP Server with Inspector Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Use the MCP CLI to serve the Unity Catalog server for testing purposes. ```bash mcp-cli serve databricks.labs.mcp.servers.unity_catalog \ -s catalog.schema ``` -------------------------------- ### Initialize GenieTool Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/genie-tool.md Defines the constructor signature for creating a new GenieTool instance. ```python GenieTool( name: str, description: str, input_schema: dict, func: Callable ) ``` -------------------------------- ### Connect to MCP Server with Python Source: https://github.com/databrickslabs/mcp/blob/master/src/databricks/labs/mcp/static/index.html Establish a session with the Unity Catalog MCP server using the Databricks SDK and MCP client libraries. ```python from databricks.sdk import WorkspaceClient from mcp.client.streamable_http import streamablehttp_client as connect from mcp import ClientSession client = WorkspaceClient() async def main(): # Connect to a streamable HTTP server headers = client.config.authenticate() app_url = "https://your.app.url.databricksapps.com/api/mcp/" async with connect(app_url, headers=headers) as ( read_stream, write_stream, _, ): # Create a session using the client streams async with ClientSession(read_stream, write_stream) as session: # Initialize the connection await session.initialize() # Call a tool tool_result = await session.call_tool("echo", {"message": "hello"}) ``` -------------------------------- ### Deploying with databricks bundle CLI Source: https://github.com/databrickslabs/mcp/blob/master/examples/custom-server/README.md Configure the app command and deploy using the bundle workflow. ```yaml command: ["uvicorn", "custom_server.app:app"] ``` ```bash uv build --wheel databricks bundle deploy databricks bundle run custom-mcp-server ``` -------------------------------- ### list_all_tools(settings: CliSettings) -> List[AvailableTool] Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/tools-module.md Discovers and returns a combined list of all available tools from UC functions, vector search indexes, and Genie spaces. ```APIDOC ## list_all_tools(settings: CliSettings) -> List[AvailableTool] ### Description Discovers and returns all available tools from all sources including UC functions, vector search tools, and Genie tools. ### Parameters - **settings** (CliSettings) - Required - Configuration specifying which catalog, schema, and Genie spaces to scan. ### Returns - **List[AvailableTool]** - A combined list of all discovered tools. ### Example ```python from databricks.labs.mcp.servers.unity_catalog.tools import list_all_tools from databricks.labs.mcp.servers.unity_catalog.cli import get_settings settings = get_settings() all_tools = list_all_tools(settings) print(f"Total tools available: {len(all_tools)}") ``` ``` -------------------------------- ### Create Input Instances Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/types.md Demonstrates automatic validation of input data using Pydantic models. ```python from databricks.labs.mcp.servers.unity_catalog.tools.genie import StartConversationInput # Automatic validation input_data = StartConversationInput.model_validate({ "space_id": "space-123", "content": "What is the revenue?" }) ``` -------------------------------- ### get_serveable_app(app: Server, json_response: bool = True) -> Starlette Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-utilities.md Creates a Starlette ASGI application that wraps an MCP server for HTTP deployment, exposing the server at the /mcp/ endpoint. ```APIDOC ## get_serveable_app(app, json_response) ### Description Creates a Starlette ASGI application that wraps an MCP server for HTTP deployment. The resulting application handles MCP protocol requests and provides session management. ### Parameters - **app** (mcp.server.Server) - Required - The MCP server instance to wrap. - **json_response** (bool) - Optional - Whether to return JSON responses (default: True). ### Returns - **Starlette** - An ASGI application ready to serve MCP protocol requests at the /mcp/ endpoint. ### Example ```python from databricks.labs.mcp.base import get_serveable_app from databricks.labs.mcp.servers.unity_catalog.tools import get_prepared_mcp_app mcp_server = get_prepared_mcp_app() app = get_serveable_app(mcp_server, json_response=True) ``` ``` -------------------------------- ### Containerize with Docker Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Use this Dockerfile to package the MCP server for deployment in any environment. ```dockerfile FROM python:3.10 RUN pip install databricks-labs-mcp ENV SCHEMA_FULL_NAME=catalog.schema ENTRYPOINT ["unitycatalog-mcp"] ``` -------------------------------- ### Deploy using databricks apps CLI Source: https://github.com/databrickslabs/mcp/blob/master/README.md Commands to sync and deploy the application using the apps CLI. ```bash uv build --wheel databricks sync ./build -p /Workspace/Users/my-email@org.com/my-app databricks apps deploy my-app-name -p --source-code-path /Workspace/Users/my-email@org.com/my-app databricks apps start my-app-name -p ``` -------------------------------- ### List Available Tools Request Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md JSON-RPC request to retrieve the list of available tools. ```json { "jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {} } ``` -------------------------------- ### Deploy using databricks bundle CLI Source: https://github.com/databrickslabs/mcp/blob/master/README.md Deploys the server using the bundle CLI with required environment variables. ```bash BUNDLE_VAR_schema_full_name=catalog.schema BUNDLE_VAR_genie_space_ids=["space1","space2"] \ databricks bundle deploy -p your-profile-name ``` ```bash BUNDLE_VAR_schema_full_name=catalog.schema BUNDLE_VAR_genie_space_ids=["space1","space2"] \ databricks bundle run mcp-on-apps -p your-profile-name ``` -------------------------------- ### Manage Application Lifespan Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-utilities.md Handles the startup and shutdown lifecycle of the session manager using an async context manager. ```python @contextlib.asynccontextmanager async def lifespan(app: Starlette) -> AsyncIterator[None]: async with session_manager.run(): logger.info("Application started with StreamableHTTP session manager!") try: yield finally: logger.info("Application shutting down...") ``` -------------------------------- ### Configure Deployment URLs Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Base URLs for local development, Databricks Apps, and containerized environments. ```text http://localhost:8000/api/mcp/ ``` ```text https://{app-id}.cloud.databricks.com/api/mcp/ Authorization: Bearer {token} ``` ```text http://mcp-service:8000/api/mcp/ ``` -------------------------------- ### Connecting to the MCP Server Source: https://github.com/databrickslabs/mcp/blob/master/examples/custom-server/README.md URL format and authentication token retrieval for connecting to the deployed server. ```text https://your-app-url.usually.ends.with.databricksapps.com/mcp/ ``` ```bash databricks auth token -p ``` -------------------------------- ### Initialize UCFunctionTool Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/uc-function-tool.md Constructor signature for creating a new UCFunctionTool instance. ```python UCFunctionTool( tool_obj: dict, client: DatabricksFunctionClient, uc_function_name: str ) ``` -------------------------------- ### Initialize InMemoryEventStore Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-utilities.md Default configuration for the in-memory event store. ```python InMemoryEventStore(max_events_per_stream=100) ``` -------------------------------- ### Execute Unity Catalog MCP server Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md Run the server via console script or Python module execution. ```bash # Via console script (from pyproject.toml) unitycatalog-mcp -s my_catalog.my_schema # Via Python module python -m databricks.labs.mcp.servers.unity_catalog -s my_catalog.my_schema ``` -------------------------------- ### Initialize BaseTool Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-tool.md Constructor signature for the BaseTool class. ```python BaseTool(tool_spec: ToolSpec) ``` -------------------------------- ### Configure Unity Catalog MCP Server for Claude Desktop Source: https://github.com/databrickslabs/mcp/blob/master/README.md Add this configuration to your claude_desktop_config.json to enable the Unity Catalog MCP server using the uv package manager. ```json { "mcpServers": { "databricks_unity_catalog": { "command": "/path/to/uv/executable/uv", "args": [ "--directory", "/path/to/this/repo", "run", "unitycatalog-mcp", "-s", "your_catalog.your_schema", "-g", "genie_space_id_1,genie_space_id_2" ] } } } ``` -------------------------------- ### Define .env File Format Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md The server automatically loads configuration from a .env file in the current directory. ```ini SCHEMA_FULL_NAME=my_catalog.my_schema GENIE_SPACE_IDS=space-123,space-456 VECTOR_SEARCH_NUM_RESULTS=10 ``` -------------------------------- ### unitycatalog-mcp CLI Configuration Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md The unitycatalog-mcp CLI can be configured via command-line arguments or environment variables to define schemas, Genie spaces, and vector search parameters. ```APIDOC ## CLI Configuration ### Description Configure the MCP server using command-line flags or environment variables to enable specific features like UC functions, Genie spaces, and vector search. ### Usage `unitycatalog-mcp [options]` ### Options - **-s, --schema** (string) - Optional - The full name of the Unity Catalog schema to expose functions from. - **-g, --genie-spaces** (string) - Optional - Comma-separated list of Genie space IDs. - **-vn, --vector-num-results** (integer) - Optional - Number of results to return for vector search queries. ### Environment Variables - **SCHEMA_FULL_NAME** (string) - Equivalent to --schema - **GENIE_SPACE_IDS** (string) - Equivalent to --genie-spaces - **VECTOR_SEARCH_NUM_RESULTS** (integer) - Equivalent to --vector-num-results ``` -------------------------------- ### list_genie_tools(settings: CliSettings) -> List[GenieTool] Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/genie-tool.md Retrieves a list of all pre-configured Genie tools based on the provided CLI settings. ```APIDOC ## list_genie_tools ### Description Returns all pre-configured Genie tools based on the provided configuration settings. ### Signature `list_genie_tools(settings: CliSettings) -> List[GenieTool]` ### Parameters - **settings** (`CliSettings`) - Required - Configuration specifying which Genie spaces to expose. ### Returns - `List[GenieTool]` - A list of nine GenieTool instances. ### Example ```python from databricks.labs.mcp.servers.unity_catalog.tools.genie import list_genie_tools from databricks.labs.mcp.servers.unity_catalog.cli import get_settings settings = get_settings() tools = list_genie_tools(settings) print(f"Found {len(tools)} Genie tools") ``` ``` -------------------------------- ### Handle Missing Configuration ValueError Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/errors.md Demonstrates catching a ValueError when required CLI arguments are missing and providing the necessary configuration. ```python try: settings = CliSettings() except ValueError as e: if "At least one of" in str(e): # Provide schema or Genie space IDs settings = CliSettings(schema_full_name="catalog.schema") ``` -------------------------------- ### Execute Server as Python Module Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md Run the server directly using the Python interpreter's module execution flag. ```bash python -m databricks.labs.mcp.servers.unity_catalog [arguments] ``` -------------------------------- ### Configure CliSettings Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/types.md Defines settings for environment file loading and CLI argument parsing. ```python model_config = SettingsConfigDict( env_file=".env", env_file_encoding="utf-8", cli_parse_args=True, cli_ignore_unknown_args=True, extra="ignore", ) ``` -------------------------------- ### Environment-Based Configuration Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Configures the server using environment variables, suitable for Databricks Apps or containerized environments. ```bash # Databricks Apps or containers export SCHEMA_FULL_NAME=catalog.schema export GENIE_SPACE_IDS=space1,space2 unitycatalog-mcp ``` -------------------------------- ### Initialize VectorSearchTool Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/vector-search-tool.md Constructor definition for creating a new VectorSearchTool instance. ```python VectorSearchTool( endpoint_name: str, index_name: str, tool_name: str, columns: List[str], num_results: int = 5 ) ``` -------------------------------- ### Create a Starlette ASGI application for an MCP server Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-utilities.md Wraps an MCP server instance into a Starlette application for HTTP deployment. ```python from databricks.labs.mcp.base import get_serveable_app from databricks.labs.mcp.servers.unity_catalog.tools import get_prepared_mcp_app mcp_server = get_prepared_mcp_app() app = get_serveable_app(mcp_server, json_response=True) # Use with uvicorn # uvicorn app:app ``` -------------------------------- ### Authenticate via ~/.databrickscfg File Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Define authentication profiles in the ~/.databrickscfg file and select one using the DATABRICKS_CONFIG_PROFILE variable. ```ini [DEFAULT] host = https://your-workspace.databricks.com token = your-personal-access-token [dev] host = https://dev-workspace.databricks.com token = dev-token ``` ```bash DATABRICKS_CONFIG_PROFILE=dev unitycatalog-mcp -s catalog.schema ``` -------------------------------- ### Configure FastAPI Application Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Initializes the FastAPI app with a lifespan context manager to handle MCP session lifecycle management. ```python app = FastAPI( lifespan=lambda _: mcp.session_manager.run(), ) ``` -------------------------------- ### Configure Claude Desktop for MCP Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Add the server configuration to your claude_desktop_config.json file to enable the Unity Catalog MCP server. ```json { "mcpServers": { "databricks_unity_catalog": { "command": "uv", "args": [ "run", "unitycatalog-mcp", "-s", "catalog.schema" ] } } } ``` -------------------------------- ### Deploy MCP server to Databricks Apps Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/README.md Build the wheel and deploy the application using Databricks Asset Bundles. ```bash # Build wheel uv build --wheel # Deploy using bundle BUNDLE_VAR_schema_full_name=catalog.schema \ BUNDLE_VAR_genie_space_ids='["space1"]' \ databricks bundle deploy -p profile-name ``` -------------------------------- ### List Tools JSON-RPC Request Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Use this POST request to retrieve the list of available tools from the MCP server. ```http POST /api/mcp/ HTTP/1.1 Content-Type: application/json { "jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {} } ``` -------------------------------- ### Deploying with Starlette Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/base-utilities.md Wraps the MCP server for direct use with Starlette applications. ```python from starlette.applications import Starlette starlette_app = get_serveable_app(mcp_server) # Run with: uvicorn app:starlette_app ``` -------------------------------- ### Format and lint code Source: https://github.com/databrickslabs/mcp/blob/master/CONTRIBUTING.md Run formatting and linting tools from the repository root to ensure code quality. ```makefile make fmt # to format code make lint # to run linters ``` -------------------------------- ### List Genie tools in Python Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/genie-tool.md Retrieves all pre-configured Genie tools using the provided CLI settings. ```python from databricks.labs.mcp.servers.unity_catalog.tools.genie import list_genie_tools from databricks.labs.mcp.servers.unity_catalog.cli import get_settings settings = get_settings() tools = list_genie_tools(settings) print(f"Found {len(tools)} Genie tools") ``` -------------------------------- ### Authenticate via Environment Variables Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Provide Databricks host and token directly through environment variables. ```bash export DATABRICKS_HOST=https://your-workspace.databricks.com export DATABRICKS_TOKEN=your-personal-access-token unitycatalog-mcp -s catalog.schema ``` -------------------------------- ### Execute a similarity search with VectorSearchTool Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/vector-search-tool.md Initializes a VectorSearchTool instance and performs a similarity search using a query string. ```python from databricks.labs.mcp.servers.unity_catalog.tools.vector_search import VectorSearchTool tool = VectorSearchTool( endpoint_name="my-endpoint", index_name="my_catalog.my_schema.my_index", tool_name="vector_search_my_index", columns=["title", "content", "metadata"], num_results=10 ) results = tool.execute(query="find documents about machine learning") result_json = results[0].text # JSON string with matching documents ``` -------------------------------- ### Configuration via Environment Variables Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/configuration.md Setting environment variables before execution, noting that command-line flags override environment variables. ```bash export SCHEMA_FULL_NAME=ecommerce.products export VECTOR_SEARCH_NUM_RESULTS=15 unitycatalog-mcp -g analytics-space # -g overrides env var if provided ``` -------------------------------- ### list_uc_function_tools(settings) Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/uc-function-tool.md Discovers and creates UCFunctionTool instances for all functions within a specified catalog and schema. ```APIDOC ## list_uc_function_tools(settings) ### Description Scans the catalog and schema defined in the provided settings to discover all available Unity Catalog functions and returns them as a list of UCFunctionTool instances. ### Parameters - **settings** (CliSettings) - Required - Configuration object specifying the target catalog and schema. ### Returns - **List[UCFunctionTool]** - A list of initialized tool instances. ``` -------------------------------- ### Project File Structure Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/MANIFEST.md Visual representation of the project directory layout and documentation file organization. ```text /workspace/home/output/ ├── INDEX.md # Navigation guide ├── README.md # Main overview ├── configuration.md # Configuration reference ├── types.md # Type definitions ├── endpoints.md # HTTP API reference ├── errors.md # Error reference ├── MANIFEST.md # This file └── api-reference/ # Detailed references ├── server-entry-points.md ├── http-server-app.md ├── tools-module.md ├── base-tool.md ├── uc-function-tool.md ├── vector-search-tool.md ├── genie-tool.md ├── cli-settings.md ├── base-utilities.md └── in-memory-event-store.md ``` -------------------------------- ### Initialize CliSettings Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/cli-settings.md Constructor for the CliSettings class with optional schema and Genie space parameters. ```python CliSettings( schema_full_name: Optional[str] = None, genie_space_ids: List[str] = [], vector_search_num_results: int = 5 ) ``` -------------------------------- ### Execute a tool via tools/call Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/endpoints.md Standard request and response patterns for executing a tool, including success and error scenarios. ```json { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "vector_search_my_index", "arguments": { "query": "machine learning algorithms" } } } ``` ```json { "jsonrpc": "2.0", "id": 2, "result": [ { "type": "text", "text": "[{\"id\":1,\"title\":\"ML Basics\",\"content\":\"...\"},{\"id\":2,\"title\":\"Advanced ML\",\"content\":\"...\"}]" } ] } ``` ```json { "jsonrpc": "2.0", "id": 2, "error": { "code": -32603, "message": "Internal error", "data": { "type": "Exception", "message": "Tool not found: invalid_tool_name" } } } ``` -------------------------------- ### Retrieve Tools Dictionary Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/tools-module.md Returns a mapping of tool names to instances, handling potential duplicates by keeping one instance per name. ```python from databricks.labs.mcp.servers.unity_catalog.tools import get_tools_dict tools_by_name = get_tools_dict() print(f"Available tool names: {list(tools_by_name.keys())}") tool = tools_by_name["my_uc_function"] result = tool.execute(param1="value") ``` -------------------------------- ### Connect to MCP Server via Python Source: https://github.com/databrickslabs/mcp/blob/master/examples/custom-server/src/custom_server/static/index.html Uses the Databricks SDK and MCP streamable HTTP client to establish a session and invoke a tool on the server. ```python from databricks.sdk import WorkspaceClient from databricks_mcp import DatabricksOAuthClientProvider from mcp.client.streamable_http import streamablehttp_client as connect from mcp import ClientSession client = WorkspaceClient() async def main(): # Connect to a streamable HTTP server app_url = "https://your.app.url.databricksapps.com/mcp/" async with connect(app_url, auth=DatabricksOAuthClientProvider(client)) as ( read_stream, write_stream, _, ): # Create a session using the client streams async with ClientSession(read_stream, write_stream) as session: # Initialize the connection await session.initialize() # Call a tool tool_result = await session.call_tool("echo", {"message": "hello"}) ``` -------------------------------- ### Initialize InMemoryEventStore Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/in-memory-event-store.md Constructor for creating an instance of the in-memory event store with a configurable event limit. ```python InMemoryEventStore(max_events_per_stream: int = 100) ``` -------------------------------- ### POST /api/mcp/ (tools/call) Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Executes a specific tool by name with provided arguments. ```APIDOC ## POST /api/mcp/ ### Description Executes a tool call on the MCP server using the specified tool name and arguments. ### Method POST ### Endpoint /api/mcp/ ### Request Body - **jsonrpc** (string) - Required - Must be "2.0" - **id** (number) - Required - Request identifier - **method** (string) - Required - Must be "tools/call" - **params** (object) - Required - Contains tool execution details - **name** (string) - Required - The name of the tool to execute - **arguments** (object) - Required - Arguments for the tool ### Request Example { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "vector_search_my_index", "arguments": { "query": "search term" } } } ``` -------------------------------- ### Define StartConversationInput schema Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/genie-tool.md Schema for initiating a new conversation in a Genie space. ```python class StartConversationInput(BaseModel): space_id: str # The ID of the Genie space content: str # The text to start the conversation ``` -------------------------------- ### UCFunctionTool.execute(**kwargs) Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/uc-function-tool.md Executes a Unity Catalog function with the provided arguments and returns the result as a list of TextContent objects. ```APIDOC ## UCFunctionTool.execute(**kwargs) ### Description Executes the underlying Unity Catalog function using the provided keyword arguments. The method validates inputs against the function schema and returns the result. ### Parameters - **kwargs** (dict) - Required - Arguments matching the function's parameter schema. ### Returns - **List[TextContent]** - A list containing a single TextContent object with the execution result. ### Raises - **Exception** - If the function execution fails or returns an error status. ``` -------------------------------- ### Define CLI settings with CliSettings Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/types.md Pydantic settings class for managing command-line configuration parameters. ```python class CliSettings(BaseSettings): schema_full_name: Optional[str] = None genie_space_ids: List[str] = Field(default_factory=list) vector_search_num_results: int = Field(default=5) ``` -------------------------------- ### Access Local Server URL Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md The base URL for accessing the local development server. ```text http://localhost:8000/api/mcp/ ``` -------------------------------- ### Call Tool JSON-RPC Request Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/http-server-app.md Use this POST request to execute a specific tool by name with provided arguments. ```http POST /api/mcp/ HTTP/1.1 Content-Type: application/json { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "vector_search_my_index", "arguments": { "query": "search term" } } } ``` -------------------------------- ### Initialize InMemoryEventStore for HTTP Server Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/in-memory-event-store.md Configures the event store and integrates it with the StreamableHTTPSessionManager within a Starlette application. ```python from databricks.labs.mcp.base import InMemoryEventStore, get_serveable_app # Create the store event_store = InMemoryEventStore(max_events_per_stream=100) # Use with MCP session manager session_manager = StreamableHTTPSessionManager( app=mcp_server, event_store=event_store, json_response=True ) # Create ASGI app app = Starlette( routes=[Mount("/mcp", app=handle_streamable_http)], lifespan=lifespan ) ``` -------------------------------- ### tools/list Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/tools-module.md Retrieves a list of available tools from the MCP server. ```APIDOC ## tools/list ### Description Called by MCP clients to discover available tools registered with the server. ### MCP Method tools/list ### Response - **Returns**: List of Tool specifications (each with name, description, inputSchema) ``` -------------------------------- ### Define main function signature Source: https://github.com/databrickslabs/mcp/blob/master/_autodocs/api-reference/server-entry-points.md The main entry point function signature for the Unity Catalog MCP server. ```python def main() -> None ```