Documentation

Run it in your AI workflow

Crysalt ships as an MCP server — a small program you run on your own machine that lets the AI assistant you already use call scale prediction as a tool. Your brine compositions and conditions stay on your computer; nothing is sent to an outside service.

What is MCP?

MCP — the Model Context Protocol — is the open standard AI assistants use to talk to local tools. Once Crysalt is connected, you ask your assistant in plain language — “will this brine scale at 80 °C and 50 bar?” — and it runs the calculation through Crysalt and answers with the numbers. You don't write any code; you (or your IT/AI team) connect it once.

You

  • Ask in plain language, in your assistant

Crysalt — on your machine

  • The assistant calls a tool
  • The engine computes locally

Answer

  • Minerals, masses, SR/SI, pH — cited back to you

What the assistant can do

The server exposes four tools. The assistant picks the right one from your question:

ToolWhat it does
predict_scalePredict which minerals scale for one brine at a temperature, pressure and pH — optionally open to a CO₂/H₂S/CH₄ gas phase.
mix_brinesBlend two waters by volume fraction, then predict — the incompatibility case (seawater breaking through into a Ba/Sr formation water → barite/celestite).
profile_scaleEvaluate one brine across a list of temperatures, to answer “at what temperature does barite start to scale?”
list_capabilitiesThe minerals the engine predicts and the exact species ids it accepts — the assistant calls this when unsure.

Each prediction comes back as a concise summary — supersaturated minerals (saturation ratio, index, precipitated mass, Ksp), the equilibrium pH and ionic strength, any gas exchange, and a convergence flag — phrased for the assistant to narrate. The engine is deterministic and validated, so the model is told to call the tool, not estimate.

Set it up

  1. Run the server

    From a published build (see Download) or a source checkout:

    dotnet run --project src/Crysalt.Mcp

    It communicates over standard input/output (stdio) and needs no network — the engine and its data run entirely locally.

  2. Connect your assistant

    Add Crysalt to your MCP client's config. For Claude Desktop, edit claude_desktop_config.json:

    {
      "mcpServers": {
        "crysalt": {
          "command": "dotnet",
          "args": ["run", "--project", "C:/path/to/Crysalt/src/Crysalt.Mcp"]
        }
      }
    }

    VS Code (Copilot) and Claude Code connect the same way. For a standalone binary, point command at the published executable instead of dotnet.

  3. Ask

    Restart the assistant and ask a scale question in plain language:

    "North Sea formation water — Na 31000, Cl 52000, Ca 5200, Ba 250,
    SO4 500, HCO3 400 mg/L — at 25 °C and 1 bar. What scales, and how much?"

    The assistant calls predict_scale and reports the minerals, masses, and saturation ratios.

Your data stays put. The MCP server runs in your environment and talks only to the assistant on the same machine. No brine data leaves your network — which is the point.

Want the raw HTTP interface for pipelines and automation? See the API reference. For the science behind the numbers, see Methodology.

An unhandled error has occurred. Reload 🗙