Skip to main content
Glama
Linear Regression MCP

Linear Regression MCP

by HeetVekariya

線形回帰MCP

線形回帰 MCPへようこそ!このプロジェクトでは、Claude とモデルコンテキストプロトコル (MCP) を使用して、エンドツーエンドの機械学習ワークフローを実証します。

Claudeは、データセットを含むCSVファイルをアップロードするだけで、線形回帰モデルを完全に自動学習できます。システムは、データの前処理、学習、評価(RMSE計算)といったMLモデルの学習ライフサイクル全体を実行できます。

セットアップとインストール

1. リポジトリのクローンを作成します。

まず、リポジトリをローカル マシンにクローンします。

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

2. uvをインストールします。

uv 、Rust で書かれた非常に高速な Python パッケージおよびプロジェクトマネージャーです。このプロジェクトにおけるサーバーと依存関係の管理に不可欠です。

  • ここからuvをダウンロードしてインストールします。

3. 依存関係をインストールします。

uv がインストールされたら、次のコマンドを実行して必要な依存関係をすべてインストールします。

uv sync

4. Claude Desktop を構成する:

サーバーを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

利用可能なツール

このプロジェクトでは、データセットの操作とモデルのトレーニングに役立つ次のツールが利用できます。

道具

説明

議論

upload_file(path)

CSV ファイルをアップロードし、処理のために保存します。

path : CSV ファイルへの絶対パス。

get_columns_info()

アップロードされたデータセット内の列名を取得します。

議論はありません。

check_category_columns()

データセット内のカテゴリ列をチェックします。

議論はありません。

label_encode_categorical_columns()

ラベルはカテゴリ列を数値にエンコードします。

議論はありません。

train_linear_regression_model(output_column)

線形回帰モデルをトレーニングし、RMSE を計算します。

output_column : ターゲット列の名前。

寄稿を募集中

このプロジェクトへの貢献を歓迎します!バグ修正、新機能の追加、ドキュメントの改善など、何でもお気軽にリポジトリをフォークしてプルリクエストを送信してください。

ご提案や機能のリクエストがある場合は、問題を報告していただければ、喜んで話し合います。

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
      -