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:
| Tool | What it does |
|---|---|
predict_scale | Predict which minerals scale for one brine at a temperature, pressure and pH — optionally open to a CO₂/H₂S/CH₄ gas phase. |
mix_brines | Blend two waters by volume fraction, then predict — the incompatibility case (seawater breaking through into a Ba/Sr formation water → barite/celestite). |
profile_scale | Evaluate one brine across a list of temperatures, to answer “at what temperature does barite start to scale?” |
list_capabilities | The 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
Run the server
From a published build (see Download) or a source checkout:
dotnet run --project src/Crysalt.McpIt communicates over standard input/output (stdio) and needs no network — the engine and its data run entirely locally.
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
commandat the published executable instead ofdotnet.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_scaleand reports the minerals, masses, and saturation ratios.
Want the raw HTTP interface for pipelines and automation? See the API reference. For the science behind the numbers, see Methodology.