Skip to main content
Glama
regional-ocean-debugger-mcp

regional-ocean-debugger-mcp

regional-ocean-debugger-mcp

MCP server for debugging regional ocean (MOM6 + CESM) model runs.

Combines practical log analysis tools with a searchable knowledge base of expert interview transcripts, giving an LLM agent both the ability to inspect model output files and access to domain-expert guidance.

Tools

Tool

Purpose

read_run_log(case_dir, component, lines)

Read recent CESM/MOM6 run log lines

find_errors(case_dir)

Scan all logs for FATAL/NaN/CFL/etc.

classify_error(error_text)

Match error against known MOM6 failure modes

check_obc_forcing_status(inputdir)

Check CrocoDash forcing outputs: OBC raw data + ocn/ segment files, IC, WW3 spectra in wav/, CICE forcing in ice/

read_mom6_params(case_dir, filter)

Read MOM_input + MOM_override

diff_params(case_dir_a, case_dir_b)

Compare MOM_input between two cases

check_cfl(case_dir)

Evaluate CFL stability from MOM_input timestep settings

suggest_timestep(resolution_deg)

Recommend DT and DT_THERM for a given resolution

read_diag_table(case_dir)

Parse enabled MOM6 diagnostics

suggest_diagnostics(symptoms)

Suggest useful diagnostics for a given problem

query_domain_knowledge(question)

Search expert interview knowledge base

get_parameter_advice(param_name)

Look up guidance for a specific MOM6 parameter

read_cesm_timing(case_dir)

Summarise CIME's timing/cesm_timing.* throughput/cost file

Related MCP server: log-mcp

Resources

URI

Content

ocean://case/{case_dir*}/params

MOM_input + MOM_override as KEY = VALUE (same as read_mom6_params)

ocean://case/{case_dir*}/errors

Error lines from the latest run's logs (same as find_errors)

ocean://knowledge/index

Summary of knowledge base contents

{case_dir*} takes the case path as-is, slashes included, e.g. ocean://case//glade/u/home/<user>/croc_cases/my_case/errors.

Knowledge Base

Domain knowledge comes from expert interviews on regional MOM6 modelling (private repo: AidanJanney/RegionalOceanModelingInterviews). Topics include: OBC setup, tidal forcing, bathymetry, stability, BGC, grid design, and regional ocean dynamics.

The transcripts are a git submodule in data/transcripts/. After cloning this repo:

git submodule update --init data/transcripts

Setup

pip install -e .
# with the transcripts submodule:
git submodule update --init data/transcripts

Running

regional-ocean-debugger-mcp
# or
python server.py

Add to .mcp.json:

{
  "mcpServers": {
    "ocean-debugger": {
      "command": "python",
      "args": ["/path/to/MCP_regional_ocean_debugger/server.py"]
    }
  }
}

Design

  • Stateless: reads from the filesystem per call

  • No ML dependencies: knowledge search is keyword-based (fast, transparent, works without GPU)

  • Composable: use find_errors → classify_error → query_domain_knowledge in sequence for triage

  • Private data: transcripts submodule is private; do not make public without authorisation

CESM / MOM6 paths on Derecho

Cases: ~/croc_cases/
Run dir: the case's RUNDIR (default $CIME_OUTPUT_ROOT/$CASE/run, read from env_run.xml)
MOM_input: RUNDIR/MOM_input or <case_dir>/Buildconf/momconf/MOM_input
diag_table: RUNDIR/diag_table or <case_dir>/Buildconf/momconf/diag_table

Available Tools

11 tools
check_cflA

Evaluate CFL stability condition for a MOM6 case.

Reads DT, DT_THERM, and resolution-related parameters from MOM_input. Compares against recommended safe values for the apparent resolution. Returns a stability assessment and flags potential violations.

Note: A full CFL check requires the actual grid file (dx, dy values). This tool uses MOM_input parameters as a proxy for a quick sanity check.

Inputs: case_dir (required). Returns: result

classify_errorA

Classify a MOM6/CESM error message and return probable cause and fix suggestions.

Pass a snippet of error text (e.g. from find_errors output) and get back a structured diagnosis. Matches against a library of known MOM6 failure modes.

Inputs: error_text (required). Returns: result

diff_paramsA

Compare MOM_input parameters between two CESM/MOM6 cases.

Returns parameters that differ, with values from both cases side by side. Useful for diagnosing why two configurations behave differently.

Inputs: case_dir_a (required), case_dir_b (required). Returns: result

find_errorsA

Scan all run logs in a CESM case for error indicators.

Searches for FATAL, ERROR, NaN, CFL violations, negative thickness, OOM, and similar. Returns a structured list of matches with filename, line number, and error type. Call classify_error() on the error text for probable cause and fix suggestions.

Inputs: case_dir (required). Returns: result

get_parameter_adviceA

Look up expert guidance for a specific MOM6 parameter name.

Searches the interview knowledge base for mentions of the parameter, along with context about what it does, typical values, and pitfalls.

param_name: MOM6 parameter name (e.g. 'DT', 'MINIMUM_DEPTH', 'OBC_SEGMENTS', 'SPONGE', 'TIDES', 'KD_MAX', 'KHTH').

Inputs: param_name (required). Returns: result

query_domain_knowledgeA

Search expert interview transcripts for scientific guidance on a question.

The knowledge base contains interviews with regional ocean modelling experts covering topics like: MOM6 configuration, OBC setup, tidal forcing, bathymetry, stability, BGC, grid design, known failure modes, and regional ocean dynamics.

Returns the top matching Q&A pairs from the expert interviews. top_k: number of results to return (default 5, max 10).

Inputs: question (required), top_k. Returns: result

read_diag_tableA

Read and parse the MOM6 diag_table from a CESM case.

Returns enabled diagnostics grouped by module/component. diag_table is typically in case_dir/run/ or case_dir/Buildconf/momconf/.

Inputs: case_dir (required). Returns: result

read_mom6_paramsA

Read MOM_input and MOM_override parameter files for a CESM/MOM6 case.

Returns all parameters as KEY = VALUE pairs. Pass filter to show only parameters containing that substring (e.g. 'DT', 'OBC', 'SPONGE'). MOM_override values take precedence and are marked with [override].

Inputs: case_dir (required), filter. Returns: result

read_run_logA

Return recent lines from a CESM or MOM6 run log.

component: 'cesm', 'ocn' (MOM6), 'atm', 'ice', 'rof', or 'all'. Searches case_dir and case_dir/run/ for log files. Returns the most recent match.

Inputs: case_dir (required), component, lines. Returns: result

suggest_diagnosticsA

Suggest useful MOM6 diagnostics to add to diag_table based on a description of the problem.

symptoms: describe what you're investigating (e.g. 'temperature drift', 'OBC instability', 'CFL violations', 'tidal mixing', 'BGC', 'mixed layer too shallow').

Returns a list of recommended diagnostic fields grouped by relevance.

Inputs: symptoms (required). Returns: result

suggest_timestepA

Suggest safe MOM6 timestep values (DT and DT_THERM) for a given grid resolution.

resolution_deg: approximate horizontal resolution in degrees (e.g. 0.1 for 1/10°). Returns recommended values with caveats about bathymetry and tidal forcing.

Inputs: resolution_deg (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose, ranging from CFL checks to error classification, parameter comparison, and diagnostics suggestions. No two tools overlap in functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern (e.g., check_cfl, find_errors, suggest_diagnostics) with no deviations.

    Tool Count5/5

    Eleven tools is an appropriate number for a specialized debugger, covering core tasks without being excessive or insufficient.

    Completeness4/5

    The tool set covers the main debugging workflow (error detection, classification, parameter analysis, diagnostics advice) but lacks a tool for direct parameter modification, which is a minor gap.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for intelligent log analysis providing semantic search, error pattern clustering, and smart error detection. It enables users to process, vectorize, and query local logs to efficiently identify issues and generate AI-powered summaries.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for log file analysis. Gives LLMs the ability to efficiently analyze large log files without loading them into context.
      7
      101
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for accessing SPEAR model output from various sources (AWS, STAC API, local) and integrating with AI assistants like Claude Desktop or a SPEAR Climate Chatbot.
      -