mcpField
M
Mage.ai MCP Integration

Mage.ai MCP Integration

本地服务
github.com/KhushiBaby开发工具380 周前更新

关于 Mage.ai MCP Integration

Mage.ai MCP Integration 将 AI 助手连接到 Mage.ai 数据管道,支持通过 MCP 浏览、编辑、创建和执行管道及其组件。

主要功能

  1. 01浏览管道和组件
  2. 02读取并编辑组件代码
  3. 03运行管道或单个组件
  4. 04按名称、类型或内容搜索组件
  5. 05创建管道和组件

适用场景

  1. 01检查 Mage.ai 管道及其组件
  2. 02修改组件代码并执行
  3. 03查找符合查询条件的组件

MCP 相关

向 MCP 客户端提供 Mage.ai 管道资源和工具,支持浏览、编辑、创建、搜索与执行操作。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

Mage.ai MCP 集成

一个全面的 Mage.ai 模型上下文协议(MCP)集成,让 Anthropic 的 Claude 等 AI 助手能够高效地处理 Mage 数据流水线。

功能

  • 浏览流水线:探索所有 Mage.ai 流水线及其组件
  • 查看和编辑代码:读取和修改区块代码
  • 执行流水线:运行整个流水线或单个区块
  • 搜索功能:按名称、类型或内容查找区块
  • 创建流水线:从头创建新流水线和区块

安装

# Clone the repository
git clone https://github.com/yourusername/mage-mcp.git
cd mage-mcp

# Install dependencies
pip install -r requirements.txt

配置

可以通过环境变量或命令行参数配置服务:

  • MAGE_API_URL:Mage.ai API 的 URL(默认值:http://localhost:6789/api/)
  • MAGE_API_KEY:用于身份验证的 API 密钥(如有要求)

创建 .env 文件以保存持久配置:

MAGE_API_URL=http://localhost:6789/api/
MAGE_API_KEY=your_api_key_if_needed

使用方法

运行服务

使用提供的脚本启动 MCP 服务:

# Using stdio transport (default)
python run_server.py

# Using SSE transport
python run_server.py --transport sse --host localhost --port 3000

# Additional options
python run_server.py --api-url http://your-mage-instance:6789/api/ --api-key your_key --debug
使用 Claude Desktop 安装

为获得最佳体验,请直接通过 Claude Desktop 安装此服务:

# Using mcp CLI
mcp install run_server.py --name "Mage.ai Manager"

# With environment variables
mcp install run_server.py -v MAGE_API_URL=http://localhost:6789/api/ -v MAGE_API_KEY=your_key
开发模式

用于测试和开发:

mcp dev run_server.py

MCP 资源和工具

资源
  • mage://pipelines - 列出所有流水线
  • mage://pipelines/{pipeline_uuid} - 获取流水线详情
  • mage://pipelines/{pipeline_uuid}/blocks - 列出流水线中的区块
  • mage://pipelines/{pipeline_uuid}/blocks/{block_uuid} - 获取区块详情
  • mage://pipelines/{pipeline_uuid}/blocks/{block_uuid}/content - 获取区块代码
  • mage://pipelines/{pipeline_uuid}/content - 获取整个流水线的内容
  • mage://pipelines/{pipeline_uuid}/execution - 获取流水线执行详情
  • mage://blocks/search/{query} - 按名称、类型或内容搜索区块
工具
  • list_all_pipelines() - 列出所有流水线及其详情
  • get_pipeline_details(pipeline_uuid) - 获取流水线信息
  • list_pipeline_blocks(pipeline_uuid) - 列出流水线中的区块
  • get_block_content(pipeline_uuid, block_uuid) - 获取区块代码
  • create_pipeline(name, description, pipeline_type) - 创建新流水线
  • create_block(pipeline_uuid, name, block_type, language, content, upstream_blocks) - 创建区块
  • update_block_content(pipeline_uuid, block_uuid, content) - 更新区块代码
  • execute_pipeline(pipeline_uuid) - 运行流水线
  • execute_block(pipeline_uuid, block_uuid) - 运行指定区块
  • get_pipeline_code(pipeline_uuid) - 获取完整的流水线代码

交互示例

User: Show me all the pipelines in Mage.ai.
Claude: Let me check what pipelines are available in your Mage.ai instance.

[Lists all pipelines with descriptions and types]

User: Can you show me the blocks in the data_ingestion pipeline?
Claude: Here are all the blocks in the data_ingestion pipeline:

[Lists all blocks with their types, languages, and status]

User: I need to modify the 'transform_data' block to fix a bug.
Claude: Let me help you with that. First, let's look at the current code:

[Shows the current block code]

Here's how we can fix the bug:
[Explains the issue and suggests changes]

Would you like me to update the block with these changes?

User: Yes, please update it.
Claude: I've updated the block. Here's the new content:

[Shows the updated code]

The changes have been saved successfully.

参与贡献

欢迎贡献!请随时提交 Pull Request。

许可证

本项目采用 MIT 许可证,详情请参阅 LICENSE 文件。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。