Hosts the NetCDF Explorer MCP Server repository, providing source code access and issue tracking for the server that enables exploration and analysis of NetCDF scientific data files
Distributes the nc-mcp package, allowing installation of the NetCDF Explorer MCP Server for scientific data file analysis and exploration
Provides the testing framework for the NetCDF Explorer MCP Server, enabling verification of file discovery, data extraction, and NetCDF structure parsing functionality
NetCDF Explorer MCP Server
A simple and powerful MCP (Message Communication Protocol) server for exploring, analyzing, and interacting with NetCDF format files. Designed to simplify NetCDF data management with intuitive APIs and efficient data handling.
Overview
NetCDF (Network Common Data Form) is a widely used format for storing scientific data. This MCP server provides a streamlined interface to work with NetCDF files, offering essential functionalities to list files, inspect structures, extract data, and analyze variables—all while handling large datasets efficiently through smart sampling.
Features
- 📁 File Discovery: List all NetCDF files (
.nc
,.cdf
,.netcdf
,.nc4
) in a specified directory. - 🔍 Structure Inspection: Retrieve detailed metadata of NetCDF files, including dimensions, variables, attributes, and global properties.
- 📊 Data Extraction: Read variable data with support for flexible slicing (e.g.,
lat: "0:10:2"
to extract subsets). - 🧠 Smart Sampling: Automatically sample large datasets to prevent memory overflow, with configurable element limits.
- ⏰ Time Series Analysis: Extract temporal data from spatial variables, with optional custom location coordinates.
- 🔎 Search Functionality: Find variables and attributes by keyword, simplifying navigation in complex files.
- 📋 Variable Summaries: Generate human-readable summaries of variables, including dimensions, data types, and attributes.
Installation
Prerequisites
- Python ≥ 3.13
Install via pip
Install from Source
- Clone the repository:
- Install dependencies (using
uv
for faster dependency management):
Quick Start
Start the Server
API Reference
Core Functions
Function | Description | Parameters |
---|---|---|
list_netcdf_files | Lists all NetCDF files in a directory. | directory (str): Path to search (default: . ). |
get_netcdf_info | Returns metadata and structure of a NetCDF file (dimensions, variables, attributes). | file_path (str): Path to the NetCDF file. |
get_variable_data | Extracts data from a specific variable (supports slicing and sampling). | file_path (str), variable_name (str), slices (dict, optional), max_elements (int, default: 1000). |
search_variables | Searches variables and attributes for a keyword (case-insensitive). | file_path (str), search_term (str). |
extract_timeseries | Extracts time series data from a spatial variable. | file_path (str), variable_name (str), location (dict, optional: spatial coordinates like {"lat": 10, "lon": 20} ). |
Testing
Run the test suite to verify functionality:
Tests cover:
- File discovery logic
- NetCDF structure parsing
- Data extraction with slicing
- Sampling for large datasets
- Error handling for invalid inputs
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Links
- Homepage: https://github.com/HanchaoLi/nc-mcp
- Repository: https://github.com/HanchaoLi/nc-mcp
- Issue Tracker: https://github.com/HanchaoLi/nc-mcp/issues
- PyPI: https://pypi.org/project/nc-mcp/
Author
John Li
This server cannot be installed
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.
Related MCP Servers
- AsecurityAlicenseAqualityEnables autonomous data exploration on .csv-based datasets, providing intelligent insights with minimal effort.Last updated -2475MIT License
- -securityAlicense-qualityA feature-rich NASA data query tool that supports various NASA API services including astronomy pictures, Mars rover photos, Earth satellite images, near-Earth objects data, and space weather information through natural language queries.Last updated -22MIT License
- -securityFlicense-qualityEnables users to preprocess, analyze, and visualize CSV data through comprehensive tools for data manipulation, statistical analysis, and graph generation.Last updated -2
- AsecurityAlicenseAqualityExposes Cloudflare DNS, security, redirects and zone-settings functionality as structured tools that AI assistants like Claude Desktop can invoke directly.Last updated -18MIT License