Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM python:3.10-slim

# Set the working directory in the container
WORKDIR /app

# Copy requirements first to leverage Docker cache
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
# Use --no-cache-dir to reduce image size
RUN pip install --no-cache-dir -r requirements.txt

# Optional: Clean up build dependencies to reduce image size
# RUN apt-get purge -y --auto-remove build-essential

# Copy the rest of the application code into the container at /app
COPY . .

# Make port 8000 available to the world outside this container
# (MCP servers typically run on port 8000 by default)
EXPOSE 8000

# Define environment variables (these will be overridden by docker run -e flags)
ENV DATABRICKS_HOST=""
ENV DATABRICKS_TOKEN=""
ENV DATABRICKS_HTTP_PATH=""

# Run main.py when the container launches
CMD ["python", "main.py"]
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,46 @@ You can test the MCP server using the inspector by running
npx @modelcontextprotocol/inspector python3 main.py
```

## Configuring with Docker (for MCP Clients like Cursor)

If you are integrating this server with an MCP client (like Cursor), you might configure it using Docker. The client will typically manage running the Docker container based on a configuration file (e.g., `mcp.json`).

A pre-built image is available on Docker Hub and can be pulled using:
```bash
docker pull jordineil/databricks-mcp-server
```

The configuration passes environment variables directly to the Docker container. Here's an example structure, replacing placeholders with your actual credentials and using the public image name:

```json
{
"mcpServers": {
"databricks-docker": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"DATABRICKS_HOST=<your-databricks-host>",
"-e",
"DATABRICKS_TOKEN=<your-databricks-token>",
"-e",
"DATABRICKS_HTTP_PATH=<your-databricks-http-path>",
"jordineil/databricks-mcp-server"
]
}
// ... other servers ...
}
}
```

- Replace `<your-databricks-host>` with your Databricks host (e.g., `dbc-xyz.cloud.databricks.com`).
- Replace `<your-databricks-token>` with your personal access token.
- Replace `<your-databricks-http-path>` with the HTTP path for your SQL warehouse.

This method avoids storing secrets directly in a `.env` file within the project, as the MCP client injects them at runtime.

## Available MCP Tools

The following MCP tools are available:
Expand Down
Loading