Linear Regression
About
Train a Linear Regression model by uploading a CSV dataset file, demonstrating an end-to-end machine learning workflow.
Details
- Author
- heetvekariya
- Repository
- HeetVekariya/Linear-Regression-MCP
- GitHub stars
- 12
- Downloads
- 407
- Categories
- AI, Project Management, Developer Tools, Other
- Tags
- #data-analysis
Jump to
- End-to-end ML model training lifecycle with Claude.
- Upload any CSV dataset for automatic processing.
- Automatic categorical column label encoding.
- RMSE-based evaluation after training.
- Tools to inspect column info and data types.
- Open-source and welcomes contributions.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Linear RegressionCommand (node, npx, python, etc.)ABSOLUTE/PATH/TO/.local/bin/uvArguments-
Argument 1
--directory -
Argument 2
ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO -
Argument 3
run -
Argument 4
server.py
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
Argument 1
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
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.
Once uv is installed, run the following command to install all necessary dependencies:
uv sync
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.
<br>
upload_file
Uploads a CSV file and stores it for processing. Parameters: path (string) - Absolute path to the CSV file.
get_columns_info
Retrieves the column names in the uploaded dataset. Parameters: None.
check_category_columns
Checks for any categorical columns in the dataset. Parameters: None.
label_encode_categorical_columns
Label encodes categorical columns into numerical values. Parameters: None.
train_linear_regression_model
Trains a linear regression model and calculates RMSE. Parameters: output_column (string) - The name of the target column.
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. |
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"linear regression": {
"cwd": null,
"env": {},
"args": [
"--directory",
"ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO",
"run",
"server.py"
],
"shell": false,
"command": "ABSOLUTE/PATH/TO/.local/bin/uv"
}
}
}
Linux
{
"cwd": null,
"env": [],
"args": [
"--directory",
"ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO",
"run",
"server.py"
],
"shell": false,
"command": "ABSOLUTE/PATH/TO/.local/bin/uv"
}
Macos
{
"cwd": null,
"env": [],
"args": [
"--directory",
"ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO",
"run",
"server.py"
],
"shell": false,
"command": "ABSOLUTE/PATH/TO/.local/bin/uv"
}
Windows
{
"cwd": null,
"env": [],
"args": [
"--directory",
"ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO",
"run",
"server.py"
],
"shell": false,
"command": "ABSOLUTE/PATH/TO/.local/bin/uv"
}
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).
<br>
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.
<br>
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!
<h3 align="center">👀</h3>
<p align="center">
<a href="https://github.com/HeetVekariya" target="_blank">
</a>
<a href="https://twitter.com/heet_2104" target="_blank">
</a>
<a href="https://www.linkedin.com/in/heet-vekariya-16326024b" target="_blank">
</a>
<a href="https://medium.com/@heetvekariya50" target="_blank">
</a>
<a href="https://dev.to/heetvekariya" target="_blank">
</a>
<a href="mailto:heetvekariya50@gmail.com" target="_blank">
</a>
</p>
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




