OpenGeoRock

Using OGR Slip2D with an AI agent

OGR Slip2D includes an official Model Context Protocol server, developed in the same repository as the solver. Through it, an agent can open the program, build a model and analyse it, then go through the results slice by slice or look at an image of them. It all runs on your computer, and if OGR Slip2D is open you can follow each step in its window.

Where it stands

OGR Slip2D is one of the first geotechnical programs with an official MCP server. To our knowledge (October 2026), it is also the first open-source slope-stability program to ship one. Any MCP client can use it, and with a local model nothing leaves your computer.

Server since OGR Slip2D 0.1.195 · window bridge since 0.1.207

§ 01 — The idea

The program's operations as MCP tools

The Model Context Protocol is an open standard for connecting applications based on language models to other programs. OGR Slip2D publishes its operations as MCP tools that any compatible client can call, while the engineering judgement stays with you.

Modelling

A whole model in one call

Geometry, materials, the region each material occupies and the water table can be defined from a description or taken from a DXF drawing. Any edit can be undone in one step.

Analysis

The same engine as the desktop program

Limit equilibrium with any of the nine methods and seven searches, finite-element groundwater, probabilistic analysis, back analysis and optimisation. Calculations run as background jobs, and any of them can be cancelled.

Results

Numbers and images

Critical surfaces with their slices, the queries of the interpretation window, error codes and groundwater fields. The agent can also ask for a PNG of the model, or of the canvas as it appears on screen, and look at it.

§ 02 — A real session

An agent models and analyses a 16 m slope

The slope on the home page was built in this exchange. The agent made five calls, starting with server_info, and the numbers in its answers come from OGR Slip2D.

  • model_define built the 16 m slope: three materials, two contacts and a water table assigned to all three.
  • analysis_configure set the methods, the grid search, 30 slices and the direction of failure.
  • In a background job, analysis_run evaluated 1 859 circles with each method.
  • results_get returned the critical surfaces with their slice tables.
  agent session · ogr-slip2d
Build a 16 m slope with a mid-height bench: silty sand over clay over dense gravel, water table 6 m below the crest. Check it with Bishop, Spencer and Morgenstern–Price.
server_infonext call goes to: the open window
model_define3 materials · 2 contacts · water table
analysis_configurebishop · spencer · gle · grid · 30 slices
analysis_runjob done · 87 s
results_getview: critical · spencer
Critical factors of safety: Bishop 1.300, Spencer 1.290 (λ = 0.343) and Morgenstern–Price 1.292, all on the same circle — centre (60.0, 47.6), radius 31.2 m. It runs through the clay, below the water table for most of its length, and exits 3.8 m beyond the toe.
Which slice carries the highest pore pressure?
The slices under the bench, around x = 48–50 m: about 48.6 kPa at their base. Above the water table, towards both ends of the circle, the pore pressure is zero.
§ 03 — Installation

Installing the server and connecting a client

