CDM MCP服务器
一种基于FastAPI的服务,使AI助手能够通过Spark与存储在MinIO中的Delta Lake表进行交互,实现自然语言数据操作的模型上下文协议(MCP)。
⚠️ 重要警告: 此服务允许任意 read-oriented 对Delta Lake表执行的查询。除非您在本地托管模型,否则查询结果将发送到模型宿主服务器。❌ 此外,这项服务是 非 批准部署到任何生产环境,包括CI,直到KBase领导层明确批准。仅限于当地开发或评估目的。
文档
有关详细文档,请参阅 用户指南.本指南包括:
- MCP配置 -创建 mcp.json - MCP主机设置 -配置MCP主机 - 示例提示 -自然语言示例
快速开始
- 克隆存储库:
git clone https://github.com/kbase/cdm-mcp-server.git
cd cdm-mcp-server- 创建所需目录:
mkdir -p cdr/cdm/jupyter/cdm_shared_workspace- 创建Docker网络:
docker network create cdm-jupyterhub-network- 启动服务:
docker-compose up -d --build- 访问服务:
- MCP服务器:http://localhost:8000/docs - MinIO控制台:http://localhost:9003 - Spark Master用户界面:http://localhost:8090 - JupyterHub:http://localhost:4043
测试
# Install dependencies (only required on first run or when the uv.lock file changes)
uv sync --locked
# Run tests
PYTHONPATH=. uv run pytest tests
# Run with coverage
PYTHONPATH=. uv run pytest --cov=src tests/