Create, run, and analyze NetLogo agent-based models through natural conversation
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
The first MCP (Model Context Protocol) server for NetLogo β enabling AI assistants to create, run, and analyze agent-based models through natural conversation.
Works with: Claude Code, Claude Desktop, Cursor, Windsurf, VS Code (Copilot), Cline, Continue, Roo Code, Zed, OpenCode, Codex β any tool that supports MCP.
As an AI student taking an Agent-Based Modeling course, I searched for an MCP server to control NetLogo β nothing existed. So I built one.
Instead of manually writing NetLogo code, clicking buttons, and tweaking sliders, you tell your AI assistant what you want in plain English:
"Create a predator-prey model with 100 sheep and 20 wolves. Run it for 500 ticks and show me the population dynamics."
The AI writes the code, runs the simulation, and shows you the results β all through conversation.
By default a real NetLogo window opens (on first use) so you can watch your simulations run live. Headless mode is available for CI or servers.
See docs/TOOLS.md for the full reference of all 25 tools, widget schema, and prompts.
| Requirement | Install via terminal? | How |
|---|---|---|
| Python 3.10+ | Yes | Windows: winget install Python.Python.3.12 Β· macOS: brew install python@3.12 Β· Linux: sudo apt install python3.12 |
| Java JDK 11+ | Yes | Windows: winget install EclipseAdoptium.Temurin.21.JDK Β· macOS: brew install --cask temurin Β· Linux: sudo apt install openjdk-21-jdk |
| NetLogo 7.0+ | No β manual | Download from ccl.northwestern.edu/netlogo |
Only NetLogo requires manual download. Everything else can be installed via terminal, and the Zero-Config Setup prompt below handles those automatically.
If you're using an AI coding tool, copy the prompt below into your chat. The AI will detect your OS, find your NetLogo and Java installations, clone the repo, install dependencies, configure your MCP client, and tell you how to use it.
Then add the server to your MCP client. For Claude Code, add to your project's .mcp.json:
Restart Claude Code and verify with /mcp.
Tip: prefer project-scope config (
.mcp.jsonin one project) over global config β a global entry loads the server in every session of every project.
Using Cursor, Windsurf, VS Code, Cline, Continue, Roo Code, Zed, OpenCode, Codex, or Claude Desktop? See docs/CLIENTS.md for exact config for all 11 clients. All configuration options (GUI/headless mode, directories, limits) are in docs/CONFIGURATION.md.
Developing or contributing? Clone the repo and install editable instead:
The image bakes in NetLogo (headless) with its bundled JRE β no host install needed:
MCP client config:
Docker runs headless only (no GUI mode). Add -v ./exports:/data/exports to keep exported views and worlds on the host.
Once connected, try these prompts in any MCP client:
The first model tool call takes 30-60 seconds while the JVM starts β the NetLogo window appears when it's ready. Don't click stop. Every call after that is instant.
| Problem | Solution |
|---|---|
NETLOGO_HOME is not set | Set the environment variable to your NetLogo install directory |
JAVA_HOME is not set | Set it to your JDK directory (not JRE) |
| JVM crashes on startup | Make sure JAVA_HOME points to JDK 11+, not an older version |
No model is loaded | Call open_model or create_model before using other tools |
| First model call hangs for 30-60s | Normal β JVM is warming up. Don't click stop. |
| NetLogo window opens when my AI client starts | You have NETLOGO_EAGER_START=true set, or an old version β by default the window only opens on first tool use |
| Server won't connect | Run netlogo-mcp manually in terminal to see error output |
If you use NetLogo MCP in research or teaching, please cite it β click "Cite this repository" in the GitHub sidebar, or see CITATION.cff.
Saqlain Abbas Email: saqlainrazee@gmail.com GitHub: @Razee4315 LinkedIn: @saqlainrazee
This project is licensed under the MIT License β free to use, modify, and distribute for any purpose.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/netlogo-mcp)<a href="https://allmcps.com/mcp/netlogo-mcp"><img src="https://allmcps.com/api/badge/netlogo-mcp?style=directory" alt="NetLogo MCP on AllMCPs" /></a>