Skip to main content
Glama
netcdf-mcp

netcdf-mcp

by dogukanteber

NetCDF MCP Server

An MCP server that reads and understands NetCDF files, designed to give coding agents context about scientific data files.

Installation

uv pip install -e .

Related MCP server: era5-mcp-server

Usage

With Cursor/Claude

Add to your MCP configuration file (~/.cursor/mcp.json):

{
  "mcpServers": {
    "netcdf-mcp": {
      "command": "/path/to/uv",
      "args": ["run", "--directory", "/path/to/netcdf-mcp", "netcdf-mcp"]
    }
  }
}

Replace /path/to/uv with your uv binary location (e.g., /opt/homebrew/bin/uv) and /path/to/netcdf-mcp with where you cloned this repository.

Standalone

netcdf-mcp

Tools

Tool

Description

get_file_structure

Get dimensions, coordinates, variables, and attributes

list_variables

List all data variables with shapes and units

get_global_attributes

Get file-level metadata

get_variable_info

Detailed info about a specific variable

get_variable_stats

Statistical summary (min, max, mean, percentiles)

get_variable_sample

Extract sample values for inspection

get_dimension_values

Get coordinate values (time, lat, lon)

check_data_quality

Check for NaN, outliers, and suspicious patterns

compare_variables

Compare two variables for compatibility and correlation

get_time_range

Get temporal extent in human-readable format

get_spatial_bounds

Get geographic extent (lat/lon bounds)

check_cf_compliance

Verify CF conventions compliance

explain_variable

Human-readable explanation of a variable

Available Tools

13 tools
check_cf_complianceB

Check if a NetCDF file follows CF (Climate and Forecast) conventions.

Performs basic checks for common CF requirements.

Args: file_path: Path to the NetCDF file.

Returns: JSON string with compliance report.

Inputs: file_path (required). Returns: result

check_data_qualityB

Check a variable for data quality issues: NaN/missing values, outliers, suspicious patterns.

Args: file_path: Path to the NetCDF file. variable_name: Name of the variable to check.

Returns: JSON string with data quality report.

Inputs: file_path (required), variable_name (required). Returns: result

compare_variablesB

Compare two variables for shape compatibility, range differences, and correlation.

Args: file_path: Path to the NetCDF file. variable1: Name of the first variable. variable2: Name of the second variable.

Returns: JSON string with comparison results.

Inputs: file_path (required), variable1 (required), variable2 (required). Returns: result

explain_variableA

Generate a human-readable explanation of what a variable represents.

Uses standard_name, long_name, units, and other attributes.

Args: file_path: Path to the NetCDF file. variable_name: Name of the variable to explain.

Returns: JSON string with human-readable explanation.

Inputs: file_path (required), variable_name (required). Returns: result

get_dimension_valuesA

Get values along a dimension (e.g., time steps, lat/lon coordinates).

Args: file_path: Path to the NetCDF file. dimension_name: Name of the dimension/coordinate to get values for. max_values: Maximum number of values to return (default: 100).

Returns: JSON string with dimension values.

Inputs: file_path (required), dimension_name (required), max_values. Returns: result

get_file_structureA

Get the complete structure of a NetCDF file.

Returns dimensions, coordinates, data variables, and global attributes.

Args: file_path: Path to the NetCDF file.

Returns: JSON string containing the file structure.

Inputs: file_path (required). Returns: result

get_global_attributesA

Get all global attributes (metadata) from a NetCDF file.

Returns title, institution, history, conventions, and other file-level metadata.

Args: file_path: Path to the NetCDF file.

Returns: JSON string with all global attributes.

Inputs: file_path (required). Returns: result

get_spatial_boundsA

Get the geographic extent (lat/lon bounds) of a NetCDF file.

Args: file_path: Path to the NetCDF file.

Returns: JSON string with spatial bounds.

Inputs: file_path (required). Returns: result

get_time_rangeA

Get the time range of a NetCDF file in human-readable format.

Handles CF-compliant time coordinates with various calendars.

Args: file_path: Path to the NetCDF file.

Returns: JSON string with time range information.

Inputs: file_path (required). Returns: result

get_variable_infoA

Get detailed information about a specific variable in a NetCDF file.

Returns dtype, shape, dimensions, all attributes, and fill value.

Args: file_path: Path to the NetCDF file. variable_name: Name of the variable to inspect.

Returns: JSON string with detailed variable information.

Inputs: file_path (required), variable_name (required). Returns: result

get_variable_sampleA

Extract a sample of actual data values from a variable for inspection.

Args: file_path: Path to the NetCDF file. variable_name: Name of the variable to sample. max_samples: Maximum number of samples to return (default: 100).

Returns: JSON string with sample values and their indices.

Inputs: file_path (required), variable_name (required), max_samples. Returns: result

get_variable_statsA

Get statistical summary of a variable: min, max, mean, std, NaN count, percentiles.

Args: file_path: Path to the NetCDF file. variable_name: Name of the variable to analyze.

Returns: JSON string with statistical summary.

Inputs: file_path (required), variable_name (required). Returns: result

list_variablesA

List all data variables in a NetCDF file with their shapes, dtypes, and units.

Args: file_path: Path to the NetCDF file.

Returns: JSON string with variable names, shapes, dtypes, and units.

Inputs: file_path (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools have clearly distinct inspection purposes, but get_variable_stats and check_data_quality overlap in their statistical/quality reporting, and get_file_structure subsumes list_variables and get_global_attributes. Overall, descriptions are clear enough to guide correct selection.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern, using get_, list_, check_, compare_, and explain_ appropriately by action. There are no mixed naming conventions or unpredictable style shifts.

    Tool Count5/5

    Thirteen tools is well within the ideal range for a focused NetCDF inspection server. Each tool covers a distinct aspect of file exploration without feeling redundant or bloated.

    Completeness5/5

    The server provides comprehensive read-only coverage for NetCDF files: structure, variables, attributes, dimensions, spatial/time bounds, statistics, samples, quality checks, comparisons, and CF compliance. There are no obvious dead ends for typical inspection workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables exploration and analysis of NetCDF scientific data files through intuitive APIs. Supports file discovery, metadata inspection, data extraction with slicing, smart sampling for large datasets, and time series analysis.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables scientific data introspection and visualization of VTK datasets with format-adaptive metadata extraction and interactive 3D visualization through MCP tools.
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to discover and inspect research datasets via a read-only MCP server, offering search, variable listing, and metadata retrieval without reading data files.
      -