ntopology-mcp
This server lets you inspect, edit, validate, and run nTop notebook block graphs headlessly, then measure the resulting geometry.
Inspect notebooks — version, sections, block/value counts, and what the root evaluates (
inspect_notebook)Read the block graph — typed signatures, wiring, and literal values, with filtering and limits (
read_graph)Validate graphs — catch dangling inputs, duplicate ids, missing roots, bad literals, and invalid list wiring before running (
validate_graph)Edit blocks and values — change scalar/file/vector/point/boolean/enum literals (
set_literal_value), rewire input slots (set_input), add computed blocks (add_block) and constants (add_literal)Restructure notebooks — prune unreachable blocks and point the root at chosen outputs (
prune_graph), and set which blockntopclreports as output (set_output)Run notebooks headlessly — execute through nTop Automate/
ntopcl, capturing errors, warnings, and per-block timings (run_notebook)Search installed block signatures — find exact typed signatures, newest revisions first, for use with
add_block(search_blocks)Measure output geometry — STL volume, area, bounding box, watertightness, open/non-manifold edges, components, and inverted faces (
mesh_stats)Find nTop examples/documentation — search shipped example notebooks and reference pages (
find_example)Check the environment — confirm whether nTop,
ntopcl, and block signatures are available (environment)
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., "@ntopology-mcp Validate bracket.ntop, run it, and report the mesh stats."
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.
ntopology-mcp
An MCP server for nTop (formerly nTopology) that reads and edits notebook block graphs directly, runs them headlessly through nTop Automate, and measures the geometry that comes out.
nTop ships an official MCP server, and it solves a different problem: it searches nTop's documentation. This one operates on your files. The two are complementary — theirs answers "how would I set up a topology optimization", this one sets one up and runs it.
The documented automation path (nTop Automate) expects you to build a notebook by hand in the GUI, expose a few inputs as variables, and vary those from a script. That covers parameter sweeps. It does not let you add a block, rewire an input, or restructure a graph. This server does, by treating the .ntop file as what it is: a container holding a JSON block graph.
Tools
Tool | Description |
| Version, sections, block and value counts, and what the root evaluates |
| Blocks with typed signatures, wiring and literal values; filterable, 200 by default |
| Dangling inputs, duplicate ids, missing root, literals with no value, extra edges past a |
| Change a scalar, file path, vector, point, boolean or enum |
| Rewire one input slot of a block |
| Add a computed block from a typed signature |
| Add a constant |
| Point the root at chosen outputs and drop everything unreachable |
| Execute through |
| Search the block signatures present in your nTop installation |
| Volume, area, bounding box, open and non-manifold edge counts, components, facet orientation |
| Choose which block |
| Search nTop's own shipped example notebooks and reference pages |
| Report what the server can find on this machine |
Related MCP server: Onshape MCP Server
Requirements
nTop installed. Verified against 5.54.2 on Windows.
nTop Automate licence for
run_notebook. This is licensed separately from the GUI seat; everything else works without it.Node.js 20+ to run the server. The test suite needs 21+, where
node --testaccepts a glob.
Install
git clone https://github.com/sohumsuthar/ntopology-mcp.git
cd ntopology-mcp
npm install
npm run buildConfiguration
Add to your MCP client config:
{
"mcpServers": {
"ntopology": {
"command": "node",
"args": ["C:\\path\\to\\ntopology-mcp\\dist\\index.js"],
"env": {
"NTOP_INSTALL_ROOT": "C:\\Program Files\\nTopology\\nTopology"
}
}
}
}NTOP_INSTALL_ROOT is optional if nTop is at the default Windows location. NTOPCL_PATH can point at ntopcl.exe directly. Call environment first to confirm what the server found.
Example
Retarget an existing optimization at a different design space, cut it down to one output chain, and run it:
read_graph notebook=bracket.ntop filter=file_path
set_literal_value notebook=bracket.ntop blockId=477 value={"val": "C:/parts/wedge.step"}
prune_graph notebook=bracket.ntop rootInputs=[900] output=bracket_run.ntop
run_notebook notebook=bracket_run.ntop
mesh_stats path=C:/parts/result.stl listComponents=trueThe editing tools validate before they write and refuse to save a graph with errors, so anything
they produce is already checked. Run validate_graph on notebooks this server did not write -
one edited in the nTop GUI, say - before spending minutes on run_notebook.
The notebook format
The .ntop format is not documented by nTop. What follows was derived by inspecting files written by 5.54.2, and the parser is verified by round-tripping real notebooks byte for byte.
file : "MAGIC%$1" u64 sectionCount u64 reserved
sectionCount * { name[16], u64 endOffset }
80 zero bytes, then sections laid out in table order
section : "MAGIC@@9" type[16] name[16] u64 contentLength 80 zero bytes, contentThe main section holds two children: fn, the block graph as JSON, and leaves, an object container whose index section carries every literal value. A block with a non-empty func computes something; a block with an empty func is a literal. Inputs reference the producing block by id, with 0 and -1 both meaning unconnected.
Behaviour worth knowing
These cost real debugging time and are encoded in validate_graph or in tool descriptions where possible:
A
list<T>parameter must be fed by exactly onecore.list<T>block. Wiring two implicits straight into the list slot makes nTop reject the entire file at load with a generic "unable to load your file", naming nothing.validate_graphcatches the form this produces in practice: connected edges past the declared parameter count on a block that has alist<T>parameter.Extra trailing unconnected input slots are normal. nTop emits them itself when a block version gains an optional parameter, so they are not an error.
plane<point,vector,vector>takes an origin and two vectors that span the plane. The normal is their cross product, not the second argument.offset_implicitis inverted from intuition: a positive offset erodes. Rounding convex edges (a morphological opening) isoffset(+r)thenoffset(-r).boolean_union's blend enum:1adds material at the joint,2removes it,0is a hard union.implicit_to_meshv2.4.0's third input is Min Feature Size. Set it to 5 mm and a 5 mm plate silently disappears.The version suffix is load-bearing. The binaries contain every historical revision of a block, but nTop registers only the current one. An old revision fails with the same "Unknown block … Toolkit or Connector that is not installed" message as an unlicensed toolkit, so a stale signature looks exactly like a missing licence.
search_blocksreturns the newest revision of a name first; prefer it, and treat a bare unversioned form with suspicion.An unconnected input is
-1(Empty), not0(None).0on a required input makes nTop refuse to load the file. But-1is not universally safe either: some optional inputs reject it withInput at N is Empty but optionaland must be fed a literal. Match what the surrounding notebook already does, and letvalidate_graphand a trial run settle the rest.ntopcl -oreports the block named by the graph's ownoutputkey, whichset_outputsets. The root group's inputs are not notebook outputs; withoutset_outputyou getOutput path specified, but can't find output in notebook.ntopclexits 0 even when a block fails: it logs[E]and still prints "nTop successfully built". Never judge a run by its exit code alone -run_notebookreportssuccessonly when the exit code is 0, no error lines appeared, and the build line is present.An inside-out mesh is silently fatal. Inward-facing normals make nTop's tet mesher fail with a generic "Volume meshing errors" naming nothing, while the mesh is watertight, manifold and correctly sized.
mesh_statsreportsinvertedfor exactly this case.Result blocks that expose time series are indexed from 1, and step 1 is often a non-physical initialisation rather than the answer. Reading it produces plausible-looking nonsense with no error.
Preserving a region during optimization uses
passive_region_constraint<region>fed byfe_region_by_implicit, added to the optimization constraint list. The Initial Density input does not freeze anything — nTop documents it as a starting guess only.
nTop ships its own examples - read them first
nTop installs roughly 100 working example notebooks at
C:\ProgramData Topology\documentation\ExtendedBlockDocs\ and full HTML reference pages under
block-documentationlocks\. find_example searches both. An example notebook settles a block's
wiring, literal shapes and property paths in seconds, where reverse-engineering the same thing from
error messages takes hours. Check there before guessing.
Literal value shapes
Literal values are stored per type and the shapes are not uniform:
Type | Value |
|
|
| array of three such objects |
|
|
|
|
|
|
|
|
A wrong shape fails at load with Leaf failed to deserialize with block/variable <name>.
Block signatures
nTop stores its block signatures as ASCII strings inside its own binaries, including revisions that are no longer registered. search_blocks extracts them from your installation at runtime and orders the newest revision of each name first. No signature data is included in this repository — the signatures are nTop's, and this server reads them from your licensed install rather than redistributing them.
Limitations
The container format is reverse-engineered and verified only against nTop 5.54.2.
inspect_notebookreports the version each file records; treat other versions as unverified and keep backups.Editing tools write in place unless you pass
output. They refuse to write a graph that fails validation, but they cannot know whether an edit is semantically right for your model.run_notebookneeds an nTop Automate licence. Without one,ntopclexits after login and the error is surfaced.Windows only in practice, since that is where nTop runs.
Development
npm run check # type-check src and test
npm test # build, then run the test suite
npm run format:check # Prettier is enforced by config, not by CITests are self-contained and do not require nTop. Two suites widen given more to work with:
NTOP_TEST_NOTEBOOKS— semicolon-separated.ntoppaths, round-tripped byte for byte. This is gated on the paths you supply, not on nTop being installed. No notebooks ship with the repository, so the round-trip claim above is one you should re-verify against your own files rather than take on trust.The catalog suite scans a real installation when one is found, and skips otherwise.
License
MIT — see LICENSE.
Not affiliated with or endorsed by nTop. "nTop" and "nTopology" are trademarks of their respective owner.
Available Tools
14 toolsadd_blockA
Add a computed block. Give the full typed signature from search_blocks. Inputs are source block ids in parameter order; use 0 for an unconnected optional input. A list parameter takes exactly one core.list block.
Inputs: func (required), name (required), type (required), inputs (required), +3 more.
add_literalC
Add a literal block holding a constant. Value shape follows nTop: a length scalar is {"isFinite":true,"units":{"length":1},"val":0.005} in metres, a point is an array of three such objects, an enum is {"enum":0}.
Inputs: name (required), type (required), value (required), notebook (required), +2 more.
environmentB
Report whether ntopcl and an nTop installation were found, and how many block signatures are visible.
Inputs: no named parameters.
find_exampleA
Search nTop's own shipped documentation for a block: working example notebooks and HTML reference pages. Consult this BEFORE reverse-engineering a block's wiring - nTop ships 100+ example .ntop files that show the correct inputs, literal shapes and property paths.
Inputs: query (required), documentationRoot.
inspect_notebookA
Summarise a .ntop notebook: nTop version it was written by, its sections, how many blocks and literal values it holds, and what the root block evaluates.
Inputs: notebook (required).
mesh_statsA
Measure an STL: volume, surface area, bounding box, watertightness and connected components. Use this to check what a notebook actually produced.
Inputs: path (required), listComponents.
prune_graphA
Point the root block at the given outputs and drop every block no longer reachable. Use this to cut a large notebook down to one chain before running it.
Inputs: notebook (required), rootInputs (required), output.
read_graphA
List the blocks in a notebook with their typed signatures, wiring and literal values. Use filter to narrow by block name or signature.
Inputs: notebook (required), limit, filter.
run_notebookB
Execute a notebook headlessly through nTop Automate (ntopcl) and return its errors, warnings and per-block timings. Requires an nTop Automate licence.
Inputs: notebook (required), save, timeoutMs, inputsJson, +1 more.
search_blocksA
Search the block signatures present in the installed nTop binaries. Returns the exact typed signature strings that add_block needs, newest revision of each name first. The binaries retain retired revisions, and nTop rejects those with the same error it gives an unlicensed toolkit - so prefer the highest [version] and distrust a bare unversioned form.
Inputs: query (required), limit, installRoot.
set_inputA
Rewire one input slot of a block to a different source block. Use 0 to disconnect.
Inputs: slot (required), blockId (required), notebook (required), sourceId (required), +1 more.
set_literal_valueC
Set the value of a literal block - a scalar, file path, vector, point, boolean or enum. Writes in place unless output is given.
Inputs: value (required), blockId (required), notebook (required), output.
set_outputA
Choose which block ntopcl reports as the notebook output. Required before run_notebook's outputJson will produce anything - nTop reads the graph's own output key, not the root group's inputs, and answers "can't find output in notebook" when it is unset. Pass -1 to clear.
Inputs: blockId (required), notebook (required), output.
validate_graphA
Check a notebook for problems that stop it loading or building: dangling inputs, duplicate ids, literals with no value, and list parameters wired with several inline edges instead of a core.list block.
Inputs: notebook (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose: adding literals vs. setting their values, reading the graph vs. inspecting the notebook, validating vs. running, searching blocks vs. finding examples. No two tools appear to do the same thing, so an agent can reliably pick the right one.
The vast majority of tools follow a consistent verb_noun snake_case pattern (add_literal, search_blocks, set_output). Two exceptions break the pattern: 'mesh_stats' is a noun_noun compound and 'environment' is a bare noun, which slightly reduces predictability but does not cause real confusion.
14 tools is well within the sweet spot for a domain-specific server. Each tool addresses a distinct step in the notebook lifecycle—inspection, editing, validation, execution, and analysis—earning its place without bloat or obvious omission.
The tool surface covers the core workflow: read/inspect/validate, add and modify blocks/literals, rewire inputs, set outputs, run, and check results. Minor gaps exist (e.g., no explicit block deletion, no direct 'save notebook' tool), but existing tools like prune_graph and set_input can work around these without agent failure.
Maintenance
Related MCP Connectors
Control Unreal Engine to browse assets, import content, and manage levels and sequences. Automate…
Manage SysML2 projects; check, evaluate, verify, query, document and diagram models.
Geometry and CAD file metadata extraction for STL, OBJ, PLY, PCD, LAS/LAZ, glTF/GLB.
Formula-backed WorkPaper tools for workbook readback, input edits, and JSON persistence.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables automated control of Ansys Workbench, Mechanical, and MAPDL through scripted journals and batch processing for simulation workflows.102MIT
- FlicenseNot gradedqualityDmaintenanceEnables programmatic CAD modeling with Onshape through document discovery, parametric sketching, feature management, and gear creation.-
- AlicenseNot gradedqualityDmaintenanceEnables building and modifying parametric solid models in a local SOLIDWORKS installation via the COM API.MIT
- FlicenseNot gradedqualityDmaintenanceEnables control of a live SOLIDWORKS session through the Windows COM API, providing native sketch, feature, body, reference-geometry, view, probe, and export operations, along with transactional CAD plans, parametric sketches, multibody tools, and deterministic raster-to-sketch vectorization pipelines.1-