Feature Engineering MCP Server
特征工程 MCP 服务器
一个 MCP(模型上下文协议)服务器,将现有的
ahutosh173/automated-feature-engineering LangGraph 代理作为可复用工具暴露出来。
原始代理接收一个 CSV、欺诈/作案手法目标、模式元数据、 ID 列和标签列,然后:
分析建模目标,
提出候选特征,
生成 pandas 特征工程代码,
执行该代码,以及
写入一个 Excel 特征文件。
本项目在该工作流之上增加了 MCP 接口。
架构
MCP Host / LLM Client
|
| MCP
v
+-----------------------+
| Feature Engineering |
| MCP Server |
+-----------+-----------+
|
+-----------+-----------+
| |
v v
Dataset profiling Existing LangGraph
Feature Engineering Agent
|
+--------------+--------------+
| | |
Analyze MO Propose features Generate code
|
v
Execute features
|
v
Excel outputRelated MCP server: skillsmcp
MCP 工具
工具 | 用途 |
| 在运行代理之前检查 CSV |
| 运行完整的现有 LangGraph 代理 |
| 运行代理并返回其分析、候选特征和生成的代码 |
| 验证服务器配置 |
重要的设计决策
MCP 层不会替换现有代理。
它是现有代理之上的一个适配器,以便兼容 MCP 的主机可以 将特征工程工作流作为工具来发现和调用。
原始仓库位于:
https://github.com/ahutosh173/automated-feature-engineering
1. 前置条件
Python 3.10+
Git
可访问原始特征工程代理仓库
原始代理所需的 LLM 配置
MCP Python SDK 目前需要 Python 3.10+。
2. 克隆两个仓库
推荐的目录布局:
projects/
├── automated-feature-engineering/
└── feature-engineering-mcp/克隆原始仓库:
git clone https://github.com/ahutosh173/automated-feature-engineering.git克隆本仓库:
git clone <YOUR-MCP-REPO-URL>3. 创建虚拟环境
从本仓库开始:
python -m venv .venvWindows:
.venv\Scripts\activateLinux/macOS:
source .venv/bin/activate安装依赖:
pip install -r requirements.txt安装原始代理的依赖:
pip install -r ../automated-feature-engineering/requirements.txt4. 配置原始代理
原始仓库目前需要自己的 .env 配置,
包括 HF_TOKEN。
按照其 README 中的描述准确配置该仓库。
不要提交 API 密钥或令牌。
5. 配置此 MCP 服务器
复制:
cp .env.example .envWindows PowerShell:
Copy-Item .env.example .env设置:
FEATURE_ENGINEERING_REPO=../automated-feature-engineering如果这两个仓库在其他位置,请使用绝对路径。
示例:
FEATURE_ENGINEERING_REPO=C:/projects/automated-feature-engineering6. 运行 MCP 服务器
用于本地 stdio 使用:
python server.py该进程将等待 MCP 客户端通过 stdin/stdout 连接。
用于 MCP Inspector 开发:
mcp dev server.py官方 MCP Python SDK 提供 Inspector 开发工作流,并支持直接从类型化的 Python 函数定义工具。
7. 无需外部 MCP 主机进行测试
运行:
pytest -q测试使用 MCP Python 客户端的内存连接,因此测试 MCP 工具定义,而无需启动子进程。
示例:分析数据集
MCP 客户端可以调用:
{
"name": "profile_dataset",
"arguments": {
"csv_path": "../automated-feature-engineering/data/train.csv"
}
}示例响应:
{
"success": true,
"rows": 10000,
"columns": 25,
"columns_info": [
{
"name": "amount",
"dtype": "float64",
"missing": 0,
"missing_pct": 0.0,
"unique": 9000
}
]
}示例:运行代理
{
"name": "run_feature_engineering",
"arguments": {
"csv_path": "../automated-feature-engineering/data/train.csv",
"mo_name": "Fraud Detection",
"mo_description": "Identify fraudulent transactions based on account behavior",
"data_schema": [
{
"name": "txn_id",
"dtype": "object",
"description": "Transaction ID"
},
{
"name": "amount",
"dtype": "float64",
"description": "Transaction amount"
}
],
"id_column": "txn_id",
"label_column": "fraud"
}
}为什么在这里使用 MCP 很有用
没有 MCP 时,特征工程工作流主要是一个 Python 应用程序。
有了 MCP,兼容 MCP 的主机可以发现特征工程工具,并决定何时调用它们。
例如:
User:
"Analyze my fraud dataset and create account-level features."
LLM:
-> profile_dataset
-> run_feature_engineering
-> inspect result
-> explain generated features安全说明
原始代理使用 LLM 生成 Python 代码,并使用
exec() 执行该代码。如果不受信任的模型输出或不受信任的
用户能够访问服务器,这是一项高风险操作。
对于生产环境:
在隔离的容器中运行代理,
使用受限的文件系统,
验证生成的代码,
限制导入,
限制输入/输出路径,
使用资源与 CPU/时间限制,
不要暴露任意的文件系统访问,
在远程部署之前添加认证/授权。
本仓库有意不声称现有的生成代码执行是生产安全的。
建议的后续升级
添加特征评估工具。
添加模型性能比较。
添加特征血缘元数据。
在生成代码执行之前添加审批/审查。
添加 Streamable HTTP 部署。
添加认证。
添加 LangGraph 检查点/会话 ID,而不是原始工作流使用的固定线程 ID。
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
MCP facade over the Nebelus Construction API. ~48 tools give full agent build parity: create/update/probe agents, edit graphs, attach knowledge and vector stores, wire connectors, set governance policies and locked guardrails, enable grounding-trace, and read deployment wiring. Purpose-built for regulated industries: data residency is enforced per region (EU / GCC-KSA), with PII controls and an audit trail. Agents are created as drafts — no deploy tool is exposed over MCP by design; publishing happens in the Nebelus console.
Hosted MCP runtime where your agent publishes its own tools by tool call and keeps working.
Related MCP Servers
- AlicenseAqualityCmaintenanceExposes Great Expectations data-quality checks as MCP tools for LLM agents, enabling data loading, expectation definition, validation, and result interpretation.74MIT
- AlicenseAqualityDmaintenanceExposes Agent Skills to AI agents as MCP tools, enabling discovery and activation of skill instructions for coding agents.327MIT
- FlicenseAqualityDmaintenanceExposes two MCP tools (discover and execute) that enable agents to query an OpenAPI schema via natural language and execute matched API operations.2-
- FlicenseNot gradedqualityDmaintenanceExposes task management (add, list, complete tasks) and document search (RAG) as MCP tools for AI agents.-