# network-diagram-mcp [Health: Active]

**Category:** 📊 Data Visualization  
**Repository:** https://github.com/den-indance/network-diagram-mcp  
**GitHub Stars:** 3  
**npm Downloads (last month):** 188  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/network-diagram-mcp

## Description
Network topology editor — Claude builds diagrams via MCP. nmap/CSV import, one-click SSH.

## Tools
Capabilities this server exposes over MCP:

- **map_get_state** — Return all nodes, connections, stickies, notes
- **map_clear** — Clear the entire map (requires `confirm: true`)
- **map_arrange** — Naive auto-arrange (`grid` or `circle` layout — ignores connections)
- **map_suggest_layout** — Smart auto-layout: `force` (force-directed, deterministic via `seed`), `cluster-by-type` (lanes per type), or `cluster-by-connection` (BFS components into zones)
- **map_add_node** — Add a node (`type`, `name`, `ip`, `x`, `y`)
- **map_update_node** — Update node fields by id
- **map_delete_node** — Delete a node and its connections
- **map_move_node** — Move node to new coordinates
- **map_add_connection** — Add connection (`from_id`, `to_id`, `label?`, `color?`)
- **map_update_connection** — Update `label` or `color` of a connection
- **map_delete_connection** — Delete a connection by id
- **map_add_sticky** — Add a sticky note (`text`, `x?`, `y?`, `color?`)
- **map_update_sticky** — Update `text`, `color`, `x`, `y`, `w`, `h
- **map_delete_sticky** — Delete a sticky note by id
- **map_move_sticky** — Move sticky to new coordinates
- **map_list_sheets** — List all sheets with metadata and active sheet id
- **map_get_sheet_data** — Get nodes / connections / stickies for a sheet (default: active)
- **map_create_sheet** — Create a new empty sheet and switch to it
- **map_switch_sheet** — Switch active sheet by id
- **map_rename_sheet** — Rename a sheet
- **map_delete_sheet** — Delete a sheet (requires `confirm: true`, can't delete last)
- **map_set_zoom** — Set zoom level (0.1–3.0)
- **map_set_canvas_offset** — Pan canvas to absolute pixel position
- **map_zoom_to_fit** — Auto-fit all nodes into viewport
- **map_lock_sheet** — Lock (`locked: true`) or unlock (`locked: false`) a sheet. Locked sheets reject all MCP mutations and disable manual editing in the UI.
- **map_get_notes** — Get sheet-level notes text
- **map_set_notes** — Set sheet-level notes text
- **map_get_settings** — Get app settings (sshMode, showGrid, etc.)
- **map_update_settings** — Update app settings
- **map_find_node** — Structured node-only filter by `name` / `ip` / `type` / `text`. Returns stripped `{id, name, type, ip, x, y}`.
- **map_search** — Full-text cross-entity search. Looks across **nodes** (name / ip / notes), **stickies** (text), **connection labels**, and **ports** (port number + service name). Optional `types: ["nodes","stickies","connections","ports"]` narrows the scope.
- **map_get_nodes_by_type** — Return every node of a single type with **FULL** field data (ports, dockerServices, domains, ips, notes, parentServer, …). Use this when you need the complete objects, not the stripped projection from `map_find_node`.
- **map_import_sheet** — Replace active-sheet content with a provided `{nodes, connections, stickies?, notes?}` JSON.
- **map_import_nmap** — Parse `nmap -oX` output (or a pre-parsed `hosts[]` array) and create nodes with their open ports. Auto-infers node type from OS fingerprint + port profile (router / switch / firewall / server / printer / …). Nodes auto-arranged in a square-root grid.
- **map_import_csv** — Import nodes from CSV. Auto-detects columns from the header row (`name` / `ip` / `type` / `ports` / `notes` — aliases like `hostname` / `description` accepted). Ports field accepts `22/tcp,80/tcp` or bare numbers. Nodes laid out in a 6-column grid.
- **map_export_sheet** — Export a single sheet as a JSON object (auto-connections included). Legacy entry — still works.
- **map_export** — Multi-format export: `json` (object), `png` and `pdf` (base64-encoded blob + `mimeType`).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "network-diagram-mcp": {
    "command": "npx",
    "args": ["-y","@den.dance/network-diagram-mcp"],
    "env": {
      "NETMAP_MCP_PORT": ""
    }
  }
}
```

**Requires environment variables:** `NETMAP_MCP_PORT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What network-diagram-mcp MCP server does

The network-diagram-mcp MCP server gives an MCP client control of a network topology workspace in NetMap. It can read the current map, create or modify nodes and connections, place sticky notes, manage multiple sheets, and adjust the visible canvas. Nodes can carry a type, name, IP address, and position; connections can include labels and colors.

The workspace supports several map-level operations. Agents can create, rename, switch, list, and delete sheets, while sheet locking prevents both MCP mutations and manual UI editing. Sheet notes and application settings can also be read or changed. Destructive operations such as clearing a map or deleting a sheet require explicit confirmation, and the final sheet cannot be deleted.

NetMap also provides browser-side network inventory features described by the project, including nmap XML and CSV imports, searchable node information, and export to JSON, PNG, or PDF. Those features are part of the connected application rather than separate tools listed in the MCP interface.

## How it works

The network-diagram-mcp MCP server runs locally as a stdio process. The MCP client communicates with the process over standard input and output, while the process forwards requests over a local WebSocket connection to the open NetMap browser tab. NetMap applies the changes to its React state, so the diagram updates in the browser as calls are made.

Open https://map.den.dance/ before asking an agent to use the tools. The browser enables the MCP WebSocket connection by default in the documented v1.2-and-later setup. If no tab is connected, calls have no browser peer and time out. The connection can be disabled from NetMap settings under Integrations and AI Agent (MCP).

Layout support includes a basic grid or circle arrangement and three smarter strategies: force-directed placement, grouping by node type, and grouping connected components into zones. The force-directed option accepts a seed for deterministic results. The basic arrangement does not account for connections.

## Setup and configuration

Install or run the package through npx:

```bash
npx @den.dance/network-diagram-mcp
```

For Claude Desktop, add a server entry whose command is `npx` and whose argument is `@den.dance/network-diagram-mcp`. Claude Code can register the same command with `claude mcp add`, then verify it with `claude mcp list`. Cursor is also identified by the project as an MCP client.

The `NETMAP_MCP_PORT` environment variable changes the local WebSocket port from its default of `47821`. The configured port must match the port set in NetMap's AI Agent integration settings.

The package also includes optional commands for registering SSH, PostgreSQL, and Redis URL handlers, detecting installed clients, and running a local daemon. For example, `install --all` registers all supported schemes, while `serve` starts the WebSocket and HTTP daemon on the configured port. These commands support the browser's in-app client picker but are separate from the default stdio MCP process.

## Tools and capabilities

The exposed tools cover:

- Reading and clearing map state, finding nodes by name, IP, type, or text, and applying layouts.
- Adding, updating, moving, and deleting nodes and their connections.
- Creating, editing, moving, and deleting sticky notes.
- Creating, switching, renaming, listing, locking, and deleting sheets.
- Setting zoom, panning the canvas, and fitting all nodes to the viewport.
- Reading and writing sheet notes and application settings.

The network-diagram-mcp MCP server is suited to agent-assisted diagram creation, inventory visualization, topology cleanup, and controlled updates to an existing map. It is less suitable when the agent must work without a browser session or when the map must be hosted remotely by the MCP process itself.

_Full upstream README: https://allmcps.com/mcp/network-diagram-mcp/readme_

