NetLogo MCP — Claude Code MCP server: what it does, install
This MCP server lets an AI create, run, and inspect NetLogo agent-based models in conversation. Use it for simulations and parameter experiments.
claude mcp add --env NETLOGO_HOME=<NETLOGO_HOME> --env JAVA_HOME=<JAVA_HOME> --env NETLOGO_GUI=<NETLOGO_GUI> --transport stdio netlogo-mcp -- uvx netlogo-mcpWhat NetLogo MCP does
NetLogo MCP gives an AI client access to NetLogo models. The agent can write model code, launch runs, and return tick-level results as markdown tables. It can inspect the world, sample agents and patch grids, then export the model view as a PNG image.
The server also supports BehaviorSpace experiments with parallel parameter sweeps through NetLogo’s headless launcher. A regular NetLogo window can show a run live, while headless mode fits CI and server workflows. Its MCP resources include references for NetLogo primitives, the programming guide, and the NetLogo 6 to 7 transition.
You need Python 3.10+, Java JDK 11+, and NetLogo 7.0+ before configuration. Without the JDK and a NetLogo installation, model runs will fail; their locations are passed through JAVA_HOME and NETLOGO_HOME. Supported clients include Claude Code, Codex, Cursor, GitHub Copilot, and other MCP clients listed on the page.
What it helps with
- build an agent-based model from a description
- run a simulation and collect tick-level results
- sweep model parameters with BehaviorSpace
- inspect agents, patches, and world state
- export the model view as a PNG
Example prompts for the agent
- Create a predator-prey model in NetLogo and run the simulation.
- Run a BehaviorSpace experiment across several parameter values and return the tick data.
- Inspect the agents and patch grid, then export the current model view as a PNG.
How to install NetLogo MCP
Platform CLI
claude mcp add --env NETLOGO_HOME=<NETLOGO_HOME> --env JAVA_HOME=<JAVA_HOME> --env NETLOGO_GUI=<NETLOGO_GUI> --transport stdio netlogo-mcp -- uvx netlogo-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from netlogo-mcp <command>
Platform CLI
codex mcp add netlogo-mcp --env NETLOGO_HOME=<NETLOGO_HOME> --env JAVA_HOME=<JAVA_HOME> --env NETLOGO_GUI=<NETLOGO_GUI> -- uvx netlogo-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from netlogo-mcp <command>
Config file
{
"mcpServers": {
"netlogo-mcp": {
"command": "uvx",
"args": [
"netlogo-mcp"
],
"env": {
"NETLOGO_HOME": "<NETLOGO_HOME>",
"JAVA_HOME": "<JAVA_HOME>",
"NETLOGO_GUI": "<NETLOGO_GUI>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from netlogo-mcp <command>
Config file
{
"servers": {
"netlogo-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"netlogo-mcp"
],
"env": {
"NETLOGO_HOME": "<NETLOGO_HOME>",
"JAVA_HOME": "<JAVA_HOME>",
"NETLOGO_GUI": "<NETLOGO_GUI>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from netlogo-mcp <command>
Platform CLI
gemini mcp add -e NETLOGO_HOME=<NETLOGO_HOME> -e JAVA_HOME=<JAVA_HOME> -e NETLOGO_GUI=<NETLOGO_GUI> netlogo-mcp uvx netlogo-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from netlogo-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about NetLogo MCP
How do I install NetLogo MCP in Claude Code?
Set the paths for NetLogo and the JDK, then run claude mcp add netlogo-mcp -e NETLOGO_HOME=<NETLOGO_HOME> -e JAVA_HOME=<JAVA_HOME> -- uvx netlogo-mcp. Restart Claude Code afterward.
What does NetLogo MCP do?
It lets an AI create, run, and analyze NetLogo agent-based models. The server returns simulation data, exposes world state, and exports the model view as PNG.
What does NetLogo MCP require?
Install Python 3.10+, Java JDK 11+, and NetLogo 7.0+. Configure their locations with JAVA_HOME and NETLOGO_HOME.