# NetLogo MCP

This MCP server lets an AI create, run, and inspect NetLogo agent-based models in conversation. Use it for simulations and parameter experiments.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 27
- Author: Razee4315
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Razee4315/NetLogo-MCP
- Updated: 2026-08-01
- HTML: https://affpapa.org/en/nevibecode/mcp/netlogo-mcp

## What it 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.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `NETLOGO_HOME`, `JAVA_HOME`, `NETLOGO_GUI` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env NETLOGO_HOME=<NETLOGO_HOME> --env JAVA_HOME=<JAVA_HOME> --env NETLOGO_GUI=<NETLOGO_GUI> --transport stdio netlogo-mcp -- uvx netlogo-mcp
```
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>

### Codex

**Platform CLI**
```bash
codex mcp add netlogo-mcp --env NETLOGO_HOME=<NETLOGO_HOME> --env JAVA_HOME=<JAVA_HOME> --env NETLOGO_GUI=<NETLOGO_GUI> -- uvx netlogo-mcp
```
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>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e NETLOGO_HOME=<NETLOGO_HOME> -e JAVA_HOME=<JAVA_HOME> -e NETLOGO_GUI=<NETLOGO_GUI> netlogo-mcp uvx netlogo-mcp
```
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>

## When to use it
- 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
- 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.

## Similar
- [Zotero MCP](https://affpapa.org/en/nevibecode/mcp/zotero-mcp.md) — MCP server · ★ 5548
- [arxiv-mcp-server](https://affpapa.org/en/nevibecode/mcp/arxiv-mcp-server.md) — MCP server · ★ 3231
- [PaperBanana](https://affpapa.org/en/nevibecode/mcp/paperbanana.md) — MCP server · ★ 2417
- [MATLAB MCP Server](https://affpapa.org/en/nevibecode/mcp/matlab-mcp-server.md) — MCP server · ★ 1716
- [Hex Research](https://affpapa.org/en/nevibecode/mcp/hex-research.md) — MCP server · ★ 583
- [DocsAgent — Zotero, Obsidian & Apple Notes MCP Server](https://affpapa.org/en/nevibecode/mcp/docsagent-zotero-obsidian-apple-notes-mcp-server.md) — MCP server · ★ 578

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
