-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·87 lines (74 loc) · 2.37 KB
/
setup.sh
File metadata and controls
executable file
·87 lines (74 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
#
# Setup script for databricks-mcp-server
# Creates virtual environment and installs dependencies
#
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PARENT_DIR="$(dirname "${SCRIPT_DIR}")"
TOOLS_CORE_DIR="${PARENT_DIR}/databricks-tools-core"
echo AI Dev Kit directory: $PARENT_DIR
echo MCP Server directory: $SCRIPT_DIR
echo Tools Core directory: $TOOLS_CORE_DIR
echo "======================================"
echo "Setting up Databricks MCP Server"
echo "======================================"
echo ""
# Check for uv
if ! command -v uv &> /dev/null; then
echo "Error: 'uv' is not installed."
echo "Install it with: curl -LsSf https://astral.sh/uv/install.sh | sh"
exit 1
fi
echo "✓ uv is installed"
# Check if tools-core directory exists
if [ ! -d "$TOOLS_CORE_DIR" ]; then
echo "Error: databricks-tools-core not found at $TOOLS_CORE_DIR"
exit 1
fi
echo "✓ databricks-tools-core found"
# Create virtual environment
echo ""
echo "Creating virtual environment..."
uv venv --python 3.11
echo "✓ Virtual environment created"
# Install packages
echo ""
echo "Installing databricks-tools-core (editable)..."
uv pip install --python .venv/bin/python -e "$TOOLS_CORE_DIR" --quiet
echo "✓ databricks-tools-core installed"
echo ""
echo "Installing databricks-mcp-server (editable)..."
uv pip install --python .venv/bin/python -e "$SCRIPT_DIR" --quiet
echo "✓ databricks-mcp-server installed"
# Verify
echo ""
echo "Verifying installation..."
if .venv/bin/python -c "import databricks_mcp_server; print('✓ MCP server can be imported')"; then
echo ""
echo "======================================"
echo "Setup complete!"
echo "======================================"
echo ""
echo "To run the MCP server:"
echo " .venv/bin/python run_server.py"
echo ""
echo "To setup in the project, paste this into .mcp.json (Claude) or .cursor/mcp.json (Cursor):"
cat <<EOF
{
"mcpServers": {
"databricks": {
"command": "${PARENT_DIR}/.venv/bin/python",
"args": ["${SCRIPT_DIR}/run_server.py"]
}
}
}
EOF
echo ""
echo "To setup with Claude Code CLI:"
echo " claude mcp add-json databricks '{\"command\":\"$PARENT_DIR/.venv/bin/python\",\"args\":[\"$SCRIPT_DIR/run_server.py\"]}'"
echo ""
else
echo "Error: Failed to import databricks_mcp_server"
exit 1
fi