McStas - A neutron ray-trace simulation package

McStas is a general tool for simulating neutron scattering instruments and experiments. It is actively supported by DTU Physics, NBI KU, ESS, PSI and ILL

Simulated scattering from a hollow-cylinder vanadium sample.

The plot shows the intensity of scattered neutrons (red is highest intensity). The sample is at the center of the sphere with the neutron beam coming from the left. Clearly seen is the shadowing effect of the sample causing a lower intensity opposite the beam. Also seen is the effect of the non-symmetric geometry of the sample, causing lower intensity directly above and to the side of the sample.

Recent news

October 11th, 2019: Respin of McStas v2.5 to support macOS Mojave and Catalina

Recently one of our users reported issues on macOS Mojave with mcgui not picking up the right location of the mcstas library, please see the related GitHub issue for more information.

Since the problem seems to occur consistently on updated Mojave (10.14) and Catalina (10.15) systems, a patched version of our macOS App bundle has been uploaded to our download page.

Please let us know via the mailinglist or by creating a GitHub ticket if any further issues arise.

June 16th, 2019: Statistics on the history of McStas releases

Did you ever wonder how the number of included components and instrument files in McStas changed over time? - And did you know that we now include 215 components and 192 example instruments?

The figure below is generated from release-metadata extracted from, where all McStas releases can be found.

June 7th, 2019: math.h issues on macOS 10.14.5 Mojave

With the latest update to Xcode command line tools on macOS, there is no longer an option to install the system header files to the legacy location of /usr/include .

This unfortunately means that the miniconda-based gcc that we distribute with McStas (and set up by default) is no longer able to locate the math.h header file and compilations fail with

mccode-r.h:39:18: fatal error: math.h: No such file or directory

Our suggested workaround is to configure your McStas installation to instead use the system-provided clang compiler, see our GitHub issue #799 for a detailed description of how to do this.

April 2nd, 2019: Announcing ISTSI2019

The workshop Innovative Simulation Tools, Shielding and Instrumentation 2019 (ISTSI2019) will be held at Holiday Inn St. Petersburg, Russia, on Saturday June 29th 2019, as a satellite of the ECNS conference.

The workshop brings together the partners of the SINE2020 WP8 that have contributed work in the areas of

For more information and registration, please consult the website at

This workshop / project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 654000.

March 25th-20th, 2019: McStas School at CSNS

Dear all,

In collaboration with the China Spallation Neutron Source, the McStas team participated in the first ever McStas school in China in the last week of March.

All lecture material and exercises are available through our new McStas school site, hosted on GitHub

Further, our hosts suggested we recorded videos of the lectures which are slowly becoming available on the new McStas youtube channel.

January 18th, 2019: McStas survey results

Dear all,

The results from the 2018 McStas user survey are now online at

The main conclusions are that

Thank you very much for the (generally) very positive review - also, you are more than welcome to participate in continuing debate on user suggestions that will take place in the individual GitHub survey issues.

Previous news items: 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1998.