Linear Regression MCP
线性回归 MCP
欢迎来到线性回归 MCP !该项目演示了使用 Claude 和模型上下文协议 (MCP) 的端到端机器学习工作流程。
只需上传包含数据集的 CSV 文件, Claude即可自行训练线性回归模型。该系统涵盖整个机器学习模型训练生命周期,包括数据预处理、训练和评估(RMSE 计算)。
设置和安装
1.克隆存储库:
首先,将存储库克隆到本地机器:
git clone https://github.com/HeetVekariya/Linear-Regression-MCP
cd Linear-Regression-MCP2.安装uv :
uv是一个极快的 Python 包和项目管理器,用 Rust 编写。它对于管理本项目的服务器和依赖项至关重要。
从这里下载并安装
uv。
3.安装依赖项:
安装 uv 后,运行以下命令安装所有必要的依赖项:
uv sync4.配置Claude桌面:
要将服务器与 Claude Desktop 集成,您需要修改 Claude 配置文件。请按照您的操作系统的说明进行操作:
对于 macOS 或 Linux:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json对于 Windows:
code $env:AppData\Claude\claude_desktop_config.json在配置文件中,找到
mcpServers部分,并将占位符路径替换为uv安装目录和线性回归项目目录的绝对路径。如下所示:
{
"mcpServers":
{
"linear-regression":
{
"command": "ABSOLUTE/PATH/TO/.local/bin/uv",
"args":
[
"--directory",
"ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO",
"run",
"server.py"
]
}
}
}保存文件后,重新启动 Claude Desktop 以链接 MCP 服务器。
Related MCP server: MCP File Explorer
可用工具
该项目提供以下工具来帮助您处理数据集和训练模型:
工具 | 描述 | 参数 |
| 上传 CSV 文件并将其存储以供处理。 |
|
| 检索已上传数据集中的列名。 | 没有争论。 |
| 检查数据集中的任何分类列。 | 没有争论。 |
| 标签将分类列编码为数值。 | 没有争论。 |
| 训练线性回归模型并计算 RMSE。 |
|
开放贡献
欢迎大家为这个项目做出贡献!无论是修复错误、添加新功能,还是改进文档,欢迎随时 fork 代码库并提交 Pull 请求。
如果您有任何建议或功能请求,请提出问题,我很乐意讨论它们!
Available Tools
5 toolscheck_category_columnsC
This function check if data has categorical columns.
Returns: String which contains list of categorical columns.
Inputs: no named parameters.
get_columns_infoC
This function gives information about columns.
Returns: String which contains column names.
Inputs: no named parameters.
label_encode_categorical_columnsC
This function label encodes all the categorical columns.
Returns: String which confirms success of encoding process.
Inputs: no named parameters.
train_linear_regression_modelC
This function trains linear regression model.
Args: Takes input for output column name.
Returns: String which contains the RMSE value.
Inputs: output_column (required).
upload_fileC
This function read the csv data and stores it in the class variable.
Args: Absolute path to the .csv file.
Returns: String which shows the shape of the data.
Inputs: path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Most tools have distinct purposes: checking categorical columns, getting column info, label encoding, training a model, and uploading a file. However, 'check_category_columns' and 'get_columns_info' could be slightly confused as both provide column-related information, but their specific focuses (categorical vs. general) help differentiate them.
The tools use a consistent snake_case format, which is good. However, the naming pattern is mixed: some are verb_noun (e.g., 'upload_file', 'train_linear_regression_model'), while others are noun_verb (e.g., 'check_category_columns', 'get_columns_info', 'label_encode_categorical_columns'). This inconsistency in verb placement reduces predictability.
With 5 tools, the count is reasonable for a linear regression server, covering data upload, inspection, preprocessing, and model training. It's slightly thin as it lacks tools for prediction, model evaluation beyond RMSE, or data splitting, but it's well-scoped for basic workflows.
The toolset covers core steps: data upload, column analysis, encoding, and model training. However, there are notable gaps: no tools for making predictions with the trained model, evaluating model performance beyond RMSE (e.g., R-squared), splitting data into train/test sets, or handling missing values. This limits end-to-end workflow coverage.
Maintenance
Related MCP Connectors
Train AutoML models on CSV files and run predictions from Claude and other MCP clients.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- FlicenseBqualityDmaintenanceAn MCP server that provides data visualization and machine learning tools, featuring automated intent-based pipeline routing for data cleaning and model training. It enables LLMs to process CSV or JSON data to generate visual charts, perform regressions, or execute clustering analysis.16-
- AlicenseNot gradedqualityDmaintenanceA beginner MCP server that enables Claude to read local text, CSV, and Markdown files. Built as a learning project to understand how to connect AI to local file systems using the MCP protocol.ISC
- FlicenseAqualityDmaintenanceAn MCP server for dataset exploration and analysis, enabling LLM clients to perform summary, correlation, distribution, missing value analysis, data cleaning, and statistical tests directly on CSV files.3-
- AlicenseNot gradedqualityBmaintenanceAn MCP server wrapping AutoGluon's AutoML capabilities, enabling data loading, model training, prediction, evaluation, and model management.Apache 2.0