使用说明
MaxCompute MCP服务器
概述
MaxCompute的模型上下文协议(MCP)服务器。
组件
工具
服务器提供4个核心工具:
查询工具
-
get_latest_partition- 获取特定表的最新分区名称
- 输入:
table_name(string):表的名称
- 返回:最新的分区名称
-
read_query- 在MaxCompute项目上执行SELECT查询,只允许执行SELECT查询
- 输入:
query(string):SELECT SQL查询
- 返回:查询结果为对象数组
架构工具
-
list_tables- 列出MaxCompute项目中的所有表
- 无需输入
- 返回:具有名称和注释的表对象数组
-
describe_table- 获取特定表的架构信息
- 输入:
table_name(string):表的名称
- 返回:DESC命令的原始输出
从源代码构建
- 代码: GitHub
cd /path/to/maxcompute-mcp-server
uv pip install .
uv build
与Cline一起使用
# Add the server to your cline_mcp_settings.json
"mcpServers": {
"maxcompute-mcp-server": {
"command": "uv",
"args": [
"run",
"--with",
"maxcompute-mcp-server",
"maxcompute-mcp-server"
],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "",
"ALIBABA_CLOUD_MAXCOMPUTE_PROJECT": "",
"ALIBABA_CLOUD_MAXCOMPUTE_ENDPOINT": "https://service.cn-shanghai.maxcompute.aliyun.com/api"
}
}
}