Connect your MCP client
The nsim MCP adapter runs locally and communicates with your client over stdio. It connects to your nsim gateway, where models are saved and computation is managed.
Request developer access for the adapter source and environment setup. Use an MCP client that can launch a local process. In the supplied, prepared sim-platform checkout, the adapter starts with pnpm --filter @sim/agent-mcp start.
Add nsim to your client
In nsim, create a project-scoped token under Settings → API tokens. Choose read for the first task. Add the following server configuration to your MCP client:
{
"mcpServers": {
"nsim": {
"command": "pnpm",
"args": [
"--dir",
"/absolute/path/to/sim-platform",
"--filter",
"@sim/agent-mcp",
"start"
],
"env": {
"NSIM_GATEWAY_URL": "https://YOUR_GATEWAY",
"NSIM_API_TOKEN": "REPLACE_WITH_YOUR_TOKEN"
}
}
}
}Replace the checkout path, gateway URL and token with your own values. Store the token in your client’s secret settings where available; keep it out of prompts and source control. The placeholders above are values to replace, not environment-variable expansion.
Use the HTTPS gateway URL supplied for your environment. The adapter is a local process; this connection does not use a hosted MCP URL or OAuth.
Start with discovery
After your client starts the adapter, give your agent a small task that reads existing information:
List the nsim capabilities available to me.
Then list up to 10 documents I can read.
Report their names and document IDs.
Use read-only discovery tools.
Do not edit models or start computation.The agent uses list_capabilities and list_documents. For each new operation, it can call describe_capability to read the current schema, units, required scopes and preconditions.
You should receive document names and IDs from your authorized projects. Choose a document from that output for the next step.
Inspect the model context
Ask the agent to use inspect_model_context for your chosen document. This example requests names, counts, units and warnings:
{
"documentId": "YOUR_DOCUMENT_ID",
"fields": ["names", "counts", "units", "warnings"],
"page": { "pageSize": 50 }
}The response identifies the document, project and exact revision. The agent can inspect a Study, list model entities or query topology as the task requires. It should use returned IDs rather than infer geometry from names.
For another page of context, keep the same fields and targets and pass the returned page token and revision. If the model changes, start a fresh read.
Build an agent workflow
The adapter exposes explicit tools for each stage. Discover capabilities for the connected environment before choosing a workflow.
| Stage | Tools |
|---|---|
| Inspect | list_model_entitiesquery_topologyinspect_study |
| Review and edit | prepare_model_changecommit_model_change |
| Prepare a run | validate_executionsubmit_meshselect_mesh |
| Execute | freeze_studysubmit_runget_run |
| Read evidence | list_result_datasetslist_result_fieldspreview_result_querysubmit_result_queryget_result_query_report |
Example: revise an existing cycle
For a compatible multibody Study, an agent can inspect the current commands and saved checks, propose shorter ramp durations, prepare a duration-only change, and commit the reviewed result. It then freezes and runs each candidate and compares the published checks.
The timing workflow preserves the existing geometry, motion targets and engineering limits. The Python timing recipe demonstrates the same operation sequence.
Keep the evidence with the answer
Result queries use saved datasets, fields and sample times. Ask the agent to report units, the run and dataset identities, and the checks behind its conclusion. A completed run and a passed engineering check are separate results.
Model edits use prepare-and-commit review. Retain request IDs for commit, freeze and submission so interrupted requests can be recovered through their receipt tools.
Choose the right project access
Tokens specify both the projects an agent can access and the operations it can perform. Each scope is explicit:
- read
- Discover capabilities, inspect authorized models and read saved data.
- edit
- Apply supported, reviewed model changes.
- run
- Submit supported compute operations, including simulations and result analysis.
A complete author → run → query workflow needs all three. Access follows the token issuer’s current permissions and is rechecked on each request.
MCP provides supported engineering operations, with current schemas available through discovery. Use the browser or Python for file upload; the adapter does not accept raw file bytes.
Your next step
Build with your own models.
Get access to nsim and the developer setup for your team.
Request access