Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

Linear-Regression-MCP

MCP.Pizza Chef: HeetVekariya

Linear-Regression-MCP is an MCP server that enables automated training of linear regression models using uploaded CSV datasets. It manages the full machine learning lifecycle including data preprocessing, model training, and evaluation with RMSE calculation. Designed to work seamlessly with Claude and other LLMs, it simplifies ML workflows by integrating model training directly into the MCP ecosystem.

Use This MCP server To

Train linear regression models from CSV datasets automatically Preprocess data for linear regression model training Evaluate model performance using RMSE metric Integrate ML model training into MCP-based AI workflows Enable LLMs to perform end-to-end ML training tasks Automate dataset ingestion and model lifecycle management

README

Linear Regression MCP

Welcome to Linear Regression MCP! This project demonstrates an end-to-end machine learning workflow using Claude and the Model Context Protocol (MCP).

Claude can train a Linear Regression model entirely by itself, simply by uploading a CSV file containing the dataset. The system goes through the entire ML model training lifecycle, handling data preprocessing, training, and evaluation (RMSE calculation).


Setup and Installation

1. Clone the Repository:

First, clone the repository to your local machine:

git clone https://github.com/HeetVekariya/Linear-Regression-MCP
cd Linear-Regression-MCP

2. Install uv:

uv is an extremely fast Python package and project manager, written in Rust. It is essential for managing the server and dependencies in this project.

  • Download and install uv from here.

3. Install Dependencies:

Once uv is installed, run the following command to install all necessary dependencies:

uv sync

4. Configure Claude Desktop:

To integrate the server with Claude Desktop, you will need to modify the Claude configuration file. Follow the instructions for your operating system:

  • For macOS or Linux:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • For Windows:
code $env:AppData\Claude\claude_desktop_config.json
  • In the configuration file, locate the mcpServers section, and replace the placeholder paths with the absolute paths to your uv installation and the Linear Regression project directory. It should look like this:
{
    "mcpServers":
    {
        "linear-regression": 
        {
            "command": "ABSOLUTE/PATH/TO/.local/bin/uv",
            "args":
            [
                "--directory",
                "ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO", 
                "run",
                "server.py"
            ] 
        }
    }
}
  • Once the file is saved, restart Claude Desktop to link with the MCP server.

Available Tools

The following tools are available in this project to help you work with the dataset and train the model:

Tool Description Arguments
upload_file(path) Uploads a CSV file and stores it for processing. path: Absolute path to the CSV file.
get_columns_info() Retrieves the column names in the uploaded dataset. No arguments.
check_category_columns() Checks for any categorical columns in the dataset. No arguments.
label_encode_categorical_columns() Label encodes categorical columns into numerical values. No arguments.
train_linear_regression_model(output_column) Trains a linear regression model and calculates RMSE. output_column: The name of the target column.

Open for Contributions

I welcome contributions to this project! Whether it's fixing bugs, adding new features, or improving the documentation, feel free to fork the repository and submit pull requests.

If you have any suggestions or feature requests, open an issue, and I'll be happy to discuss them!

👀

Github Twitter LinkedIn Medium Dev.to Dev.to

Linear-Regression-MCP FAQ

How do I upload my dataset for training?
Upload a CSV file containing your dataset to the server; it handles preprocessing automatically.
What machine learning lifecycle stages does this server cover?
It covers data preprocessing, model training, and evaluation including RMSE calculation.
Which LLMs can interact with this MCP server?
It is designed to work with Claude, and can also integrate with OpenAI and Gemini models.
What dependencies are required to run this server?
You need to install 'uv', a fast Python package manager, along with the project dependencies.
Can this server handle datasets of any size?
It is optimized for typical CSV datasets; very large datasets may require additional resources.
How is model evaluation performed?
The server calculates the Root Mean Square Error (RMSE) to evaluate model accuracy.
Is this server suitable for real-time model training?
It is designed for batch training workflows rather than real-time streaming data.
How do I get started with this MCP server?
Clone the GitHub repo, install 'uv', then install dependencies and run the server.