Skip to main content
Glama
Linear Regression MCP

Linear Regression MCP

by HeetVekariya

Lineare Regression MCP

Willkommen bei Linear Regression MCP ! Dieses Projekt demonstriert einen End-to-End-Workflow für maschinelles Lernen mit Claude und dem Model Context Protocol (MCP).

Claude kann ein lineares Regressionsmodell vollständig selbstständig trainieren, indem er einfach eine CSV-Datei mit dem Datensatz hochlädt. Das System durchläuft den gesamten Trainingszyklus des ML-Modells und übernimmt die Datenvorverarbeitung, das Training und die Auswertung (RMSE-Berechnung).

Setup und Installation

1. Klonen Sie das Repository:

Klonen Sie zunächst das Repository auf Ihren lokalen Computer:

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

2. Installieren Sie uv :

uv ist ein extrem schneller Python-Paket- und Projektmanager, geschrieben in Rust. Er ist für die Verwaltung des Servers und der Abhängigkeiten in diesem Projekt unerlässlich.

  • Laden Sie uv von hier herunter und installieren Sie es.

3. Abhängigkeiten installieren:

Sobald uv installiert ist, führen Sie den folgenden Befehl aus, um alle erforderlichen Abhängigkeiten zu installieren:

uv sync

4. Claude Desktop konfigurieren:

Um den Server in Claude Desktop zu integrieren, müssen Sie die Claude-Konfigurationsdatei anpassen. Folgen Sie den Anweisungen für Ihr Betriebssystem:

  • Für macOS oder Linux:

code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • Für Windows:

code $env:AppData\Claude\claude_desktop_config.json
  • Suchen Sie in der Konfigurationsdatei den Abschnitt mcpServers und ersetzen Sie die Platzhalterpfade durch die absoluten Pfade zu Ihrer uv Installation und dem Projektverzeichnis „Linear Regression“. Das Ergebnis sollte folgendermaßen aussehen:

{
    "mcpServers":
    {
        "linear-regression": 
        {
            "command": "ABSOLUTE/PATH/TO/.local/bin/uv",
            "args":
            [
                "--directory",
                "ABSOLUTE/PATH/TO/YOUR-LINEAR-REGRESSION-REPO", 
                "run",
                "server.py"
            ] 
        }
    }
}
  • Sobald die Datei gespeichert ist, starten Sie Claude Desktop neu, um eine Verbindung mit dem MCP-Server herzustellen.

Related MCP server: MCP File Explorer

Verfügbare Tools

In diesem Projekt stehen Ihnen die folgenden Tools zur Verfügung, die Sie bei der Arbeit mit dem Datensatz und beim Trainieren des Modells unterstützen:

Werkzeug

Beschreibung

Argumente

upload_file(path)

Lädt eine CSV-Datei hoch und speichert sie zur Verarbeitung.

path : Absoluter Pfad zur CSV-Datei.

get_columns_info()

Ruft die Spaltennamen im hochgeladenen Datensatz ab.

Keine Argumente.

check_category_columns()

Überprüft, ob im Datensatz kategorische Spalten vorhanden sind.

Keine Argumente.

label_encode_categorical_columns()

Label kodiert kategorische Spalten in numerische Werte.

Keine Argumente.

train_linear_regression_model(output_column)

Trainiert ein lineares Regressionsmodell und berechnet RMSE.

output_column : Der Name der Zielspalte.

Offen für Beiträge

Ich freue mich über Beiträge zu diesem Projekt! Egal, ob es um die Behebung von Fehlern, das Hinzufügen neuer Funktionen oder die Verbesserung der Dokumentation geht – Sie können das Repository gerne forken und Pull Requests einreichen.

Wenn Sie Vorschläge oder Funktionswünsche haben, öffnen Sie ein Problem und ich bespreche sie gerne!

Available Tools

5 tools
check_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

    C2.8/5.0

    Scored across 5 tools

    Disambiguation4/5

    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.

    Naming Consistency3/5

    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.

    Tool Count4/5

    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.

    Completeness3/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      An 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
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A 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
    • F
      license
      A
      quality
      D
      maintenance
      An 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
      -