Skip to main content

Claude Code Plugin

The CppModel Toolkit is a free plugin for Claude Code that knows the CppModel libraries and the Workspace API. It sets up your build environment, brings existing controller code under simulation, writes and debugs simulation tests, runs simulations with different inputs and parameters, and queries results, without leaving your editor or terminal.

The plugin has two parts:

  • Skills that tell Claude how to work with CppModel projects. They run locally, in your project.
  • The cppmodel MCP server at https://mcp.cppmodel.com/mcp, which gives Claude access to your workspace: simulations, execution history, results, and the inputs and parameters for the next run.

Requirements​

  • Claude Code.
  • A CppModel account, free or licensed. Installing the plugin needs no account, but the MCP server and running simulations do.

Installation​

In Claude Code, add the CppModel marketplace and install the plugin:

/plugin marketplace add https://github.com/Control-Edge/cppmodel-claude.git
/plugin install cppmodel@cppmodel-tools

To update the plugin later, run /plugin marketplace update cppmodel-tools.

Connect the MCP server​

The plugin registers the cppmodel MCP server for you. You don't need to add it yourself. Before Claude can read your results, sign in once:

  1. Run /mcp in Claude Code.
  2. Select the cppmodel server and choose Authenticate.
  3. Sign in with your CppModel account in the browser window that opens.

Claude Code stores the login and refreshes it, so you only do this once per machine. The server uses OAuth, so your password never passes through Claude.

The server connects to the workspace that belongs to your account:

  • Licensed accounts use their dedicated w<number>.cppmodel.com workspace.
  • Free accounts use the shared free-workspace.cppmodel.com workspace. Results there are visible to everyone else on the free tier, so don't run simulations with confidential data in it.

At the start of a session, Claude tells you which account and workspace it is signed in to, so you can stop it if it's the wrong one. To switch accounts, run /mcp, clear the authentication for cppmodel, and sign in again.

Tools​

The skills call these tools for you. You can also ask Claude about your results directly. Inputs posted with set_inputs are per account, so other users' runs don't consume them.

ToolWhat it does
list_simulationsLists your simulations, or your team's, with their execution counts.
get_latest_resultFetches the latest execution of a simulation: its inputs, parameters and output signals.
list_executionsLists the execution history of a simulation, newest first.
get_executionFetches one past execution by id, so runs can be compared with each other.
get_binary_runsFetches the runs of one build of a simulation by run index, with pass/fail for each, such as every run of a parameter sweep. Covers runs recorded by SDK 0.7.0 or later.
get_pending_inputsShows the inputs and parameters waiting for your next execution, if any.
set_inputsPosts the inputs and parameters for your next execution, without editing or rebuilding the code. It doesn't run anything; your next run of the simulation uses them.
get_run_tokenHands Claude a short-lived access token, so a simulation binary it runs signs in as your connected account. The token is passed to that one run and never stored.
submit_executionRecords an execution that no simulation ran, such as measured or imported data, in a simulation's history. Claude only uses it when you ask.
get_guideReturns step-by-step instructions for CppModel tasks, such as creating a new project, plant model or simulation.
get_workspaceShows which account and workspace the server is connected as, with the workspace's UI and API URLs.
get_api_versionShows the Workspace API version.
delete_simulationDeletes a simulation and its entire execution history. Claude only uses it when you ask.

Troubleshooting​

  • Claude says the cppmodel tools aren't available, or reports an authentication error. Run /mcp and authenticate the cppmodel server. Claude won't work around a missing login by calling the API some other way.
  • Results are from the wrong workspace. Ask Claude which workspace it is connected to (get_workspace). If it's the wrong account, sign in again as described above.

Running simulations​

When Claude runs a simulation binary, it first asks the MCP server for a short-lived access token (get_run_token) and passes it to that one run in CPPMODEL_ACCESS_TOKEN. The run then signs in as the account you connected, reads the inputs Claude posted for it, and fails at once instead of waiting for a browser login if it can't sign in.

Runs that don't get a token, such as ctest started by you or CI jobs, sign in on their own. For those, put your credentials in a .env file at your project root:

CPPMODEL_USERNAME=...
CPPMODEL_PASSWORD=...

The binaries cache their login in a .cppmodeltoken file in the directory they run from. Keep both .env and .cppmodeltoken out of version control, for example in .gitignore:

