Skip to main content
Glama
NinjaOne MCP Server

NinjaOne MCP Server

NinjaOne MCP Server

A comprehensive Model Context Protocol (MCP) server that integrates NinjaOne RMM with Claude. Manage devices, automate IT tasks, handle ticketing, monitor patch status, and execute remote scriptsβ€”all through natural language conversation with Claude AI.

What is an MCP? A Model Context Protocol server extends Claude's capabilities by providing access to external systems and APIs. This server bridges Claude and NinjaOne, enabling AI-powered IT management.

✨ Key Features

πŸ–₯️ Device Management

  • List, search, and get detailed information about devices

  • Monitor device status, health, and connectivity

  • Track active alerts and notifications

  • Search devices using NinjaOne filter syntax

πŸš€ Device Actions

  • Reboot devices (graceful or forced)

  • Execute scripts and built-in actions remotely

  • Automate IT tasks across your infrastructure

πŸ”§ Patch & Software Management

  • View OS and software patch status

  • Track patch compliance

  • Inventory installed software across devices

  • Identify outdated or vulnerable software

🎫 Ticketing System

  • Create support tickets programmatically

  • Query existing tickets

  • Update ticket information

  • Add comments and notes

πŸ“Š Reporting & Monitoring

  • Device health reports

  • Antivirus status across fleet

  • Organization-wide reporting

  • Custom queries via generic API access

πŸ” Enterprise Security

  • OAuth 2.0 authentication with automatic token refresh

  • No credentials in version control (environment variables only)

  • Full support for NinjaOne's security model

  • TypeScript for type safety

βš™οΈ Production Ready

  • Node.js 20 LTS

  • Comprehensive error handling

  • Pagination support for large datasets

  • 20+ API tools for complete NinjaOne integration


Related MCP server: datto-rmm-mcp

πŸš€ Quick Start

Prerequisites

  • Node.js 20 LTS or higher (Download)

  • npm (included with Node.js)

  • NinjaOne account with API access

  • Claude Desktop (for MCP integration)

Installation (5 minutes)

  1. Clone the repository:

git clone https://github.com/SoroushAlamdari/ninjaone-mcp.git
cd ninjaone-mcp
  1. Install dependencies:

npm install
  1. Build the server:

npm run build
  1. Configure NinjaOne credentials (see OAuth Setup below)


πŸ” OAuth Setup (Required)

This server uses OAuth 2.0 client credentials flow for secure API access. Follow these steps:

Step 1: Create OAuth Application in NinjaOne

  1. Log into your NinjaOne Dashboard

  2. Go to Admin/Settings β†’ API β†’ Client app IDs

  3. Click + Create application

  4. Fill in the form:

    • Application platform: API Services (machine-to-machine)

    • Name: Claude MCP (or your preferred name)

    • Scopes: Check Monitoring, Management, Control

    • Allowed grant types: Check Client credentials

  5. Click Create and copy the generated credentials

Step 2: Add Credentials to Environment

Create a .env file in the project root:

cp .env.example .env

Edit .env and add your credentials:

NINJA_CLIENT_ID=<your_client_id_here>
NINJA_CLIENT_SECRET=<your_client_secret_here>
NINJA_API_BASE_URL=https://your-instance.ninjarmm.com

⚠️ Security: Never commit .env or token.json to version control. .gitignore covers both. Keep real values out of .env.example β€” it is committed.

How tokens are handled

  • On start the server loads token.json if present, otherwise requests a token with client credentials.

  • Before each API call it renews the token if it is within a minute of expiry, and if NinjaOne still answers 401 it renews once and retries.

  • Every new token is saved to token.json, so restarts don't break the connection.

Alternative: browser login (Web app + refresh token)

If you can only use a Web client app, enable the Authorization code and Refresh token grants on it, then run once:

node get-oauth-token.js

Open the printed link, sign in, and the token (with refresh token) is saved to token.json. The script reads credentials from .env or from your Claude Desktop config. If NinjaOne answers Invalid scope offline_access, the app isn't allowed refresh tokens β€” use the API Services app above instead.


πŸ€– Claude Desktop Integration

Windows Setup

  1. Edit Claude Desktop config:

    • Open: C:\Users\YourUsername\AppData\Roaming\Claude\claude_desktop_config.json

    • Or use: %APPDATA%\Claude\claude_desktop_config.json

  2. Add this to the mcpServers section:

{
  "mcpServers": {
    "ninjaone-mcp": {
      "command": "node",
      "args": [
        "C:\\Users\\YourUsername\\ninjaone-mcp\\dist\\index.js"
      ],
      "env": {
        "NINJA_CLIENT_ID": "<your_client_id>",
        "NINJA_CLIENT_SECRET": "<your_client_secret>",
        "NINJA_API_BASE_URL": "https://your-instance.ninjarmm.com"
      }
    }
  }
}

macOS Setup

  1. Edit Claude Desktop config:

    • Run: nano ~/.claude/claude_desktop_config.json

  2. Add MCP configuration (same structure as Windows above, using macOS paths):

{
  "mcpServers": {
    "ninjaone-mcp": {
      "command": "node",
      "args": [
        "/Users/YourUsername/ninjaone-mcp/dist/index.js"
      ],
      "env": {
        "NINJA_CLIENT_ID": "<your_client_id>",
        "NINJA_CLIENT_SECRET": "<your_client_secret>",
        "NINJA_API_BASE_URL": "https://your-instance.ninjarmm.com"
      }
    }
  }
}

3. Start Using It

  1. Close and reopen Claude Desktop

  2. Look for the NinjaOne connector in the Connectors panel

  3. Start using the tools:

    "List all my devices"
    "Show me critical alerts"
    "Get patch status for my servers"
    "Create a ticket for offline devices"
    "Run an inventory scan on all workstations"

Verification Checklist

  • NinjaOne MCP appears in Claude Desktop Connectors list

  • All 20+ tools are visible (no "no tools available" message)

  • Test with: "List my devices"

  • Devices appear in the response


πŸ“š Available Tools (20+ API Functions)

Device Management (5 tools)

Tool

Purpose

list_devices

List all devices with pagination and filtering

get_device

Get detailed information about a specific device

search_devices

Search devices using NinjaOne filter syntax

get_device_alerts

Get active alerts for a device

get_all_alerts

Get all active alerts across your fleet

Device Actions (2 tools)

Tool

Purpose

reboot_device

Reboot a device (graceful or forced shutdown)

run_script

Execute a script or built-in action on a device

Patch Management (2 tools)

Tool

Purpose

get_os_patches

View OS patch status for a device

get_software_patches

View software patch status for a device

Software & Inventory (1 tool)

Tool

Purpose

get_device_software

View installed software on a device

Ticketing (4 tools)

Tool

Purpose

create_ticket

Create a new support ticket

get_ticket

Retrieve ticket details

update_ticket

Update ticket information and status

add_ticket_comment

Add a comment to a ticket

Organization & Contacts (3 tools)

Tool

Purpose

list_organizations

List all organizations

get_organization

Get organization details

list_contacts

List all contacts in your account

Reports & Monitoring (2 tools)

Tool

Purpose

get_device_health

Generate a device health report

get_antivirus_status

Get antivirus status across all devices

Advanced/Generic API (2 tools)

Tool

Purpose

api_get

Make a GET request to any NinjaOne API endpoint

api_post

Make a POST request to any NinjaOne API endpoint


πŸ’¬ Example Use Cases

Ask Claude any of these:

"List all my devices and show their status"
"Which devices haven't checked in for more than 24 hours?"
"Show me all critical and high-severity alerts"
"Get patch compliance report for all Windows servers"
"Create a ticket for all offline devices"
"Search for all devices with antivirus disabled"
"Run a compliance script on all workstations in Location XYZ"
"Show me devices running outdated versions of software"
"Get a summary of device health across the organization"
"Which devices need OS updates?"

πŸ“‘ API Methods & Endpoints

All tools communicate with NinjaOne API v2.0 using the following base URL:

https://<your-instance>.ninjarmm.com/api/v2

Authentication Header

All requests include:

Authorization: Bearer <access_token>
Content-Type: application/json

Tool Reference with API Methods

Tool

HTTP Method

Endpoint

Description

list_devices

GET

/devices

Retrieve paginated device list

get_device

GET

/devices/{id}

Get single device details

search_devices

GET

/devices?filter=...

Search using filter syntax

get_device_alerts

GET

/devices/{id}/alerts

Get alerts for device

get_all_alerts

GET

/alerts

Get all active alerts

reboot_device

POST

/devices/{id}/reboot

Initiate device reboot

run_script

POST

/devices/{id}/scripts

Execute script on device

get_os_patches

GET

/devices/{id}/patches/os

Get OS patch status

get_software_patches

GET

/devices/{id}/patches/software

Get software patch status

get_device_software

GET

/devices/{id}/software

Get installed software

create_ticket

POST

/tickets

Create support ticket

get_ticket

GET

/tickets/{id}

Get ticket details

update_ticket

PATCH

/tickets/{id}

Update ticket

add_ticket_comment

POST

/tickets/{id}/comments

Add ticket comment

list_organizations

GET

/organizations

List all organizations

get_organization

GET

/organizations/{id}

Get org details

list_contacts

GET

/contacts

List all contacts

get_device_health

GET

/reports/device-health

Get device health report

get_antivirus_status

GET

/reports/antivirus

Get antivirus report

api_get

GET

/{path}

Custom GET request

api_post

POST

/{path}

Custom POST request

Example API Calls

List Devices (with pagination):

curl -X GET "https://your-instance.ninjarmm.com/api/v2/devices?pageNo=1&pageSize=50" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Get Device Details:

curl -X GET "https://your-instance.ninjarmm.com/api/v2/devices/12345" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Search Devices with Filter:

curl -X GET "https://your-instance.ninjarmm.com/api/v2/devices?filter=status=online" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Create a Ticket:

curl -X POST "https://your-instance.ninjarmm.com/api/v2/tickets" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Device Offline",
    "description": "Device XYZ is offline",
    "priority": "high"
  }'

Reboot a Device:

curl -X POST "https://your-instance.ninjarmm.com/api/v2/devices/12345/reboot" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "graceful"}'

NinjaOne API Documentation

For complete API reference and additional endpoints:


πŸ› οΈ Development

Build Production Code

npm run build

Watch Mode (Auto-rebuild on changes)

npm run dev

Type Checking

npm run type-check

Run Tests

npm test

Project Structure

ninjaone-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts           # MCP server entry point
β”‚   β”œβ”€β”€ api-client.ts      # NinjaOne API wrapper
β”‚   β”œβ”€β”€ oauth.ts           # OAuth 2.0 handling
β”‚   β”œβ”€β”€ tools.ts           # Tool definitions
β”‚   └── types.ts           # TypeScript interfaces
β”œβ”€β”€ dist/                  # Compiled JavaScript (auto-generated)
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ”’ Security Best Practices

βœ… Do:

  • βœ… Use .env file for credentials (already in .gitignore)

  • βœ… Rotate OAuth credentials regularly

  • βœ… Limit API scopes to what you need

  • βœ… Use strong, unique client secrets

  • βœ… Monitor API usage in NinjaOne

❌ Don't:

  • ❌ Commit .env file to version control

  • ❌ Share credentials or secrets

  • ❌ Use credentials in code or logs

  • ❌ Store secrets in comments

  • ❌ Log sensitive information


πŸ› Troubleshooting

"NinjaOne MCP connector not appearing in Claude Desktop"

  • Verify dist/index.js exists: ls dist/

  • Rebuild: npm run build

  • Check JSON syntax: Use jsonlint.com

  • Close and fully reopen Claude Desktop (don't just restart)

  • Check file paths match your installation

"Invalid or missing credentials"

  • Verify credentials in .env file (not in config file)

  • Check for extra spaces or quotes in values

  • Regenerate credentials in NinjaOne if unsure

  • Ensure API application has correct scopes: Monitoring, Management, Control

"Cannot find module errors"

  • Run: npm install

  • Delete node_modules folder and reinstall: rm -rf node_modules && npm install

"node: command not found"

  • Verify Node.js 20+ is installed: node --version

  • On Windows, use full path or add Node to PATH

  • On macOS/Linux, ensure /usr/local/bin is in PATH

Enable Debug Logging

Set environment variable and rebuild:

export DEBUG=1    # Linux/macOS
set DEBUG=1       # Windows
npm run build

πŸ“– API Documentation

For detailed NinjaOne API documentation:


πŸ“„ License

MIT License - See LICENSE file for details

Free to use, modify, and distribute.


🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository

  2. Create a feature branch

  3. Test your changes

  4. Submit a pull request


πŸ’‘ Support


πŸ“Š Project Stats

  • Language: TypeScript

  • Runtime: Node.js 20 LTS

  • API Integration: NinjaOne RMM v2.0

  • Protocol: Model Context Protocol (MCP)

  • Authentication: OAuth 2.0

  • Tools: 20+

Available Tools

21 tools
add_ticket_commentC

Add a comment to a ticket

Inputs: comment (required), ticket_id (required).

api_getC

Make a generic GET request to any NinjaOne API endpoint

Inputs: path (required).

api_postC

Make a generic POST request to any NinjaOne API endpoint

Inputs: data (required), path (required).

create_ticketC

Create a new support ticket

Inputs: title (required), priority, description.

get_all_alertsB

Get all active alerts across all devices

Inputs: pageNo, pageSize.

get_antivirus_statusC

Get antivirus status report

Inputs: no named parameters.

get_deviceB

Get detailed information about a specific device

Inputs: device_id (required).

get_device_alertsB

Get active alerts for a specific device

Inputs: device_id (required).

get_device_healthB

Get device health report

Inputs: no named parameters.

get_device_softwareC

Get software inventory for a device

Inputs: device_id (required).

get_organizationC

Get organization details

Inputs: org_id (required).

get_os_patchesC

Get OS patches status for a device

Inputs: device_id (required).

get_software_patchesC

Get software patches status for a device

Inputs: device_id (required).

get_ticketC

Get ticket details

Inputs: ticket_id (required).

list_contactsB

List all contacts

Inputs: no named parameters.

list_devicesC

List all devices in the NinjaOne system with optional pagination and filtering

Inputs: filter, pageNo, pageSize.

list_organizationsC

List all organizations

Inputs: no named parameters.

reboot_deviceC

Reboot a device

Inputs: device_id (required), mode.

run_scriptC

Run a script or built-in action on a device

Inputs: device_id (required), script_id (required), parameters.

search_devicesC

Search for devices using filter syntax

Inputs: filter (required).

update_ticketC

Update a ticket

Inputs: ticket_id (required), title, status, description.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 21 tools

    Disambiguation3/5

    Most specific tools target distinct resources and actions, but generic api_get/api_post overlap with nearly every read/create tool, and list_devices versus search_devices has fuzzy boundaries. Descriptions help, but an agent could reasonably misselect between generic and specific tools or between list and search.

    Naming Consistency4/5

    Nearly all tools use a predictable snake_case verb_noun pattern such as list_devices, get_ticket, create_ticket, and run_script. api_get and api_post are minor deviations since they read as resource_verb rather than verb_resource, but overall the naming is consistent.

    Tool Count4/5

    At 21 tools this is above the typical 3-15 range, but NinjaOne is a broad RMM domain covering devices, alerts, patches, software, tickets, organizations, health, antivirus, and contacts. The tools mostly earn their place, though the generic api_* tools add some redundancy.

    Completeness3/5

    Core areas are covered for devices, alerts, patches, software, tickets, organizations, health, antivirus, and contact listing, but there are notable lifecycle gaps such as no list_tickets, no contact get/create/update/delete, and no organization create/update. The generic api_get/api_post partially mitigate these gaps but do not cover full CRUD because they only expose GET and POST.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to interact with NinjaOne, providing tools for managing devices, organizations, alerts, and tickets. Uses a decision tree architecture to load domain-specific tools on demand.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to interact with Datto RMM accounts for device, alert, site, and quick job management through natural language.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables management of NinjaOne devices, organizations, alerts, and tickets through natural language, using a navigation-based tool selection for efficient interaction.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to interact with the NinjaOne platform for managing devices, organizations, alerts, and tickets through a decision-tree tool-loading architecture.
      Apache 2.0