MCP for agents

Your agent. Real context.

Connect your AI tools to the engineering in nsim. Discover models, review proposed changes, run supported simulations and read the evidence.

GETTING STARTEDLocal stdio adapterProtocol: MCP
On this page
01

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:

nsim MCP server
{
  "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"
      }
    }
  }
}
JSON

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.

02

Start with discovery

After your client starts the adapter, give your agent a small task that reads existing information:

Your first nsim task
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.
Agent instruction

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.

03

Inspect the model context

Ask the agent to use inspect_model_context for your chosen document. This example requests names, counts, units and warnings:

inspect_model_context · arguments
{
  "documentId": "YOUR_DOCUMENT_ID",
  "fields": ["names", "counts", "units", "warnings"],
  "page": { "pageSize": 50 }
}
JSON

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.

04

Build an agent workflow

The adapter exposes explicit tools for each stage. Discover capabilities for the connected environment before choosing a workflow.

StageTools
Inspectlist_model_entities
query_topology
inspect_study
Review and editprepare_model_change
commit_model_change
Prepare a runvalidate_execution
submit_mesh
select_mesh
Executefreeze_study
submit_run
get_run
Read evidencelist_result_datasets
list_result_fields
preview_result_query
submit_result_query
get_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.

05

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