Corrosion Engineering MCP Server
Physics-Based Corrosion Rate Prediction via Model Context Protocol
Overview
Corrosion Engineering MCP Server is a FastMCP-based toolkit that provides AI agents with access to physics-based corrosion engineering calculations, ranging from rapid handbook lookups to mechanistic electrochemical models with dual-tier pitting assessment.
Current Status: Version 0.3.0 (2025-12-15)
✅ 348 tests passing (100% coverage)
✅ 14 MCP tools with
corrosion_prefix✅ Production Ready: All critical bugs fixed
See IMPLEMENTATION_ROADMAP.md for implementation history.
Quick Start
Installation
MCP Configuration
Add to Claude Desktop config (.mcp.json):
Full configuration guide: MCP_CONFIGURATION.md
Phase 3 Highlights: Dual-Tier Pitting Assessment
What's New
Tier 1 + Tier 2 Pitting Assessment: Combines fast empirical screening (PREN/CPT) with mechanistic electrochemical assessment (E_pit vs E_mix).
Example (SS316 in seawater):
Key Insight: CPT test (ferric chloride, saturated) is conservative. Tier 2 provides mechanistic driving force (ΔE = E_mix - E_pit) accounting for actual dissolved oxygen.
Codex UX Improvements ✅
Self-describing Tier 2 unavailability:
electrochemical_interpretationexplains WHY (not justnull)RedoxState warnings surfaced: DO saturation, anaerobic conditions appended to interpretation
Material alias mapping: 316L, 316, UNS S31600 → SS316 (6 aliases supported)
Tier disagreement detection: Automatic warning when Tier 1 ≠ Tier 2 with guidance
Full user guide: docs/TIER1_VS_TIER2_PITTING_GUIDE.md
Architecture: 4-Tier Framework
Tier 0: Handbook Lookup (~0.5 sec)
Purpose: Rapid screening via semantic search on 2,980 vector chunks
Tools (3):
corrosion_screen_materials- Material-environment compatibilitycorrosion_query_typical_rates- Empirical corrosion ratescorrosion_identify_mechanism- Mechanism identification + mitigation
Tier 1: Chemistry (~1 sec)
Purpose: Aqueous speciation and scaling indices
Tools (2):
corrosion_langelier_index- Water scaling tendency (Langelier SI)corrosion_predict_scaling- Mineral scale prediction
Tier 2: Mechanistic Physics (1-5 sec)
Purpose: First-principles electrochemical models
Tools (7):
corrosion_predict_co2_h2s- NORSOK M-506 sweet/sour servicecorrosion_predict_aerated_chloride- O₂ mass transfer limitedcorrosion_assess_galvanic- NRL mixed-potential Butler-Volmer solvercorrosion_generate_pourbaix- E-pH stability diagramscorrosion_get_material_properties- Alloy database (18+ materials)corrosion_estimate_service_life- Remaining life prediction
Tier 3: Localized Corrosion
Purpose: Pitting/crevice assessment
Tools (2):
corrosion_assess_localized- Dual-tier pitting + creviceTier 1: PREN/CPT empirical (ASTM G48, ISO 18070)
Tier 2: E_pit vs E_mix mechanistic (NRL Butler-Volmer)
corrosion_calculate_pren- PREN calculation
Tool Count: 14 Tools
Tier | Tools | Count |
Tier 0: Handbook | screen_materials, query_typical_rates, identify_mechanism | 3 |
Tier 1: Chemistry | langelier_index, predict_scaling | 2 |
Tier 2: Mechanistic | predict_co2_h2s, predict_aerated_chloride, assess_galvanic, generate_pourbaix, get_material_properties, estimate_service_life | 6 |
Tier 3: Localized | assess_localized, calculate_pren | 2 |
Info | get_server_info | 1 |
Total | 14 |
All tools have the corrosion_ prefix (e.g., corrosion_screen_materials).
Recent Updates
Version 0.3.0 (2025-12-15)
14 MCP tools registered with
corrosion_prefixCSV-backed material properties for 18+ alloys
All critical bug fixes from code review complete
348 tests passing
Key Fixes (0.3.0)
Galvanic K constant corrected (A/cm² → mm/year)
ipy unit conversion fixed (in/y → mm/y)
DO scaling for user-supplied values
Zero-CO₂ short-circuit in NORSOK model
NORSOK pH clamping (prevents errors for pH > 6.5)
JSON Response Schema
All tools return standardized JSON with:
Central estimates (median or nominal values)
Uncertainty bounds (p05, p95 percentiles)
Provenance metadata (model, validation, sources, confidence)
Example (calculate_localized_corrosion):
Validated Materials (Phase 3)
Material | Tier 1 (PREN/CPT) | Tier 2 (E_pit/E_mix) | Status |
SS316 | ✅ | ✅ | ✅ Production-ready (seawater validated) |
316L | ✅ | ✅ | ✅ Alias → SS316 |
316 | ✅ | ✅ | ✅ Alias → SS316 |
UNS S31600/S31603 | ✅ | ✅ | ✅ Alias → SS316 |
HY80 | ✅ | ⚠️ | ⚠️ Tier 1 only (negative ORR activation energy at seawater) |
HY100 | ✅ | ⏳ | ⏳ Tier 2 untested (coefficients available) |
2205 | ✅ | ❌ | ✅ Tier 1 only (not in NRL DB, PREN=35) |
254SMO | ✅ | ❌ | ✅ Tier 1 only (not in NRL DB, PREN=43) |
Directory Structure
Implementation Summary
Completed Features
Tier 0: Handbook lookup (semantic search on 2,980 chunks)
Tier 1: Chemistry (Langelier SI, scaling prediction)
Tier 2: Mechanistic physics (CO₂/H₂S, aerated chloride, galvanic, Pourbaix)
Tier 3: Localized corrosion (dual-tier pitting, PREN)
Materials: NRL database (6 alloys) + CSV database (18+ alloys)
Future Roadmap
Corrosion under insulation (CUI) prediction
Monte Carlo uncertainty quantification
Enhanced PHREEQC integration
Usage Examples
Example 1: Dual-Tier Pitting Assessment (Phase 3)
Example 2: Galvanic Corrosion (Phase 2)
Example 3: Handbook Screening (Tier 0)
Design Decisions
Why Dual-Tier Pitting?
Decision: Combine empirical (PREN/CPT) with mechanistic (E_pit vs E_mix)
Rationale:
Tier 1 (PREN/CPT): Fast, conservative screening (worst-case ferric chloride test)
Tier 2 (E_pit vs E_mix): Mechanistic driving force accounting for redox state
Graceful degradation: Tier 2 optional (requires DO + NRL material), falls back to Tier 1
Codex validation: "Tier 1 is guaranteed, Tier 2 is opt-in... solid UX"
Why Material Aliases?
Decision: Map 316L, 316, UNS S31600 → SS316
Rationale (Codex recommendation):
Prevents "Tier 2 unavailable" frustration
Users don't need to memorize "SS316" vs "316L"
6-line alias dict prevents 90% of support issues
Why Tier Disagreement Detection?
Decision: Automatic warning when Tier 1 ≠ Tier 2
Rationale (Codex recommendation):
"Expose the conflict explicitly" when tiers disagree
Clear guidance: "Trust Tier 2 for accurate assessment"
Example: SS316 seawater → Tier 1 "critical" vs Tier 2 "low" (Tier 2 correct)
Production Deployment
Pre-Deployment Checklist
All tests passing (9/9 Phase 3 integration tests)
Codex recommendations implemented (4/4)
Documentation complete (user guide, deployment checklist)
Known limitations documented (HY80 at seawater)
API backward compatible (100%)
Smoke Tests
See: PRODUCTION_DEPLOYMENT_CHECKLIST.md
Monitoring Metrics
Tier 2 availability rate (target: >50%)
Tier disagreement rate (expected: 20-40%)
Error rate (target: <5%)
Latency p95 (target: <2 seconds)
Dependencies
Current (requirements.txt):
References
Authoritative Sources
U.S. Naval Research Laboratory - Butler-Volmer electrochemical kinetics
Repository: USNavalResearchLaboratory/corrosion-modeling-applications (MIT)
ASTM G48 - Critical Pitting Temperature tabulated data
ISO 18070 / NORSOK M-506 - Chloride thresholds
Garcia & Gordon (1992) - DO saturation model
Documentation
User Guide: docs/TIER1_VS_TIER2_PITTING_GUIDE.md
Deployment: PRODUCTION_DEPLOYMENT_CHECKLIST.md
MCP Config: MCP_CONFIGURATION.md
License
MIT License - See LICENSE file for details
Citation
Version: 0.3.0 | Tests: 348 passing | Tools: 14
Last Updated: 2025-12-15