包含支持HTTP传输的Iceberg MCP Server的完整安装说明。
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# 或通过pip安装
pip install uv
git clone https://github.com/genai-works-org/cloudera-mcp
cd cloudera-m
# 同步现有项目依赖项
uv sync
# 在可编辑模式下安装项目
uv pip install -e .
在项目根目录中创建一个.env文件:
# 使用您的Cloudera凭据创建.env文件
cat > .env << EOF
# Cloudera Impala 配置
IMPALA_HOST=your-coordinator-host.cloudera.site
IMPALA_PORT=443
IMPALA_USER=your-username
IMPALA_PASSWORD=your-password
IMPALA_DATABASE=default
IMPALA_AUTH_MECHANISM=LDAP
IMPALA_USE_HTTP_TRANSPORT=true
IMPALA_HTTP_PATH=cliservice
IMPALA_USE_SSL=true
EOF
使用实际凭据编辑.env文件:
对于Cloudera Data Platform:
LDAP从JDBC连接字符串示例:
jdbc:impala://coordinator-xyz123.dw-xyz123.cloudera.site:443/default;AuthMech=3;transportMode=http;httpPath=cliservice;ssl=1;UID=myuser;PWD=mypass
转换为:
IMPALA_HOST=coordinator-xyz123.dw-xyz123.cloudera.site
IMPALA_PORT=443
IMPALA_USER=myuser
IMPALA_PASSWORD=mypass
IMPALA_AUTH_MECHANISM=LDAP
# 测试数据库连接
uv run python -c "
import os
from dotenv import load_dotenv
load_dotenv()
from cloudera_mcp.tools.impala_tools import get_db_connection
try:
conn = get_db_connection()
print('数据库连接成功')
conn.close()
except Exception as e:
print(f'数据库连接失败: {e}')
"
# 启动服务器
uv run python src/cloudera_mcp/server.py
预期输出:
正在通过Impala在端口8888上启动Iceberg MCP Server
服务器将在以下地址可用: http://localhost:8888/
INFO: 已启动服务器进程 [46517]
INFO: 正在等待应用程序启动。
[07/09/25 01:23:53] INFO StreamableHTTP会话管理器已启动 streamable_http_manager.py:112
INFO: 应用程序启动完成。
INFO: Uvicorn正在运行于 http://127.0.0.1:8888 (按CTRL+C退出)