Iceberg MCP服务器-安装指南
完成带有HTTP传输支持的Iceberg MCP服务器的设置说明。
先决条件
- Python 3.10+
- 访问Cloudera数据平台 与黑斑羚
- 有效的Cloudera凭据
- 紫外线 包管理器(推荐)或pip
安装UV(如果尚未安装)
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or via pip
pip install uv安装
步骤1:克隆存储库
git clone https://github.com/genai-works-org/cloudera-mcp
cd cloudera-mcp步骤2:安装依赖项
# Sync existing project dependencies
uv sync
# Install project in editable mode
uv pip install -e .配置
步骤3:创建环境配置
创建一个 .env 项目根目录中的文件:
# Create .env file with your Cloudera credentials
cat > .env << EOF
# Cloudera Impala Configuration
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步骤4:更新配置值
编辑 .env 使用您的实际凭据文件:
对于Cloudera数据平台:
- IMPALA_HOST:您的Cloudera协调器主机名
- IMPALA_USER:您的Cloudera用户名
- IMPALA_PASSWORD:您的Cloudera密码
- IMPALA_AUTH_机制:通常
LDAPCDP
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 验证
步骤6:测试数据库连接
# Test database connectivity
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('Database connection successful')
conn.close()
except Exception as e:
print(f'Database connection failed: {e}')
"步骤7:启动MCP服务器
# Start the server
uv run python src/cloudera_mcp/server.py预期产量:
Starting Iceberg MCP Server via Impala on port 8888
Server will be available at: http://localhost:8888/
INFO: Started server process [46517]
INFO: Waiting for application startup.
[07/09/25 01:23:53] INFO StreamableHTTP session manager started streamable_http_manager.py:112
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8888 (Press CTRL+C to quit)