You need Python 3.11 or newer and an MCP client. The server is part of the OGR Slip2D package, so it does not have to be downloaded separately. In the examples below, replace C:\path\to\projects with the folder where you keep your .ogr models.

  1. Install OGR Slip2D with the MCP extra

    The [mcp] extra adds the official MCP SDK for Python (MIT licence), which the server needs and the desktop program does not.

    git clone https://github.com/samuelsl27/OGR-Slip2D.git
    cd OGR-Slip2D
    python -m venv .venv
    .venv\Scripts\activate          # macOS / Linux: source .venv/bin/activate
    pip install -e ".[mcp]"
    ogr-slip2d-mcp --version

    If ogr-slip2d-mcp is not on the client's PATH, give the full path of the executable, or run python -m ogr_mcp, which starts the same server.

  2. Register the server in your client

    Edit claude_desktop_config.json, which is in %APPDATA%\Claude\ on Windows and in ~/Library/Application Support/Claude/ on macOS; the Microsoft Store version keeps it in %LOCALAPPDATA%\Packages\Claude_<id>\LocalCache\Roaming\Claude\. Restart Claude afterwards.

    {
      "mcpServers": {
        "ogr-slip2d": {
          "command": "ogr-slip2d-mcp",
          "args": ["--workdir", "C:\\path\\to\\projects"]
        }
      }
    }

    If Claude cannot find the command, put the full path of ogr-slip2d-mcp.exe (inside your virtual environment's Scripts folder) in command.

  3. Check the connection

    Ask the agent to call server_info. The reply gives the version, the units (SI) and the published tools, and says whether the next call will go to an open OGR Slip2D window or to a model held by the server.

    {"server": "ogr-slip2d", "units": "SI: m, kN, kPa, kN/m3, degrees", "profile": "full",
     "attached_to_window": {"window_open": true, "next_call_goes_to": "the open window"},
     "program_coverage": {"mapped": 116, "pending": 0}, "licence": "AGPL-3.0-or-later", …}
§ 04 — Same window, same model

The agent works in your window

If OGR Slip2D is open, whatever you ask the agent is done in that window, whichever client you use and whether you opened the program or the client first. The program starts its agent bridge when it opens, so no further configuration is needed.

  • Each edit the agent makes is one step of Edit → Undo, and the canvas is redrawn after it.
  • An analysis started by the agent appears in the results panel and on the canvas, as it does when you press Compute.
  • project_new and project_open refuse to run while there are unsaved changes, so the agent cannot discard your work.
  • The bridge listens only on 127.0.0.1, with a new random token each time it starts. You can turn it off in Tools → Agent bridge (MCP) or start the program with --no-agent-bridge.
  OGR Slip2D · driven through MCP
The OGR Slip2D modeller with a model built and analysed by an agent through MCP: candidate circles, the critical circle in red and the results table
Fig.The modeller window while an agent works on the model. The changes arrive as ordinary edits, which you can undo.
§ 05 — What the agent can do

74 tools covering 116 menu actions

The server gives access to all the modelling and analysis actions in the program's menus. The ones it leaves out only concern the view (zoom, pan, print). For small local models, the compact profile publishes 14 of the 74 tools.

GroupWhat it coversExamples
ProjectCreate, open, save, describe and validate modelsproject_new · project_summary · project_validate
ModelThe whole model in one call; boundaries, materials, regions; reshape the outline or change the slope angle; geometry clean-upmodel_define · boundary_edit · slope_angle_change
LoadsDistributed and line loads, pseudo-static seismic loading, acceleration recordsload_set · seismic_set
SupportsSupport types, single supports and patternssupport_type_set · support_pattern_add
SearchTension crack water, focus objects, user surfacesfocus_set · user_surface_add
GroundwaterHydraulic properties, mesh, boundary conditions, transient stages, pressure grids, solve, read the field, drawdown sweepmesh_generate · groundwater_run
StatisticsRandom variables, probabilistic and sensitivity runs, back analysis, optimisationstatistics_run · back_analysis_run
AnalysisSettings, background runs, jobs, results, the interpretation window's queries, a single surfaceanalysis_run · results_query · surface_evaluate
FilesDXF in and out, PDF report, import properties from another modeldxf_import · report_generate
View & PythonPNG of the model or of the canvas on screen, undo history, Python for anything elsemodel_render · project_history · python_exec
§ 06 — Security

Security and network access

The server always publishes python_exec, which runs Python with your user's permissions and covers anything that does not have a tool of its own yet. Anyone who can talk to the server can therefore run code on your machine, so by default only you can reach it.

  • stdio (Claude, LM Studio, the Agents SDK): the server runs as a child process of the client and opens no port. The remaining risk is prompt injection, so keep the client's confirmation before each tool call.
  • HTTP: a token is always required, even on 127.0.0.1, and it is compared in constant time. The Host and Origin headers are checked to prevent DNS rebinding. Without a token there is no network access.
  • Internet (--public-url): OAuth 2.1 with PKCE, a rate-limited approval step and tokens held only in memory. The server never opens a tunnel by itself.
  • No telemetry: the server makes no network calls of its own.
§ 07 — Try asking

Example requests

Give the agent the engineering data (geometry, strengths, water) and ask for the checks you would make yourself. All units are SI.

Model

“Open dam.dxf, tell me which layers you would import as external and material boundaries, and import them.”

Compare

“Run Bishop, Spencer and Morgenstern–Price with a grid search and tell me whether they agree on the critical circle.”

Groundwater

“Mesh the dam, put the reservoir at 17 m, solve the steady seepage and use that pore pressure in the downstream slope.”

Probabilistic

“Make c′ and φ′ of the clay normal with a 15 % and 8 % coefficient of variation, correlated −0.5, and give me the probability of failure.”

Design

“Which horizontal support force at elevation 4 m brings the critical factor of safety to 1.3?”

Report

“Save the model, export the critical surfaces to DXF and generate the PDF report of the last analysis.”

§ 08 — Questions

Frequently asked

Does my model leave my computer?

The server makes no network calls. A model provider receives whatever your client sends it, as in any other conversation. With a local model (LM Studio, Ollama), nothing leaves your machine.

Which models can use it?

Any client that speaks MCP. Large hosted models handle the full 74-tool profile well; for small local models, start the server with --profile compact.

Can the agent break my model?

Each edit is an undo step. A script run with python_exec counts as one step and is rolled back if it fails, and the agent cannot open or create a model while there are unsaved changes. Settings that the calculation would not read are rejected with the reason, instead of being stored.

Is the agent's answer an engineering result?

The numbers come from the same engine as the desktop program and need the same checks: independent calculations, the sensitivity of the result to the inputs, and engineering judgement. Responsibility for a design lies with the engineer who signs it, whether the model was built by hand or by an agent.

Next

Installation and documentation