NetCDF

A MCP Server for NetCDF format file
  • python

1

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "hanchaoli-nc-mcp": {
      "command": "python",
      "args": [
        "-m",
        "nc_mcp_server.main"
      ]
    }
  }
}

You run a lightweight MCP server to explore, inspect, and interact with NetCDF files. It provides straightforward commands to discover files, inspect metadata, extract variable data with slicing, and analyze time series, all while handling large datasets efficiently.

How to use

You interact with the server through an MCP client. Use the available core functions to perform common tasks against NetCDF files. You can list all NetCDF files in a directory, inspect a file’s structure and metadata, extract data from a specific variable with slicing, search for variables or attributes by keyword, and extract time-series data from spatial variables.

How to install

Prerequisites: Python 3.13 or newer.

pip install nc-mcp

Install from source (optional) to run the server directly from the repository.

# 1) Clone the repository
git clone https://github.com/HanchaoLi/nc-mcp.git
cd nc-mcp

# 2) Install dependencies (uses uvx for fast dependency management if you have it)
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# 3) Sync dependencies
uv sync --all-groups

Quick start to run the server from the package.

python -m nc_mcp_server.main

Configuration and usage notes

The server exposes a simple Python interface for common NetCDF operations. Typical workflows include listing NetCDF files in a directory, retrieving file structure metadata, extracting variable data with optional slices, and performing time-series analysis.

Troubleshooting and tips

  • Ensure you are using Python 3.13 or later. - If the server fails to start, verify that the module path nc_mcp_server.main exists in your environment. - When extracting data, consider applying sampling or slicing to avoid large memory usage.

Available tools

list_netcdf_files

Lists all NetCDF files in a directory (supported extensions: .nc, .cdf, .netcdf, .nc4).

get_netcdf_info

Returns metadata and structure of a NetCDF file, including dimensions, variables, and attributes.

get_variable_data

Extracts data from a specific variable with optional slicing and sampling to manage memory usage.

search_variables

Searches for keywords across variables and attributes (case-insensitive).

extract_timeseries

Extracts time-series data from a spatial variable, with optional location coordinates.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational