Skip to main content
Glama
README.md
# mcp-lansweeper

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for **Lansweeper**, providing AI assistants with access to IT asset management, software inventory, user discovery, and scanning reports through the Lansweeper GraphQL API.

## Features

**12 tools** across four categories:

### Asset Management
| Tool | Description |
|------|-------------|
| `list_assets` | List assets with pagination, optional name/type filters |
| `get_asset` | Get detailed information for a specific asset by ID |
| `search_assets` | Search assets by name, IP address, MAC address, or OS |

### Software Inventory
| Tool | Description |
|------|-------------|
| `list_software` | List installed software across all assets, filterable by name or publisher |
| `get_asset_software` | Get all software packages installed on a specific asset |

### User Discovery
| Tool | Description |
|------|-------------|
| `list_users` | List user accounts discovered by Lansweeper scans |
| `get_user` | Get details of a specific user including their associated assets |

### Reports & Overview
| Tool | Description |
|------|-------------|
| `list_asset_types` | List all asset type categories with counts |
| `get_scan_summary` | Get scanning status overview with asset counts and scanner info |
| `list_sites` | List all Lansweeper sites accessible with the configured application ID |
| `get_recently_scanned_assets` | Get assets most recently scanned or updated |

## Installation

```bash
git clone git@github.com:fredriksknese/mcp-lansweeper.git
cd mcp-lansweeper
npm install
npm run build
```

## Configuration

The server is configured via environment variables:

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `LANSWEEPER_APPLICATION_ID` | Yes | — | Application ID / API token from Lansweeper developer settings |
| `LANSWEEPER_SITE_ID` | No | — | Default site ID for site-specific queries |

### Generating an Application ID

1. Log in to your Lansweeper Cloud account
2. Go to **My Lansweeper** > **Integrations** > **Developer Tools**
3. Create a new application and copy the Application ID
4. Use this value as `LANSWEEPER_APPLICATION_ID`

## Usage with Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "lansweeper": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-lansweeper/dist/index.js"],
      "env": {
        "LANSWEEPER_APPLICATION_ID": "your-application-id",
        "LANSWEEPER_SITE_ID": "your-site-id"
      }
    }
  }
}
```

## Usage with Claude Code

Add to your Claude Code MCP settings:

```bash
claude mcp add lansweeper -- node /absolute/path/to/mcp-lansweeper/dist/index.js
```

Set the required environment variables before running, or configure them in your MCP settings.

## Example Prompts

Once connected, you can ask your AI assistant things like:

- *"List all Windows workstations in Lansweeper"*
- *"Search for assets with IP address 192.168.1.x"*
- *"What software is installed on asset ID abc123?"*
- *"Find all assets running Windows Server 2019"*
- *"List all users discovered in the CORP domain"*
- *"Show me the asset inventory summary with counts by type"*
- *"Which assets were scanned most recently?"*
- *"Find all devices that have Chrome installed"*
- *"List all Lansweeper sites and their asset counts"*

## Development

```bash
npm run dev      # Run with tsx (auto-reloads)
npm run build    # Compile TypeScript to dist/
npm start        # Run compiled output
```

## Architecture

```
src/
├── index.ts                # Entry point — creates MCP server + STDIO transport
├── lansweeper-client.ts    # GraphQL client for Lansweeper API
└── tools/
    ├── assets.ts           # Asset list, get, search (3 tools)
    ├── software.ts         # Software inventory (2 tools)
    ├── users.ts            # User discovery (2 tools)
    └── reports.ts          # Reports, summaries, sites (4 tools)
```

## API Details

The server communicates with the Lansweeper GraphQL API at `https://api.lansweeper.com/api/v2/graphql` using Bearer token authentication. All tools support optional site-specific queries via the `site_id` parameter or the `LANSWEEPER_SITE_ID` environment variable.

## Requirements

- Node.js 18+
- Lansweeper Cloud account with API access
- Application ID from Lansweeper developer settings

## License

SEE LICENSE IN LICENSE

TDQS

A3.6/5.0

Scored across 11 tools

Disambiguation4/5

Most tools target clearly distinct resources (assets, software, users, sites, scan summary). However, list_assets (with optional name/type filters) and search_assets (by name/IP/MAC/OS) have overlapping intent, and get_recently_scanned_assets could be seen as a variant of list_assets, so an agent may occasionally hesitate between them.

Naming Consistency5/5

Every tool follows a consistent verb_noun snake_case pattern (list_*, get_*, search_*), with resource names that are predictable and readable. No mixing of conventions or vague standalone verbs.

Tool Count5/5

Eleven tools is a well-scoped surface for an IT asset inventory server, with each tool covering a distinct resource or view (asset, software, user, type, site, scan status). Nothing feels padded or missing.

Completeness4/5

The read-only discovery surface is solid: assets, per-asset software, users, asset type breakdown, sites, scan summary, and recency. Minor gaps exist, such as no direct site-detail retrieval by ID, no combined asset-detail-plus-software call, and no filtering of users by site/domain.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues