Ansys Rocky MCP
Drives Ansys Rocky (discrete element method solver) studies through PyRocky: creates and opens projects, imports walls and defines surfaces, particles, inlets, outlets, domain and simulation settings, applies motions, runs simulations with blocking or non-blocking control, polls progress, and post-processes results via time-series curves, grid function statistics and selection processes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Ansys Rocky MCP create a hopper study, run 5 seconds, then show the particle velocity"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ansys-rocky-mcp
Model Context Protocol (MCP) server for Ansys Rocky — the discrete element method (DEM) solver. Drive Rocky studies, run simulations and post-process results from Claude, MiniMax Code, Codex, Cursor, Kimi or any other MCP client.
Built on the official ansys-common-mcp foundation,
so it follows the same extension pattern as the other PyAnsys MCP servers
(pymapdl-mcp, pyfluent-mcp, pymechanical-mcp, …).
Why this exists
Ansys ships first-party MCP servers for Fluent, Mechanical, MAPDL, AEDT, CFX and Lumerical.
There is no MCP server for Rocky. The only Rocky automation that exists today is the
Python client library ansys-rocky-core,
which is an API, not an MCP server — so an AI assistant cannot call it without the user
writing the PyRocky boilerplate by hand every time.
This project closes that gap: a stateful, tool-based MCP server that lets an AI build a Rocky study, run it, and read the results.
Related MCP server: sentaurus-mcp
Status
Tools | 25 (session, project, setup, run control, results, Python escape hatch) |
Transport |
|
Verified | Full workflow end-to-end over a real MCP stdio handshake, 42 automated tests |
Requires | Python ≥ 3.12, |
Real solver | Needs a locally installed + licensed Ansys Rocky 2024 R2 or newer |
⚠️ Read this before trusting numbers
The server has two backends:
pyrocky— drives a real Ansys Rocky application through PyRocky.mock— a built-in in-memory Rocky simulator. It models the study bookkeeping (project, particles, surfaces, inlets, outlets, selections, domain and solver settings) and produces physically consistent but simulated time series.
Every response carries backend and simulated fields. When simulated is true,
the numbers did not come from Ansys Rocky. The server instructions tell the AI to say
so explicitly.
The default backend is auto, which uses the real Rocky when it is installed and
fails with an actionable error when it is not. It never silently substitutes simulated
numbers for solver output.
Install
git clone https://github.com/ansys/ansys-rocky-mcp.git
cd ansys-rocky-mcp
python -m venv .venv
.venv/Scripts/pip install -e . # Windows
# .venv/bin/pip install -e . # Linux / macOSansys-common-mcp requires Python ≥ 3.12. On Windows, pip install of the Ansys
namespace packages can conflict with a system-wide ansys install — use a dedicated
virtual environment as above.
Quick start
Try it without Ansys installed
.venv/Scripts/python.exe -m ansys_rocky_mcp --backend mockDrive a real Rocky installation
.venv/Scripts/python.exe -m ansys_rocky_mcp --backend auto --headlessRequires Ansys Rocky 2024 R2 or newer with AWP_ROOT242 (or newer) set.
As an MCP server over HTTP
.venv/Scripts/python.exe -m ansys_rocky_mcp --backend mock --transport http --http-port 8080Client setup
The server speaks standard MCP over stdio, so it works with any MCP client. Full
per-client instructions are in docs/mcp-clients.md.
Claude Desktop
%APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"ansys-rocky": {
"command": "N:\\ansys-rocky-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "ansys_rocky_mcp", "--backend", "mock"]
}
}
}Claude Code
claude mcp add --scope user ansys-rocky "N:\ansys-rocky-mcp\.venv\Scripts\python.exe" -m ansys_rocky_mcp --backend mockMiniMax Code
{
"mcpServers": {
"ansys-rocky": {
"type": "stdio",
"command": "N:\\ansys-rocky-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "ansys_rocky_mcp", "--backend", "mock"]
}
}
}Codex CLI
~/.codex/config.toml:
[mcp_servers.ansys-rocky]
command = "N:\\ansys-rocky-mcp\\.venv\\Scripts\\python.exe"
args = ["-m", "ansys_rocky_mcp", "--backend", "mock"]
startup_timeout_sec = 90Tool surface
Session
Tool | Purpose |
| Backend, Rocky availability, detected versions, project and simulation state. Never launches Rocky. |
| Launch or attach to Rocky ( |
| Close the session. |
Project
Tool | Purpose |
| Create an empty project. |
| Open a |
| Save the project. |
| Close the project. |
| Full snapshot: elements, domain, solver, processes, simulation state. |
Study setup
Tool | Purpose |
| Import a geometry file as a wall. |
| Create a circular or rectangular surface. |
| Create a particle definition (shape, sieve size). |
| Create a particle inlet and set its mass flow rate. |
| Create an outlet on a surface. |
| Set the domain limits and boundary-limit behaviour. |
| Duration, output interval, processors, execution mode. |
| Apply a rotation or translation motion to objects. |
Run control
Tool | Purpose |
| Start the solver (blocking or non-blocking). |
| Progress, time set, results availability. |
| Wait for the run to finish. |
Results
Tool | Purpose |
| Read a time series ( |
| List the available grid functions. |
| Min/max of a grid function over the time set. |
| Create a cylinder or cube selection process. |
| List user processes and registered objects. |
| Run arbitrary Python in a persistent session (escape hatch). |
Object identifiers
The Rocky API returns opaque proxy objects that an AI cannot reference later. This server
assigns each created object a short, stable identifier — surface_1, particle_1,
inlet_1, outlet_1, wall_1, selection_1, motion_1 — and accepts those
identifiers in later calls.
A typical session
rocky_status
rocky_create_project
rocky_create_surface {kind: circular, radius: 0.3} → surface_1
rocky_create_particle {shape: sphere, sieve_size: 0.05} → particle_1
rocky_create_inlet {surface_id: surface_1, particle_id: particle_1, mass_flow_rate: 1000}
rocky_set_domain {min_values: [-5,-1.5,-1.5], max_values: [5,1.5,1.5]}
rocky_set_simulation_settings {duration: 2, time_interval: 0.1}
rocky_describe_study → verify the setup
rocky_run_simulation {non_blocking: false}
rocky_get_curve {name: "Particles Count"}
rocky_get_curve {name: "Particles Mass Flow In", unit: "t/h"}
rocky_save_project {path: "C:/work/chute.rocky"}Configuration
Command line flags take precedence over environment variables, which take precedence over the defaults.
Flag | Environment variable | Default | Meaning |
|
|
|
|
|
| auto-detected | Explicit Rocky executable. |
|
| latest | Ansys version code ( |
|
|
| PyRocky RPC port. |
|
| headless | GUI or headless Rocky. |
|
| enabled | Disable the persistent Python session. |
|
|
| Simulated seconds per wall-clock second (mock only). |
— |
| current directory | Working directory. |
Transport flags come from ansys-common-mcp: --transport stdio|http,
--http-host, --http-port, --http-path, --cors-origins.
Architecture
src/ansys_rocky_mcp/
├── server.py RockyMCP: extends PyAnsysBaseMCP, registers the tools
├── context.py RockyContext: session, config, persistent Python session
├── session.py RockySession: lazy connection, object registry
├── config.py RockyConfig: CLI / environment resolution
├── registry.py ObjectRegistry: stable ids for Rocky API objects
├── backends/
│ ├── base.py RockyBackend interface + BackendStatus
│ ├── pyrocky_backend.py Real Rocky via ansys-rocky-core
│ └── mock_backend.py In-memory Rocky simulator
└── tools/
├── session_tools.py status / connect / disconnect
├── project_tools.py project lifecycle + study description
├── setup_tools.py geometry, particles, inlets, domain, solver, motion
├── run_tools.py start / poll / wait
└── results_tools.py curves, grid functions, selections, Python escape hatchThe tool layer is written against the Rocky application object — the same interface
pyrocky returns from RockyClient.api() (CreateProject, GetProject, GetVersion,
…). Both backends expose that interface, so tool code is identical whether a real Rocky
application or the simulator is behind it.
The Rocky method names and signatures used here come from the official
ansys/pyrocky type stubs (src/ansys/rocky/app/*.pyi)
and the upstream examples/basic_examples/ scripts.
Development
.venv/Scripts/python.exe -m pytest tests/ -q
.venv/Scripts/python.exe -m ruff check src tests
.venv/Scripts/python.exe -m ruff format src testsThe test suite covers the mock backend physics, every tool, the configuration and CLI
handling, the persistent Python session, and a real MCP handshake over stdio with
the server running as a subprocess.
Limitations
The
pyrockybackend has not been executed against a live Ansys Rocky installation in this repository's development environment, because no Ansys software is installed there. It is written against the authoritative Rocky API surface, and it fails loudly with an actionable message when Rocky is absent. Expect to shake out version-specific differences on the first run against a real installation.The mock backend models bulk transport, not particle–particle contact mechanics. It is a simulator for interface exploration and testing, not a DEM solver.
Result export through the Rocky export toolkit is not exposed as a tool yet.
License
MIT — see LICENSE.
Available Tools
25 toolsrocky_close_projectRocky Close ProjectB
Close the open Rocky project.
Inputs: no named parameters. Returns: object
rocky_connectRocky ConnectC
Connect to Ansys Rocky.
Inputs: exe, mode, port, version. Returns: object
rocky_create_inletRocky Create InletB
Create a particle inlet on a surface and set its mass flow rate.
Inputs: surface_id (required), particle_id (required), mass_flow_rate (required), unit. Returns: object
rocky_create_outletRocky Create OutletC
Create a Rocky outlet on a surface.
Inputs: surface_id (required). Returns: object
rocky_create_particleRocky Create ParticleC
Create a Rocky particle definition.
Inputs: name, unit, shape, sieve_size. Returns: object
rocky_create_projectRocky Create ProjectA
Create a new, empty Rocky project.
Any previously open project is replaced and the object registry is reset.
Inputs: no named parameters. Returns: object
rocky_create_selectionRocky Create SelectionC
Create a selection process for post-processing.
Inputs: kind, name, size, unit, +2 more. Returns: object
rocky_create_surfaceRocky Create SurfaceB
Create a circular or rectangular Rocky surface.
Inputs: kind, name, unit, width, +3 more. Returns: object
rocky_describe_studyRocky Describe StudyA
Describe the open project and study.
Returns the project path, every study element with its class and key parameters, the domain and solver settings, the user processes, the simulation state, and the identifiers of the registered objects.
Call this after any setup step to confirm what the study actually contains.
Inputs: no named parameters. Returns: object
rocky_disconnectRocky DisconnectA
Disconnect from Ansys Rocky and release the session.
Inputs: no named parameters. Returns: object
rocky_get_curveRocky Get CurveC
Read a time series produced by the simulation.
Inputs: name (required), unit, selection_id. Returns: object
rocky_get_grid_function_statsRocky Get Grid Function StatsA
Read the minimum and maximum of a grid function over the time set.
Inputs: name (required), unit. Returns: object
rocky_import_wallRocky Import WallC
Import a geometry file as a Rocky wall.
Inputs: path (required), scale, name_prefix. Returns: object
rocky_list_grid_functionsRocky List Grid FunctionsB
List the grid functions available for the current study.
Inputs: no named parameters. Returns: object
rocky_list_processesRocky List ProcessesB
List the user processes and registered objects of the study.
Inputs: no named parameters. Returns: object
rocky_open_projectRocky Open ProjectC
Open an existing Rocky project file.
Inputs: path (required). Returns: object
rocky_run_pythonRocky Run PythonA
Run arbitrary Python code in the persistent Python session.
This is the escape hatch for anything the dedicated tools do not cover. The session keeps state between calls, so variables survive from one invocation to the next.
Inputs: code (required), timeout. Returns: result
rocky_run_simulationRocky Run SimulationC
Start the Rocky simulation.
Inputs: non_blocking, delete_results. Returns: object
rocky_save_projectRocky Save ProjectB
Save the open Rocky project.
Inputs: path. Returns: object
rocky_set_domainRocky Set DomainC
Configure the Rocky domain limits.
Inputs: unit, max_values, min_values, use_boundary_limits. Returns: object
rocky_set_motionRocky Set MotionC
Apply a rotation or translation motion to one or more study objects.
Inputs: kind (required), targets (required), unit, stop_time, +3 more. Returns: object
rocky_set_simulation_settingsRocky Set Simulation SettingsC
Configure the Rocky solver settings.
Inputs: unit, duration, processors, time_interval, +1 more. Returns: object
rocky_simulation_statusRocky Simulation StatusA
Report the state of the running simulation.
Returns whether the solver is running, the progress percentage, the computed time set and whether results are available.
Inputs: no named parameters. Returns: object
rocky_statusRocky StatusA
Report the status of the Rocky MCP session.
Returns the active backend, whether a real Ansys Rocky application is installed and reachable, the detected Rocky versions, the open project and the current simulation state.
Use this first: it is the only tool that never launches Rocky.
Inputs: no named parameters. Returns: object
rocky_wait_for_completionRocky Wait For CompletionC
Wait until the running simulation finishes.
Inputs: timeout, poll_interval. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
Most tools target distinct resources/actions (create_inlet vs create_outlet vs create_surface vs import_wall are clearly separated). However, the reporting cluster is somewhat overlapping: rocky_status, rocky_describe_study, rocky_simulation_status, and rocky_list_processes all surface state information, which could cause hesitation about which to call. The descriptions do help distinguish them (session vs study contents vs solver progress vs object registry), so the overlap is manageable.
Every tool uses the rocky_ prefix followed by a snake_case verb_noun pattern (rocky_create_inlet, rocky_open_project, rocky_set_motion, rocky_run_simulation). Minor noun-only names like rocky_status are still readable and consistent with the resource-query style. No mixed conventions anywhere.
25 tools sits at the heavy end for this surface. The domain (full simulation setup, execution, and post-processing) justifies many of them, but the number is borderline and includes several narrow report tools that could plausibly be consolidated. It is not padded with obviously redundant tools, but it is on the edge of feeling sprawling.
The surface covers connection lifecycle, project CRUD (create/open/save/close), geometry/domain setup, particle and boundary creation, solver configuration, simulation run/status/wait, and post-processing (curves, grid functions, selections). Gaps exist: there are no explicit delete/remove tools for created objects and no material/CFD-coupling tools, but rocky_run_python serves as a deliberate escape hatch for these, so agents can work around them.
Maintenance
Related MCP Connectors
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Global CAD/BIM, industrial engineering (FEM, CFD) and property tools via one MCP endpoint.
Query, browse, and automate OmegaAI workspaces from any MCP client. Streamable HTTP with OAuth 2.0.
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables AI assistants to control and automate Abaqus/CAE simulations via MCP, including model query, job management, ODB inspection, KPI extraction, capsule tracking, physics contract validation, report generation, and viewport capture. It also supports noGUI batch mode, dual transport, and integration with Codex/Claude clients.1109MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to manage Sentaurus TCAD simulation experiments via MCP, including creating and submitting jobs, querying status, reading logs, and listing output files.611Apache 2.0
- AlicenseBqualityCmaintenanceEnables an MCP-compatible AI client to control CADFEKO, the FEKO solver, and POSTFEKO by running Lua API scripts, launching asynchronous jobs, tracking progress, and exporting S11, impedance, Touchstone, model files, and images.9MIT
- AlicenseBqualityCmaintenanceEnables MCP-compatible AI clients to control CADFEKO, the FEKO solver, and POSTFEKO by running Lua API scripts, launching asynchronous jobs, monitoring progress, and exporting S11, impedance, Touchstone, model files, and images.91MIT