.env
.cppmodeltoken

Skills​

Claude uses a skill automatically when your request matches it. You can also invoke one directly by name, for example /cppmodel:simulation-testing.

Set up and maintain​

SkillWhat it does
cppmodel:setup-environmentSets up a machine to build CppModel projects. It detects your OS, compilers, build tools and libraries, compares them with the SDK builds CppModel publishes, installs what's missing and the matching SDK, and verifies a build.
cppmodel:update-dependenciesDownloads the latest CppModel library for your platform and toolchain, flags interface changes, fixes affected call sites and rebuilds your project to verify the update.
cppmodel:ci-pipelineGenerates or extends a CI pipeline for GitHub Actions, GitLab CI, Bitbucket Pipelines or Gitea Actions that builds your project and runs its simulations, on the platforms and compilers CppModel publishes an SDK for.

Write simulations​

SkillWhat it does
cppmodel:decouple-componentDecouples a controller component that calls a vendor BSW, RTOS or HAL API directly, so it can run in isolation under CppModel without the real hardware or vendor SDK.
cppmodel:plant-modelBuilds a minimal plant model for a new physical mechanism, such as an actuator, motor or sensor pair. It asks about the mechanism's sensors, actuators and timing, then scaffolds a starter simulation that connects the model to your controller.
cppmodel:simulation-testingWrites, extends, builds, runs and debugs simulation tests in C or C++, including PLC controllers in Structured Text run by VirtualPLC. When a test fails, it traces the run to find why, instead of guessing from the console output.
cppmodel:verificationTurns a controller's requirements into verification rules and requirement coverage in a simulation, proves each rule can fail, and reports which requirements are covered, by which simulation and rule, and whether they passed.
cppmodel:coding-standardApplies a coding standard, such as MISRA C or MISRA C++, when it writes or changes controller code, using your own licensed copy of the rules, and remembers the choice per project.
cppmodel:languageDecides whether a new file is written in C or C++. It follows your project's existing convention, or asks once and remembers the answer.
cppmodel:documentationWrites a short Markdown document for a plant model and the controller it exercises: the signal interface, the plant's update laws, parameters, the controller's states, the simplifications made and how it is validated. It starts as a draft from your own description and is updated to match the code once the solution is settled.

Run and compare​

SkillWhat it does
cppmodel:simulationsQueries your workspace: lists your simulations, fetches the latest results, lists the execution history, and compares executions with each other.
cppmodel:simulation-inputsRuns a simulation with specific inputs and parameters without editing or rebuilding it. It finds the exact names the simulation reads, posts the values before the run, and confirms from the execution that they were used.
cppmodel:parameter-sweepRuns a simulation over a range of parameter values or input profiles, without editing or rebuilding it. It posts each run's values through the MCP server, runs the binary, and checks every run in one go. It then reports which combinations pass or fail, where the boundary lies, and the metrics you care about. For sweeps in CI and scripts, run the simulation once per case with --inputs.

Field experiments​

SkillWhat it does
cppmodel:experiment-designDesigns a data-collection plan for a real machine, focused on the behavior the plant model is least sure of. Each planned run comes with the trace the current model predicts, for you to confirm or correct before anyone drives the machine.
cppmodel:experiment-reconcileMatches the field logs to the plan, works out what the operator actually did, re-simulates it, and compares predicted and measured behavior run by run. It then proposes a minimal plant-model refinement and checks it against the same logs.

Example requests​

  • "Set up this machine so I can build the CppModel project."
  • "Add a simulation for the boom controller in src/boom.c."
  • "Our hydraulics.c calls the vendor I/O driver directly. Make it simulate-able."
  • "Model a DC motor with an encoder and wire it to the speed controller."
  • "Why did the TempControl simulation fail on the last run?"
  • "How does the latest TempControl run compare with yesterday's?"
  • "Run TempControl with the gain set to 0.8."
  • "Sweep the gain from 0.2 to 2.0 and show where the simulation starts failing."
  • "Add a GitHub Actions pipeline that runs our simulations on Linux and Windows."
  • "Plan a test session on the real machine to check the boom model."
  • "Document the boom plant model and its controller."
  • "Update the CppModel dependencies to the latest version."