Skip to main content
Glama
HeetVekariya

Linear Regression MCP

by HeetVekariya

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.

Related MCP server: MCP File Explorer

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!

Available Tools

5 tools
check_category_columnsC

This function check if data has categorical columns.

Returns: String which contains list of categorical columns.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the return type ('String which contains list of categorical columns') but lacks behavioral details: it doesn't specify what happens if no categorical columns exist, how it determines 'categorical' (e.g., based on data types or thresholds), whether it's read-only or has side effects, or error conditions. The description adds minimal value beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief (two sentences) but could be more front-loaded; the first sentence states the purpose, and the second clarifies the return. However, it's somewhat under-specified (e.g., 'data' is ambiguous) and lacks efficiency in explaining context. It avoids waste but doesn't fully earn its place with rich information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a data analysis tool with siblings), no annotations, and no output schema, the description is incomplete. It doesn't explain how the tool interacts with data (e.g., is data pre-loaded?), what format the return string is in, or error handling. For a tool in a suite with siblings like 'upload_file', more context is needed to understand its role and limitations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (though empty). The description doesn't need to compensate for missing parameter info. It appropriately doesn't discuss parameters, so it meets the baseline of 4 for zero-parameter tools by not introducing confusion.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose ('check if data has categorical columns') which is clear but vague about what 'data' refers to. It doesn't differentiate from siblings like 'get_columns_info' or 'label_encode_categorical_columns' which also work with columns. The description provides a basic verb+resource but lacks specificity about scope or context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing data loaded first), exclusions, or comparisons to sibling tools like 'get_columns_info' (which might provide broader column metadata) or 'label_encode_categorical_columns' (which processes categorical columns). Usage context is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_columns_infoC

This function gives information about columns.

Returns: String which contains column names.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool returns a string with column names, which is basic behavioral information, but doesn't disclose important traits like whether this is a read-only operation, performance characteristics, error conditions, or what format the string uses (e.g., comma-separated, JSON). For a tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and structured with a purpose statement followed by return information. However, the second sentence 'Returns: String which contains column names.' could be integrated more smoothly, and there's some redundancy in stating 'This function gives information about columns' then specifying the return. It's efficient but not perfectly polished.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple zero-parameter tool, the description is incomplete. It mentions the return is a string with column names, but doesn't explain what context or data source this applies to, how the string is formatted, or any limitations. For even a simple tool, more context about behavior and output is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100% (though trivial since there are no parameters). The description doesn't need to explain parameters, and the baseline for zero parameters is 4. No additional parameter semantics are needed or provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'gives information about columns' which is a clear purpose, but it's vague about what specific information is provided. It distinguishes from siblings like 'check_category_columns' or 'label_encode_categorical_columns' by focusing on general column information rather than specific transformations, but doesn't explicitly differentiate itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention any context, prerequisites, or comparisons to sibling tools like 'check_category_columns' which might also provide column information. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

label_encode_categorical_columnsC

This function label encodes all the categorical columns.

Returns: String which confirms success of encoding process.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions that the tool 'label encodes all the categorical columns' and returns a success confirmation string, but lacks details on behavioral traits such as what 'all' means (e.g., all columns in a dataset, all specified columns), whether it modifies data in-place or creates new output, error handling, or prerequisites. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief with two sentences, but it's not optimally structured. The first sentence states the purpose, and the second describes the return value. However, it could be more front-loaded with key details (e.g., context or behavior), and the return description is vague ('String which confirms success'). It's concise but lacks efficiency in information delivery.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a data transformation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'label encode' entails (e.g., mapping categories to integers), what happens to the encoded data (e.g., stored, returned, or modified), or how errors are handled. This leaves significant gaps for an AI agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so the schema fully documents that no inputs are required. The description doesn't need to add parameter details, but it implies the tool operates on an implicit dataset or context without specifying how that's provided. This minor gap keeps it from a perfect score, but it's largely sufficient given the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'label encodes all the categorical columns', which provides a clear verb ('label encodes') and resource ('categorical columns'). However, it doesn't differentiate from sibling tools like 'check_category_columns' or 'get_columns_info', leaving ambiguity about when to use each. The purpose is understandable but lacks sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'check_category_columns' and 'get_columns_info', it's unclear if this should be used before, after, or instead of those tools. No explicit when/when-not statements or alternative references are included.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

train_linear_regression_modelC

This function trains linear regression model.

Args: Takes input for output column name.

Returns: String which contains the RMSE value.

ParametersJSON Schema
NameRequiredDescriptionDefault
output_columnYes

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral context. It mentions training and returning RMSE, but doesn't disclose important traits like whether this is a destructive operation (overwrites existing models), computational requirements, convergence criteria, or what happens to the trained model after execution.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief (4 sentences) but not optimally structured. The 'Args' and 'Returns' sections are helpful, but the opening sentence is redundant with the tool name. The information is somewhat front-loaded but could be more efficiently organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a model training tool with no annotations, no output schema, and 0% parameter documentation in the schema, the description is inadequate. It doesn't explain what data is used for training, how features are selected, model storage/retrieval, or error conditions. The return value description ('String which contains the RMSE value') is helpful but insufficient for proper tool understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for the single parameter, the description adds minimal value. It mentions 'output column name' but doesn't explain what this column represents (predicted values? model name?), what format it should be in, or how it relates to the training process. The schema only shows it's a required string titled 'Output Column'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'trains linear regression model', which is a clear verb+resource combination. However, it doesn't distinguish this from potential sibling tools (like other model training functions) and is somewhat vague about what exactly gets trained (on what data, with what features).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites (like data preparation), when this model type is appropriate, or how it differs from other modeling approaches available in the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It states the tool reads and stores data, implying a mutation operation, but doesn't cover critical aspects like side effects (e.g., overwriting existing data), error handling, or performance considerations. This is a significant gap for a tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, with the core purpose stated first. It uses two sentences to explain the function and return value efficiently, with no wasted words. However, it could be slightly improved by integrating usage context more seamlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a data upload tool with no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on error cases, data format requirements, and how the stored data interacts with other tools. This makes it inadequate for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It specifies that the parameter is an 'Absolute path to the .csv file,' which adds meaning beyond the schema's generic 'Path' title. However, it doesn't detail format constraints or validation rules, leaving some ambiguity. Baseline 3 is appropriate as it partially compensates for the low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool reads CSV data and stores it in a class variable, which is a specific action. However, it doesn't clearly distinguish from sibling tools like 'get_columns_info' or 'check_category_columns' that might also involve data operations. The purpose is understandable but lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description mentions storing data in a class variable, but it doesn't specify prerequisites, such as needing a CSV file, or when to use it over other data-handling tools. This leaves the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updates
    • First observedcheck_category_columns
    • First observedget_columns_info
    • First observedlabel_encode_categorical_columns
    • First observedtrain_linear_regression_model
    • First observedupload_file

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 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
    -
  • F
    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.
    -
  • 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
    -