Skip to content

feat(mcp): add FastMCP server for LLM agent integration - #9

Merged
federicogmz merged 1 commit into
mainfrom
feat/mcp-server
Oct 13, 2026
Merged

federicogmz merged 1 commit into
mainfrom
feat/mcp-server

Conversation

@federicogmz

Copy link
Copy Markdown
Owner

Description

Implements native Model Context Protocol (MCP) server support (shalstab-mcp) in shalstab-python. This exposes deterministic, physically-based slope stability tools directly to frontier AI agents (Claude Desktop, Claude Code, OpenAI Agents SDK).

Features

  • FastMCP Analytical Server (shalstab/mcp_server.py):
    • compute_infinite_slope_stability: Analytical Coulomb / Skempton-Delory infinite slope equilibrium with SHALSTAB 4-class stability categorization across dry, saturated, and steady-state regimes.
    • diagnose_topographic_wetness: Montgomery & Dietrich (1994) steady-state wetness index, critical recharge ratio, $\log_{10}(q/T)$ and natural $\ln(q/T)$ failure thresholds.
    • Pure Python analytical core without GIS dependencies at module startup (sub-second launch, 100% clean stdio).
  • Lazy Loading: __getattr__ in shalstab/__init__.py delays heavy imports until Analyzer is accessed.
  • Dual MCP Protocol Support: Compatible with both mcp 1.x (FastMCP) and mcp 2.x (MCPServer).
  • Comprehensive Unit Tests (tests/test_mcp.py): 13 unit tests covering analytical Factor of Safety, unconditional stability bounds, and MCP server factory / tool execution.
  • Documentation & Quickstarts: Full guides for Claude Desktop and OpenAI Agents SDK in README.md.

Verification

  • 51/51 unit tests passed across repository (pytest tests/ -v).
  • Parity verified with ruff check . and ruff format --check . on Ruff 0.16.10.
  • Reviewed and approved by Advisor (Claude Opus 5.5).

@federicogmz
federicogmz merged commit 79620d3 into main Oct 13, 2026
4 checks passed
@federicogmz
federicogmz deleted the feat/mcp-server branch October 13, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant