返回市场
最大计算-MCP服务器

最大计算-MCP服务器

作者:datafe2 星标更新:2025-04-28

项目介绍

MaxCompute MCP Server

概述

MaxCompute的模型上下文协议(MCP)服务器。

组件

工具

该服务器提供4个核心工具:

查询工具

  • get_latest_partition

    • 获取特定表的最新分区名称
    • 输入:
      • table_name (字符串):表名
    • 返回值:最新的分区名称
  • read_query

    • 在MaxCompute项目上执行SELECT查询,仅允许SELECT查询
    • 输入:
      • query (字符串):SELECT SQL查询
    • 返回值:作为对象数组的查询结果

架构工具

  • list_tables

    • 列出MaxCompute项目中的所有表
    • 不需要输入
    • 返回值:带有名称和注释的表对象数组
  • describe_table

    • 获取特定表的架构信息
    • 输入:
      • table_name (字符串):表名
    • 返回值:DESC命令的原始输出

从源码构建

cd /path/to/maxcompute-mcp-server
uv pip install .
uv build

使用Cline

  • MaxCompute端点可以在endpoint中查看

  • MaxCompute项目可以在projects中查看

# 将服务器添加到您的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"
    }
  }
}