Skip to main content
Glama

mcp-csv-analyst

MCP server for querying and analyzing CSV files

npm version License: MIT

Give Claude (or any MCP client) the ability to load, query, filter, aggregate, and analyze CSV data.


Features

  • csv_describe - Load a CSV and get schema, row count, column types, and statistics

  • csv_filter - Filter rows by column conditions (eq, gt, lt, contains, etc.)

  • csv_aggregate - Compute sum, avg, min, max, count, median on numeric columns

  • csv_group_by - Group by a column and aggregate another

  • csv_sample - Get sample rows with offset/limit

  • csv_unique - Get unique values and their counts for any column

Quick Start

With Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "csv-analyst": {
      "command": "npx",
      "args": ["-y", "mcp-csv-analyst"]
    }
  }
}

With Claude Code

claude mcp add csv-analyst npx mcp-csv-analyst

Manual Install

npm install -g mcp-csv-analyst

Tools

csv_describe

Load a CSV file and get an overview of its structure.

Parameters:

  • file_path (string) - Absolute path to CSV file

csv_filter

Filter rows by a column condition.

Parameters:

  • file_path (string) - Path to CSV

  • column (string) - Column to filter on

  • operator (enum) - eq, neq, gt, gte, lt, lte, contains, starts_with

  • value (string) - Value to compare

  • limit (number, optional) - Max rows to return (default 50)

  • sort_by (string, optional) - Column to sort by

  • sort_dir (enum, optional) - asc or desc

csv_aggregate

Compute an aggregate on a numeric column.

Parameters:

  • file_path (string) - Path to CSV

  • column (string) - Numeric column

  • operation (enum) - sum, avg, min, max, count, median

csv_group_by

Group rows and compute an aggregate.

Parameters:

  • file_path (string) - Path to CSV

  • group_column (string) - Column to group by

  • agg_column (string) - Column to aggregate

  • operation (enum) - sum, avg, count, min, max

csv_sample

Get sample rows from a CSV.

Parameters:

  • file_path (string) - Path to CSV

  • count (number, optional) - Number of rows (default 10)

  • offset (number, optional) - Starting row offset

csv_unique

Get unique values with counts.

Parameters:

  • file_path (string) - Path to CSV

  • column (string) - Column name

  • limit (number, optional) - Max values (default 50)

Example Conversation

You: Analyze the sales data in /data/sales.csv

Claude: Let me look at the structure of your CSV first... Uses csv_describe to examine the file

The file has 10,000 rows with columns: date, product, region, quantity, price, total. Let me compute some key metrics... Uses csv_group_by to sum total by region Uses csv_aggregate to get the overall average price

License

MIT

Available Tools

6 tools
csv_aggregateB

Compute an aggregate (sum, avg, min, max, count, median) on a numeric column

NameRequiredDescriptionDefault
file_pathYesAbsolute path to the CSV file
columnYesNumeric column to aggregate
operationYesAggregation function
csv_describeB

Load a CSV file and return its schema, row count, and column statistics

NameRequiredDescriptionDefault
file_pathYesAbsolute path to the CSV file
csv_filterB

Filter CSV rows by a column condition. Returns matching rows as JSON.

NameRequiredDescriptionDefault
file_pathYesAbsolute path to the CSV file
columnYesColumn name to filter on
operatorYesComparison operator
valueYesValue to compare against
limitNoMax rows to return (default 50)
sort_byNoColumn to sort results by
sort_dirNoSort directionasc
csv_group_byC

Group rows by a column and compute an aggregate on another column

NameRequiredDescriptionDefault
file_pathYesAbsolute path to the CSV file
group_columnYesColumn to group by
agg_columnYesNumeric column to aggregate
operationYesAggregation function
csv_sampleB

Get a sample of rows from a CSV file

NameRequiredDescriptionDefault
file_pathYesAbsolute path to the CSV file
countNoNumber of sample rows (default 10)
offsetNoRow offset to start from
csv_uniqueB

Get unique values in a column with their counts

NameRequiredDescriptionDefault
file_pathYesAbsolute path to the CSV file
columnYesColumn name
limitNoMax unique values to return

Tool Schema Changelog

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

  1. 6 tool updatesv1.0.0
    • First observedcsv_aggregate
    • First observedcsv_describe
    • First observedcsv_filter
    • First observedcsv_group_by
    • First observedcsv_sample
    • First observedcsv_unique

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no ambiguity: describe for metadata, filter for row selection, sample for sampling, unique for value analysis, aggregate for column calculations, and group_by for grouped aggregations. The descriptions make it easy to differentiate between similar-sounding tools like aggregate and group_by.

Naming Consistency5/5

All tools follow a perfect 'csv_verb' pattern with consistent snake_case naming. The verbs (describe, filter, sample, unique, aggregate, group_by) are all action-oriented and clearly indicate what each tool does, creating a predictable and readable naming convention throughout.

Tool Count5/5

Six tools is an ideal number for a CSV analysis server - enough to cover essential operations without being overwhelming. Each tool serves a distinct, valuable purpose in the data analysis workflow, making the count well-scoped and appropriate for the domain.

Completeness4/5

The toolset covers most essential CSV analysis operations well: inspection (describe), filtering (filter), sampling (sample), value analysis (unique), and aggregation (aggregate, group_by). A minor gap exists in transformation operations (like sorting, merging, or column manipulation), but agents can work around this with the provided tools for core analysis tasks.

Related MCP Connectors